@opengis/admin 0.1.85 → 0.1.86

Sign up to get free protection for your applications and to get access to all the features.
@@ -738,7 +738,7 @@ img.ProseMirror-separator {
738
738
 
739
739
  `);return!a||!u?!1:t.chain().command(({tr:l})=>(l.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:i}=e,{$from:r,empty:a}=n;if(!a||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const l=r.after();return l===void 0?!1:i.nodeAt(l)?t.commands.command(({tr:b})=>(b.setSelection(Gt.near(i.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[I0({find:xF,type:this.type,getAttributes:t=>({language:t[1]})}),I0({find:vF,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new $i({key:new Ar("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),i=e.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,a=r==null?void 0:r.mode;if(!n||!a)return!1;const{tr:u,schema:l}=t.state,g=l.text(n.replace(/\r\n?/g,`
740
740
  `));return u.replaceSelectionWith(this.type.create({language:a},g)),u.selection.$from.parent.type!==this.type&&u.setSelection(Vt.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),wF=xo.create({name:"doc",topNode:!0,content:"block+"});function kF(t={}){return new $i({view(e){return new SF(e,t)}})}class SF{constructor(e,n){var i;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=n.width)!==null&&i!==void 0?i:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let a=u=>{this[r](u)};return e.dom.addEventListener(r,a),{name:r,handler:a}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,i;if(n){let l=e.nodeBefore,g=e.nodeAfter;if(l||g){let b=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(b){let k=b.getBoundingClientRect(),E=l?k.bottom:k.top;l&&g&&(E=(E+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),i={left:k.left,right:k.right,top:E-this.width/2,bottom:E+this.width/2}}}}if(!i){let l=this.editorView.coordsAtPos(this.cursorPos);i={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let a,u;if(!r||r==document.body&&getComputedStyle(r).position=="static")a=-pageXOffset,u=-pageYOffset;else{let l=r.getBoundingClientRect();a=l.left-r.scrollLeft,u=l.top-r.scrollTop}this.element.style.left=i.left-a+"px",this.element.style.top=i.top-u+"px",this.element.style.width=i.right-i.left+"px",this.element.style.height=i.bottom-i.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),i=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=i&&i.type.spec.disableDropCursor,a=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!a){let u=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Pw(this.editorView.state.doc,u,this.editorView.dragging.slice);l!=null&&(u=l)}this.setCursor(u),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const EF=Ii.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[kF(this.options)]}});class ri extends Gt{constructor(e){super(e,e)}map(e,n){let i=e.resolve(n.map(this.head));return ri.valid(i)?new ri(i):Gt.near(i)}content(){return pt.empty}eq(e){return e instanceof ri&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ri(e.resolve(n.pos))}getBookmark(){return new Y0(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!CF(e)||!TF(e))return!1;let i=n.type.spec.allowGapCursor;if(i!=null)return i;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,i=!1){e:for(;;){if(!i&&ri.valid(e))return e;let r=e.pos,a=null;for(let u=e.depth;;u--){let l=e.node(u);if(n>0?e.indexAfter(u)<l.childCount:e.index(u)>0){a=l.child(n>0?e.indexAfter(u):e.index(u)-1);break}else if(u==0)return null;r+=n;let g=e.doc.resolve(r);if(ri.valid(g))return g}for(;;){let u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!Bt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*n),i=!1;continue e}break}a=u,r+=n;let l=e.doc.resolve(r);if(ri.valid(l))return l}return null}}}ri.prototype.visible=!1,ri.findFrom=ri.findGapCursorFrom,Gt.jsonID("gapcursor",ri);class Y0{constructor(e){this.pos=e}map(e){return new Y0(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ri.valid(n)?new ri(n):Gt.near(n)}}function CF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),i=t.node(e);if(n==0){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function TF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),i=t.node(e);if(n==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function MF(){return new $i({props:{decorations:DF,createSelectionBetween(t,e,n){return e.pos==n.pos&&ri.valid(n)?new ri(n):null},handleClick:IF,handleKeyDown:AF,handleDOMEvents:{beforeinput:PF}}})}const AF=i2({ArrowLeft:Zf("horiz",-1),ArrowRight:Zf("horiz",1),ArrowUp:Zf("vert",-1),ArrowDown:Zf("vert",1)});function Zf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(i,r,a){let u=i.selection,l=e>0?u.$to:u.$from,g=u.empty;if(u instanceof Vt){if(!a.endOfTextblock(n)||l.depth==0)return!1;g=!1,l=i.doc.resolve(e>0?l.after():l.before())}let b=ri.findGapCursorFrom(l,e,g);return b?(r&&r(i.tr.setSelection(new ri(b))),!0):!1}}function IF(t,e,n){if(!t||!t.editable)return!1;let i=t.state.doc.resolve(e);if(!ri.valid(i))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&Bt.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ri(i))),!0)}function PF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ri))return!1;let{$from:n}=t.state.selection,i=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!i)return!1;let r=je.empty;for(let u=i.length-1;u>=0;u--)r=je.from(i[u].createAndFill(null,r));let a=t.state.tr.replace(n.pos,n.pos,new pt(r,0,0));return a.setSelection(Vt.near(a.doc.resolve(n.pos+1))),t.dispatch(a),!1}function DF(t){if(!(t.selection instanceof ri))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",fi.create(t.doc,[Zr.widget(t.selection.head,e,{key:"gapcursor"})])}const OF=Ii.create({name:"gapCursor",addProseMirrorPlugins(){return[MF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=rn(wt(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),BF=xo.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ci(this.options.HTMLAttributes,t)]},renderText(){return`
741
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:a}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:l}=i.extensionManager,g=a||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:b,dispatch:k})=>{if(k&&g&&u){const E=g.filter(C=>l.includes(C.type.name));b.ensureMarks(E)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),zF=xo.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>I0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Yf=200,Pi=function(){};Pi.prototype.append=function(e){return e.length?(e=Pi.from(e),!this.length&&e||e.length<Yf&&this.leafAppend(e)||this.length<Yf&&e.leafPrepend(this)||this.appendInner(e)):this},Pi.prototype.prepend=function(e){return e.length?Pi.from(e).append(this):this},Pi.prototype.appendInner=function(e){return new NF(this,e)},Pi.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Pi.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Pi.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Pi.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Pi.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},n,i),r},Pi.from=function(e){return e instanceof Pi?e:e&&e.length?new _S(e):Pi.empty};var _S=function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,a){return r==0&&a==this.length?this:new e(this.values.slice(r,a))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,a,u,l){for(var g=a;g<u;g++)if(r(this.values[g],l+g)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,u,l){for(var g=a-1;g>=u;g--)if(r(this.values[g],l+g)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Yf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Yf)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Pi);Pi.empty=new _S([]);var NF=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,a,u){var l=this.left.length;if(r<l&&this.left.forEachInner(i,r,Math.min(a,l),u)===!1||a>l&&this.right.forEachInner(i,Math.max(r-l,0),Math.min(this.length,a)-l,u+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,a,u){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(i,r-l,Math.max(a,l)-l,u+l)===!1||a<l&&this.left.forEachInvertedInner(i,Math.min(r,l),a,u)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var a=this.left.length;return r<=a?this.left.slice(i,r):i>=a?this.right.slice(i-a,r-a):this.left.slice(i,a).append(this.right.slice(0,r-a))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Pi);const RF=500;class Uo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,a;n&&(r=this.remapping(i,this.items.length),a=r.maps.length);let u=e.tr,l,g,b=[],k=[];return this.items.forEach((E,C)=>{if(!E.step){r||(r=this.remapping(i,C+1),a=r.maps.length),a--,k.push(E);return}if(r){k.push(new hs(E.map));let I=E.step.map(r.slice(a)),D;I&&u.maybeStep(I).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new hs(D,void 0,void 0,b.length+k.length))),a--,D&&r.appendMap(D,a)}else u.maybeStep(E.step);if(E.selection)return l=r?E.selection.map(r.slice(a)):E.selection,g=new Uo(this.items.slice(0,i).append(k.reverse().concat(b)),this.eventCount-1),!1},this.items.length,0),{remaining:g,transform:u,selection:l}}addTransform(e,n,i,r){let a=[],u=this.eventCount,l=this.items,g=!r&&l.length?l.get(l.length-1):null;for(let k=0;k<e.steps.length;k++){let E=e.steps[k].invert(e.docs[k]),C=new hs(e.mapping.maps[k],E,n),I;(I=g&&g.merge(C))&&(C=I,k?a.pop():l=l.slice(0,l.length-1)),a.push(C),n&&(u++,n=void 0),r||(g=C)}let b=u-i.depth;return b>VF&&(l=LF(l,b),u-=b),new Uo(l.append(a),u)}remapping(e,n){let i=new Pc;return this.items.forEach((r,a)=>{let u=r.mirrorOffset!=null&&a-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,u)},e,n),i}addMaps(e){return this.eventCount==0?this:new Uo(this.items.append(e.map(n=>new hs(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(C=>{C.selection&&l--},r);let g=n;this.items.forEach(C=>{let I=a.getMirror(--g);if(I==null)return;u=Math.min(u,I);let D=a.maps[I];if(C.step){let R=e.steps[I].invert(e.docs[I]),$=C.selection&&C.selection.map(a.slice(g+1,I));$&&l++,i.push(new hs(D,R,$))}else i.push(new hs(D))},r);let b=[];for(let C=n;C<u;C++)b.push(new hs(a.maps[C]));let k=this.items.slice(0,r).append(b).append(i),E=new Uo(k,l);return E.emptyItemCount()>RF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.maps.length,r=[],a=0;return this.items.forEach((u,l)=>{if(l>=e)r.push(u),u.selection&&a++;else if(u.step){let g=u.step.map(n.slice(i)),b=g&&g.getMap();if(i--,b&&n.appendMap(b,i),g){let k=u.selection&&u.selection.map(n.slice(i));k&&a++;let E=new hs(b.invert(),g,k),C,I=r.length-1;(C=r.length&&r[I].merge(E))?r[I]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Uo(Pi.from(r.reverse()),a)}}Uo.empty=new Uo(Pi.empty,0);function LF(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class hs{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new hs(n.getMap().invert(),n,this.selection)}}}class Ta{constructor(e,n,i,r,a){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const VF=20;function FF(t,e,n,i){let r=n.getMeta(Rl),a;if(r)return r.historyState;n.getMeta(UF)&&(t=new Ta(t.done,t.undone,null,0,-1));let u=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(u&&u.getMeta(Rl))return u.getMeta(Rl).redo?new Ta(t.done.addTransform(n,void 0,i,Xf(e)),t.undone,bS(n.mapping.maps),t.prevTime,t.prevComposition):new Ta(t.done,t.undone.addTransform(n,void 0,i,Xf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),g=t.prevTime==0||!u&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-i.newGroupDelay||!$F(n,t.prevRanges)),b=u?X0(t.prevRanges,n.mapping):bS(n.mapping.maps);return new Ta(t.done.addTransform(n,g?e.selection.getBookmark():void 0,i,Xf(e)),Uo.empty,b,n.time,l??t.prevComposition)}else return(a=n.getMeta("rebased"))?new Ta(t.done.rebased(n,a),t.undone.rebased(n,a),X0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ta(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),X0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function $F(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(n=!0)}),n}function bS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,a,u)=>e.push(a,u));return e}function X0(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),a=e.map(t[i+1],-1);r<=a&&n.push(r,a)}return n}function jF(t,e,n){let i=Xf(e),r=Rl.get(e).spec.config,a=(n?t.undone:t.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(n?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),g=new Ta(n?l:a.remaining,n?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(Rl,{redo:n,historyState:g})}let K0=!1,xS=null;function Xf(t){let e=t.plugins;if(xS!=e){K0=!1,xS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){K0=!0;break}}return K0}const Rl=new Ar("history"),UF=new Ar("closeHistory");function HF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $i({key:Rl,state:{init(){return new Ta(Uo.empty,Uo.empty,null,0,-1)},apply(e,n,i){return FF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?wS:i=="historyRedo"?kS:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function vS(t,e){return(n,i)=>{let r=Rl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=jF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const wS=vS(!1,!0),kS=vS(!0,!0),qF=Ii.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>wS(t,e),redo:()=>({state:t,dispatch:e})=>kS(t,e)}},addProseMirrorPlugins(){return[HF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),WF=xo.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ci(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:i,$to:r}=n,a=t();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):S2(n)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:u,dispatch:l})=>{var g;if(l){const{$to:b}=u.selection,k=b.end();if(b.nodeAfter)b.nodeAfter.isTextblock?u.setSelection(Vt.create(u.doc,b.pos+1)):b.nodeAfter.isBlock?u.setSelection(Bt.create(u.doc,b.pos)):u.setSelection(Vt.create(u.doc,b.pos));else{const E=(g=b.parent.type.contentMatch.defaultType)===null||g===void 0?void 0:g.create();E&&(u.insert(k,E),u.setSelection(Vt.create(u.doc,k+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[S4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ZF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,YF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,XF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,KF=as.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wc({find:GF,type:this.type}),Wc({find:YF,type:this.type})]},addPasteRules(){return[Gc({find:ZF,type:this.type}),Gc({find:XF,type:this.type})]}}),SS=/^(\d+)\.\s$/,JF=xo.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ci(this.options.HTMLAttributes,n),0]:["ol",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Z0.name,this.editor.getAttributes(Yh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Lh({find:SS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Lh({find:SS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Yh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),QF=xo.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),e6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,t6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,n6=as.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wc({find:e6,type:this.type})]},addPasteRules(){return[Gc({find:t6,type:this.type})]}}),ES=xo.create({name:"text",group:"inline"}),i6=Ii.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,g,b,k,E,C,I,D,R,$,G;const q=[];return this.options.bold!==!1&&q.push(mF.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&q.push(uF.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&q.push(gF.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&q.push(bF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&q.push(yS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&q.push(wF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&q.push(EF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&q.push(OF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&q.push(BF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&q.push(zF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&q.push(qF.configure((k=this.options)===null||k===void 0?void 0:k.history)),this.options.horizontalRule!==!1&&q.push(WF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&q.push(KF.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&q.push(Z0.configure((I=this.options)===null||I===void 0?void 0:I.listItem)),this.options.orderedList!==!1&&q.push(JF.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&q.push(QF.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&q.push(n6.configure(($=this.options)===null||$===void 0?void 0:$.strike)),this.options.text!==!1&&q.push(ES.configure((G=this.options)===null||G===void 0?void 0:G.text)),q}}),r6=Ii.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function o6(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=E4(n),g=new RegExp(`\\s${l}$`),b=a?"^":"",k=i?new RegExp(`${b}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${b}(?:^)?${l}[^\\s${l}]*`,"gm"),E=((e=u.nodeBefore)===null||e===void 0?void 0:e.isText)&&u.nodeBefore.text;if(!E)return null;const C=u.pos-E.length,I=Array.from(E.matchAll(k)).pop();if(!I||I.input===void 0||I.index===void 0)return null;const D=I.input.slice(Math.max(0,I.index-1),I.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const $=C+I.index;let G=$+I[0].length;return i&&g.test(E.slice(G-1,G+1))&&(I[0]+=" ",G+=1),$<u.pos&&G>=u.pos?{range:{from:$,to:G},query:I[0].slice(n.length),text:I[0]}:null}const s6=new Ar("suggestion");function a6({pluginKey:t=s6,editor:e,char:n="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:g=()=>null,items:b=()=>[],render:k=()=>({}),allow:E=()=>!0,findSuggestionMatch:C=o6}){let I;const D=k==null?void 0:k(),R=new $i({key:t,view(){return{update:async($,G)=>{var q,se,Q,Se,_e,Ce,Le;const Ie=(q=this.key)===null||q===void 0?void 0:q.getState(G),Ue=(se=this.key)===null||se===void 0?void 0:se.getState($.state),Je=Ie.active&&Ue.active&&Ie.range.from!==Ue.range.from,It=!Ie.active&&Ue.active,ot=Ie.active&&!Ue.active,zt=!It&&!ot&&Ie.query!==Ue.query,Xt=It||Je&&zt,on=zt||Je,$t=ot||Je&&zt;if(!Xt&&!on&&!$t)return;const Kt=$t&&!Xt?Ie:Ue,Cn=$.dom.querySelector(`[data-decoration-id="${Kt.decorationId}"]`);I={editor:e,range:Kt.range,query:Kt.query,text:Kt.text,items:[],command:dn=>g({editor:e,range:Kt.range,props:dn}),decorationNode:Cn,clientRect:Cn?()=>{var dn;const{decorationId:vn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),pn=$.dom.querySelector(`[data-decoration-id="${vn}"]`);return(pn==null?void 0:pn.getBoundingClientRect())||null}:null},Xt&&((Q=D==null?void 0:D.onBeforeStart)===null||Q===void 0||Q.call(D,I)),on&&((Se=D==null?void 0:D.onBeforeUpdate)===null||Se===void 0||Se.call(D,I)),(on||Xt)&&(I.items=await b({editor:e,query:Kt.query})),$t&&((_e=D==null?void 0:D.onExit)===null||_e===void 0||_e.call(D,I)),on&&((Ce=D==null?void 0:D.onUpdate)===null||Ce===void 0||Ce.call(D,I)),Xt&&((Le=D==null?void 0:D.onStart)===null||Le===void 0||Le.call(D,I))},destroy:()=>{var $;I&&(($=D==null?void 0:D.onExit)===null||$===void 0||$.call(D,I))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply($,G,q,se){const{isEditable:Q}=e,{composing:Se}=e.view,{selection:_e}=$,{empty:Ce,from:Le}=_e,Ie={...G};if(Ie.composing=Se,Q&&(Ce||e.view.composing)){(Le<G.range.from||Le>G.range.to)&&!Se&&!G.composing&&(Ie.active=!1);const Ue=C({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:_e.$from}),Je=`id_${Math.floor(Math.random()*4294967295)}`;Ue&&E({editor:e,state:se,range:Ue.range,isActive:G.active})?(Ie.active=!0,Ie.decorationId=G.decorationId?G.decorationId:Je,Ie.range=Ue.range,Ie.query=Ue.query,Ie.text=Ue.text):Ie.active=!1}else Ie.active=!1;return Ie.active||(Ie.decorationId=null,Ie.range={from:0,to:0},Ie.query=null,Ie.text=null),Ie}},props:{handleKeyDown($,G){var q;const{active:se,range:Q}=R.getState($.state);return se&&((q=D==null?void 0:D.onKeyDown)===null||q===void 0?void 0:q.call(D,{view:$,event:G,range:Q}))||!1},decorations($){const{active:G,range:q,decorationId:se}=R.getState($);return G?fi.create($.doc,[Zr.inline(q.from,q.to,{nodeName:u,class:l,"data-decoration-id":se})]):null}}});return R}const l6=new Ar("mention"),c6=xo.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",ci(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:l6,command:({editor:t,range:e,props:n})=>{var i,r,a;const u=t.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(a=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=ci({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:i}=e,{empty:r,anchor:a}=i;return r?(e.doc.nodesBetween(a-1,a,(u,l)=>{if(u.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[a6({editor:this.editor,...this.options.suggestion})]}}),u6=as.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),h6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function d6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBlockquote&&a.toggleBlockquote(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[f.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const p6=$e(h6,[["render",d6]]),f6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function m6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBulletList&&a.toggleBulletList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const g6=$e(f6,[["render",m6]]),y6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function _6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleOrderedList&&a.toggleOrderedList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const b6=$e(y6,[["render",_6]]),x6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function v6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleCodeBlock&&a.toggleCodeBlock(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const w6=$e(x6,[["render",v6]]),k6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function S6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBold&&a.toggleBold(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("bold")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),f.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const E6=$e(k6,[["render",S6]]),C6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function T6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleItalic&&a.toggleItalic(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("italic")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),f.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const M6=$e(C6,[["render",T6]]),A6={},I6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function P6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",I6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const D6={components:{IconA:$e(A6,[["render",P6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},O6={class:"relative flex"},B6={class:"flex w-[160px] flex-wrap gap-[4px]"},z6=["onClick"];function N6(t,e,n,i,r,a){const u=f.resolveComponent("IconA"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",O6,[f.createVNode(u,{height:"20",width:"20",class:"text-gray-500"}),f.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:f.normalizeStyle({backgroundColor:r.color})},null,4)])]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",B6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.colors,g=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:g}),onClick:b=>a.setColor(g),key:g},null,12,z6))),128))])])]),_:1},512)}const R6=$e(D6,[["render",N6]]),L6={},V6={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-dots-vertical"};function F6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",V6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const CS=$e(L6,[["render",F6]]),$6={components:{IconMore:CS},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function j6(t,e,n,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("underline")||n.editor.isActive("strike")}])},[f.createVNode(u,{height:"18",width:"18",class:"rotate-90"})],2)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=(...g)=>a.toggleUnderline&&a.toggleUnderline(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":n.editor.isActive("underline")}])}," Підкресленний ",2),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...g)=>a.toggleStrike&&a.toggleStrike(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const U6={bold:E6,italic:M6,text_more:$e($6,[["render",j6]]),color:R6,bullet_list:g6,ordered_list:b6,blockquote:p6,codeblock:w6},H6={components:{EditorContent:lF},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(U6).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new aF({content:this.modelValue,extensions:[i6,yS,Yh,r6,u6,ES,c6.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{const e=this.options.filter(n=>{var i,r;return(r=(i=n==null?void 0:n.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{t=document.createElement("div"),t.className="mention-popup",n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)}),document.body.appendChild(t);const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.position="absolute",t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`,e=t},onUpdate:n=>{for(;t.firstChild;)t.removeChild(t.firstChild);n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)});const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},q6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},W6={key:0,class:"flex flex-wrap items-center w-full gap-2 px-3 py-2 border-b editor-toolbar dark:border-gray-600"};function G6(t,e,n,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",q6,[r.editor?(f.openBlock(),f.createElementBlock("div",W6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.controlsList,(l,g)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(l),{key:g,editor:r.editor},null,8,["editor"]))),128))])):f.createCommentVNode("",!0),f.createElementVNode("div",{onClick:e[0]||(e[0]=(...l)=>a.focusEditor&&a.focusEditor(...l)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[f.createVNode(u,{editor:r.editor,class:"relative w-full"},null,8,["editor"])])])}const TS=$e(H6,[["render",G6]]),Z6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},Y6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return Z6(this.name)}}},X6={class:"mr-2"},K6=["src"],J6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},Q6={key:0},e$={key:1,class:"text-sm"};function t$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",X6,[n.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,src:n.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,K6)):n.name?(f.openBlock(),f.createElementBlock("div",J6,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",Q6,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",e$,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const n$={components:{VsWidgetCommentsAvatar:$e(Y6,[["render",t$]]),VsTextEditor:TS},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,textareaValue:""}},computed:{isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const t=ht(this.comment.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(t){t&&(this.textareaValue=this.comment.body)}},methods:{confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await rt.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await rt.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},i$={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},r$={class:"flex justify-between items-center mb-2"},o$={class:"flex items-center"},s$={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},a$={class:"text-sm text-gray-600 dark:text-gray-400"},l$={class:"flex flex-col items-center gap-[4px]"},c$=["innerHTML"],u$={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},h$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function d$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAvatar"),l=f.resolveComponent("VsPopover"),g=f.resolveComponent("VsTextEditor"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",i$,[f.createElementVNode("div",r$,[f.createElementVNode("div",o$,[f.createElementVNode("p",s$,[f.createVNode(u,{name:n.comment.username,avatar:n.comment.avatar},null,8,["name","avatar"]),f.createTextVNode(f.toDisplayString(n.comment.username),1)]),f.createElementVNode("p",a$,[f.createElementVNode("time",null,f.toDisplayString(a.createDate),1)])]),f.createVNode(l,{placement:"bottom"},{reference:f.withCtx(()=>e[6]||(e[6]=[f.createElementVNode("button",{class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-500 dark:text-gray-40 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-50 dark:bg-gray-900 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},[f.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 3"},[f.createElementVNode("path",{d:"M2 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm6.041 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM14 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z"})])],-1)])),default:f.withCtx(()=>[f.createElementVNode("div",l$,[f.createElementVNode("button",{type:"button",class:"block px-[12px] rounded-lg py-[4px] text-start w-[100px] duration-300 hover:bg-gray-100",onClick:e[0]||(e[0]=(...k)=>a.openEditModal&&a.openEditModal(...k))}," Редагувати "),f.createElementVNode("button",{type:"button",class:"block py-2 px-[12px] rounded-lg py-[6px] text-start duration-300 w-[100px] hover:bg-gray-100",onClick:e[1]||(e[1]=k=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),f.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:n.comment.body},null,8,c$)]),f.createVNode(b,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=k=>r.isOpen=k),title:"Редагувати",size:"small"},{footer:f.withCtx(()=>[f.createElementVNode("div",h$,[f.createElementVNode("button",{onClick:e[3]||(e[3]=k=>r.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Відмінити "),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...k)=>a.updateComment&&a.updateComment(...k)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:f.withCtx(()=>[f.createElementVNode("div",u$,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=k=>r.textareaValue=k),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const p$={components:{VsWidgetCommentsItem:$e(n$,[["render",d$]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:t}=await rt.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},f$={class:"flex flex-col"},m$={key:0,class:"max-h-[300px] overflow-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"},g$={key:1},y$={class:"p-4"},_$={class:"mt-1 text-gray-500 dark:text-neutral-500"},b$={class:"mt-4 flex justify-end gap-x-3"};function x$(t,e,n,i,r,a){const u=f.resolveComponent("VsErrorOnLoading"),l=f.resolveComponent("VsWidgetCommentsItem"),g=f.resolveComponent("VsLoader"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock("div",f$,[r.isLoaded?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[r.isLoadFailed?(f.openBlock(),f.createBlock(u,{key:0})):(f.openBlock(),f.createElementBlock(f.Fragment,{key:1},[r.comments.length?(f.openBlock(),f.createElementBlock("div",m$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.comments,(k,E)=>(f.openBlock(),f.createBlock(l,{key:E,comment:k,user:r.user,options:n.options,index:E,id:n.id,onListUpdate:a.getComments,class:"border-top",onOpenModal:e[0]||(e[0]=C=>a.handleOpenModal(C))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(f.openBlock(),f.createElementBlock("div",g$,e[4]||(e[4]=[f.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(f.openBlock(),f.createBlock(g,{key:1,class:"justify-center",text:"Please wait..."})),f.createVNode(b,{title:r.modal.title,size:"small",visible:r.isModalVisible,"onUpdate:visible":e[3]||(e[3]=k=>r.isModalVisible=k)},{default:f.withCtx(()=>[f.createElementVNode("div",y$,[f.createElementVNode("p",_$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",b$,[f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm 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",onClick:e[1]||(e[1]=(...k)=>r.modal.cancel&&r.modal.cancel(...k))},f.toDisplayString(r.modal.cancelButtonText),1),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...k)=>r.modal.confirm&&r.modal.confirm(...k))},f.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const v$=$e(p$,[["render",x$]]),w$={components:{VsTextEditor:TS},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await rt.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t}}},k$={class:"flex flex-col items-start w-full widget-comment-form"},S$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},E$={class:"flex"};function C$(t,e,n,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",k$,[f.createElementVNode("div",S$,[f.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:n.options},null,8,["modelValue","options"])]),f.createElementVNode("div",E$,[f.createElementVNode("button",{ref:"buttonAdd",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",onClick:e[1]||(e[1]=(...l)=>a.addNewComment&&a.addNewComment(...l))}," Відправити коментар ",512)])])}const T$={components:{VsWidgetCommentsList:v$,VsWidgetCommentsAddForm:$e(w$,[["render",C$]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await rt.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},M$={class:"w-full bg-white-200"};function A$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",M$,[e[2]||(e[2]=f.createElementVNode("div",{class:"flex items-center justify-between w-full mb-4 gap-x-2"},null,-1)),f.createVNode(u,{options:r.options,class:"mb-6",id:n.id,onListUpdate:e[0]||(e[0]=g=>a.listUpdate())},null,8,["options","id"]),f.createVNode(l,{options:r.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=g=>a.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const MS=$e(T$,[["render",A$]]),AS=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),I$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),P$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},D$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return P$(this.username)}}}),O$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function B$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",O$,f.toDisplayString(t.inItials),1)}const z$=$e(D$,[["render",B$]]),J0={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(n.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{J0.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${n}`]?u=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(u=document.createElement("link"),u.href=t,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=t,e&&(u.type=e)),window.headLoadedFiles[`_${n}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},N$={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await J0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await J0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},R$={id:"map",style:{height:"9rem",width:"24rem"}};function L$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",R$)}const V$=$e(N$,[["render",L$]]),F$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:z$,VsWidgetHistoryItemMap:V$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return I$(t.cdate)}}}),$$={class:"relative [&_p]:m-0"},j$={class:"flex items-center gap-3"},U$={class:"w-full flex justify-between"},H$={class:"text-gray-500"},q$={class:"text-gray-800 font-medium"},W$={class:"text-gray-500 text-sm"},G$={class:"mt-2 pl-10"},Z$={key:0},Y$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},X$={class:"font-medium"},K$={class:"font-medium"};function J$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",$$,[f.createElementVNode("div",j$,[f.createVNode(u,{username:t.item.username},null,8,["username"]),f.createElementVNode("div",U$,[f.createElementVNode("p",H$,[f.createElementVNode("span",q$,f.toDisplayString(t.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",W$,f.toDisplayString(t.getDate(t.item)),1)])]),f.createElementVNode("div",G$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.item.changes,(g,b)=>(f.openBlock(),f.createElementBlock("div",{key:b},[g.attr==="geom"?(f.openBlock(),f.createElementBlock("div",Z$,[e[1]||(e[1]=f.createElementVNode("p",null,"Додана геометрія:",-1)),g.new?(f.openBlock(),f.createBlock(l,{key:0,point:g.new},null,8,["point"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createElementBlock("div",Y$,[f.createElementVNode("p",null,f.toDisplayString(`- ${t.getTitle(g)}:`),1),f.createElementVNode("p",X$,f.toDisplayString(t.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",K$,f.toDisplayString(t.getNewValue(g)),1)]))]))),128))])])}const Q$=$e(F$,[["render",J$]]),e8=f.defineComponent({components:{VsWidgetHistoryItem:Q$,VsEmptyWidget:qv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?AS(this.history.data.cdate):""},lastEditDate(){return this.history.data?AS(this.history.data.edate):""},authorName(){return this.history.data?this.history.data.author:""}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:t}=await rt.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),t8={class:"bg-white"},n8={key:0,class:"space-y-6 list-none relative !px-0 sm:before:absolute sm:before:top-2 sm:before:bottom-0 sm:before:w-0.5 sm:before:left-4 before:bg-gray-200 max-h-[400px] overflow-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"},i8={key:1,class:"w-full h-[330px] flex items-center justify-center"};function r8(t,e,n,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",t8,[e[0]||(e[0]=f.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(l=t.history.rows)!=null&&l.length?(f.openBlock(),f.createElementBlock("ul",n8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.history.rows,g=>(f.openBlock(),f.createElementBlock("li",{class:"list-none mr-[10px]",key:g.uid},[f.createVNode(u,{item:g},null,8,["item"])]))),128))])):(f.openBlock(),f.createElementBlock("div",i8," Історія відсутні "))])}const o8=$e(e8,[["render",r8]]),s8={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"},a8={class:"inline-block w-full align-middle"},l8={class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},c8={class:"dark:bg-neutral-700"},u8={class:"divide-y divide-gray-200 dark:divide-neutral-700"},h8={key:1,class:"divide-y divide-gray-200 dark:divide-neutral-700"},Kf=10,d8={"vs-widget-map":Z1,"vs-widget-gallery":zN,"vs-widget-comments":MS,"vs-widget-file":Gv,"vs-widget-history":o8,"vs-widget-table":{__name:"vs-widget-table",props:{data:Object,columns:Array,token:String},setup(t){const e=t,n=f.ref([]),i=f.ref(1),r=async()=>{var l,g;if((l=e.data)!=null&&l.tokens[e.token])try{const{data:b}=await rt.get(`/api/table-data/${(g=e.data)==null?void 0:g.tokens[e.token]}`);n.value=b.rows}catch(b){console.error("Ошибка при загрузке данных таблицы:",b)}},a=l=>{i.value=l},u=f.computed(()=>{const l=(i.value-1)*Kf;return n.value.slice(l,l+Kf)});return f.onMounted(()=>{r()}),(l,g)=>{var k,E,C;const b=f.resolveComponent("VsPagination");return f.openBlock(),f.createElementBlock("div",s8,[f.createElementVNode("div",a8,[f.createElementVNode("table",l8,[(k=t.columns)!=null&&k.length?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createElementVNode("thead",c8,[f.createElementVNode("tr",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(I,D)=>(f.openBlock(),f.createElementBlock("th",{key:D,scope:"col",class:"px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase dark:text-neutral-400 min-w-[200px]"},f.toDisplayString(I.title),1))),128))])]),f.createElementVNode("tbody",u8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(I==null?void 0:I[R.name]),1))),128))]))),128))])],64)):(f.openBlock(),f.createElementBlock("tbody",h8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(I,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(R),1))),128))]))),128))]))])]),((E=n.value)==null?void 0:E.length)>Kf?(f.openBlock(),f.createBlock(b,{key:0,goTo:!1,"default-page":1,total:(C=n.value)==null?void 0:C.length,pageSize:Kf,onPageChange:a,backgroundColor:"#F3F4F6"},null,8,["total"])):f.createCommentVNode("",!0)])}}}},p8={"table-format-text":yp,"table-format-select":Ux,"table-format-badge":$x,"table-format-swetch":_p,"table-format-check":_p,"table-format-html":yp,"table-format-tags":Hx,"table-format-date":ay,"table-format-number":j1,"table-format-slot":U1},f8={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},m8={__name:"vs-dashboard",setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",f8,n[0]||(n[0]=[f.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"mb-4 xl:mb-8"},[f.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),f.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),f.createElementVNode("div",{class:"space-y-5"},[f.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[f.createElementVNode("div",{class:"relative w-full"},[f.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[f.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",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"},[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),f.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),f.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),f.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[f.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[f.createElementVNode("span",{class:"sr-only"},"Close"),f.createElementVNode("svg",{class:"shrink-0 size-4",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"},[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),f.createElementVNode("path",{d:"m15 9-6 6"}),f.createElementVNode("path",{d:"m9 9 6 6"})])])])]),f.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[f.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm 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"},[f.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",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"},[f.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),f.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),f.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[f.createElementVNode("span",{class:"hidden sm:block"},"Send"),f.createTextVNode("Invite ")])])]),f.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"})]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),f.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-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"},[f.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[f.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("thead",null,[f.createElementVNode("tr",null,[f.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[f.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),f.createElementVNode("th",{scope:"col",class:"min-w-48"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),f.createElementVNode("th",{scope:"col",class:"min-w-36"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),f.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},g8={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function y8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",{onClick:e[0]||(e[0]=(...u)=>a.notify&&a.notify(...u)),class:"py-2 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"}," Custom component ")}const _8=$e(g8,[["render",y8]]),b8={props:{item:{type:Object},actionsLength:{type:Number}},data(){return{toggletMap:{}}},methods:{toggleHandler(t){this.toggletMap[t]=!this.toggletMap[t],this.$emit("on:toggled",{optionID:t,toggled:this.toggletMap[t]})}}},x8={class:"md:col-span-2"},v8={class:"font-semibold text-gray-800 dark:text-neutral-200"},w8={class:"md:block md:col-span-1 md:text-center"},k8=["onClick"];function S8(t,e,n,i,r,a){var u;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid md:gap-x-6 bg-gray-100 rounded-lg p-3 md:p-5 dark:bg-neutral-700",`grid-cols-${n.actionsLength+2}`])},[f.createElementVNode("li",x8,[f.createElementVNode("h3",v8,f.toDisplayString(n.item.ua),1)]),(u=n.item.menu)!=null&&u.length?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(n.actionsLength,l=>(f.openBlock(),f.createElementBlock("li",w8,[f.createElementVNode("button",{onClick:g=>a.toggleHandler(l),type:"button",class:"text-xs text-blue-600 decoration-2 hover:underline font-medium focus:outline-none focus:underline dark:text-blue-400 dark:hover:text-blue-500"}," Toggle all ",8,k8)]))),256)):f.createCommentVNode("",!0)],2)}const E8=$e(b8,[["render",S8]]),C8={props:{subitem:{type:Object},toggled:{type:Boolean},optionID:{type:Number},actions:{type:Array,default:()=>[]},routes:{type:Array}},data(){return{checkedInputMap:{}}},watch:{toggledAndOptionID:{handler([t,e]){this.updateCheckedInputs(t,e)},deep:!0,immediate:!0}},computed:{toggledAndOptionID(){return[this.toggled,this.optionID]}},methods:{updateCheckedInputs(){for(let t=1;t<=this.actions.length;t++)t===this.optionID&&(this.checkedInputMap[t]=this.toggled),t===this.optionID&&this.sendEmit(this.optionID)},inputHandler(t){this.checkedInputMap[t]=!this.checkedInputMap[t],this.sendEmit(t)},sendEmit(t){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checked:this.checkedInputMap[t],optionID:t-1})}},mounted(){var e;const t=(e=this.routes)==null?void 0:e.find(n=>n.path==this.subitem.path);if(t)for(let n=1;n<=this.actions.length;n++)t.actions.includes(this.actions[n])&&(this.checkedInputMap[n]=!0,this.sendEmit(n))}},T8={class:"md:col-span-2"},M8={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},A8={class:"text-sm text-gray-500 dark:text-neutral-500"},I8={class:"grid grid-cols-2 items-center md:block text-end md:text-center"},P8=["onInput","onUpdate:modelValue"];function D8(t,e,n,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3",`grid-cols-${n.actions.length+2}`])},[f.createElementVNode("li",T8,[f.createElementVNode("p",M8,f.toDisplayString(((u=n.subitem)==null?void 0:u.ua)||""),1),f.createElementVNode("p",A8,f.toDisplayString(((l=n.subitem)==null?void 0:l.path)||""),1)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.actions.length,g=>(f.openBlock(),f.createElementBlock("li",{class:"col-span-1",key:g},[f.createElementVNode("div",I8,[f.withDirectives(f.createElementVNode("input",{onInput:b=>a.inputHandler(g),type:"checkbox",class:"shrink-0 border-gray-300 rounded text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800","onUpdate:modelValue":b=>r.checkedInputMap[g]=b},null,40,P8),[[f.vModelCheckbox,r.checkedInputMap[g]]])])]))),128))],2)}const O8={props:{options:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:E8,VsGroupSecondLevel:$e(C8,[["render",D8]])},data(){return{list:[],history:this.routes,toggledInputs:!1}},methods:{async getData(){try{const t=await rt.get("/api/user-menu");this.list=t.data||{}}catch(t){console.error(t)}},toggleCheck(t,e){try{const n=this.options[t.optionID];this.list[e].menu.map(i=>(i.path==t.subitemPath&&(i[n]=t.checked),i)),this.pushToHistory()}catch(n){console.error(n)}},toggleAll(t,e){this.list[e].toggled=t.toggled,this.list[e].optionID=t.optionID},pushToHistory(){var t;try{this.history=[];const e=this.list.map(n=>{var i;return(i=n.menu)==null?void 0:i.filter(r=>this.options.some(a=>r[a])).map(r=>r.path)}).filter(n=>n&&n.length>0).flat();(t=this.list)==null||t.map(n=>{var i;(i=n.menu)==null||i.map(r=>{if(e.includes(r.path)){const a=this.options.filter(u=>r[u]);this.history.push({path:r.path,actions:a})}})}),this.$emit("on:change",this.history)}catch(e){console.error(e)}}},async mounted(){await this.getData()}},B8={class:"flex items-center justify-center"},z8={class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},N8={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},R8={class:"space-y-8"},L8={class:"space-y-5"};function V8(t,e,n,i,r,a){const u=f.resolveComponent("VsGrouptFirstLevel"),l=f.resolveComponent("VsGroupSecondLevel");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",B8,[f.createElementVNode("div",z8,[f.createElementVNode("div",{class:f.normalizeClass(["grid lg:gap-x-3 md:gap-x-6 p-3 md:p-5",`grid-cols-${n.options.length+2}`])},[e[0]||(e[0]=f.createElementVNode("div",{class:"col-span-2 self-center"},[f.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"}," Групи ")],-1)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.options,(g,b)=>(f.openBlock(),f.createElementBlock("div",{class:"col-span-1 text-center",key:b},[f.createElementVNode("h3",N8,f.toDisplayString(g),1)]))),128))],2),f.createElementVNode("div",R8,[f.createElementVNode("div",L8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.list,(g,b)=>{var k;return f.openBlock(),f.createElementBlock("div",{key:b},[f.createVNode(u,{item:g,"onOn:toggled":E=>a.toggleAll(E,b),actionsLength:(k=n.options)==null?void 0:k.length},null,8,["item","onOn:toggled","actionsLength"]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(g.menu,(E,C)=>(f.openBlock(),f.createBlock(l,{toggled:(g==null?void 0:g.toggled)||!1,optionID:g==null?void 0:g.optionID,key:C,subitem:E,actions:n.options,"onOn:checked":I=>a.toggleCheck(I,b),routes:n.routes},null,8,["toggled","optionID","subitem","actions","onOn:checked","routes"]))),128))])}),128))])])])]),f.createTextVNode(" "+f.toDisplayString(r.history),1)],64)}const F8=$e(O8,[["render",V8]]),$8={__name:"vs-group-interface-page",setup(t){const e=["view","add","edit","delete"],n=[{path:"rest_zone",actions:["view","add"]},{path:"itree.event_report",actions:["edit"]},{path:"itree.invent_street_furniture",actions:["edit","delete"]},{path:"itree.pictures",actions:["add"]},{path:"account_light2",actions:["view"]}];return(i,r)=>(f.openBlock(),f.createBlock(f.unref(F8),{options:e,routes:n}))}},j8={},U8={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",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 H8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",U8,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),f.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const Q0=$e(j8,[["render",H8]]),q8={components:{IconSearch:Q0},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var i;return(i=n==null?void 0:n.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await rt.get("/api/user-cls?type=json");this.data=t}catch{}}}},W8={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},G8={class:"relative"},Z8={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] pr-0 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 100px)"}},Y8={class:"w-[99%] overflow-hidden overflow-ellipsis"},X8={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function K8(t,e,n,i,r,a){const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",W8,[f.createElementVNode("div",G8,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=b=>r.searchValue=b),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("ul",Z8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.rows,b=>{var k,E;return f.openBlock(),f.createElementBlock("li",{key:b==null?void 0:b.id,class:"w-full pr-[10px]"},[f.createVNode(g,{to:r.link+"?name="+((b==null?void 0:b.name)||(b==null?void 0:b.id)),class:f.normalizeClass(["py-2 px-5 group pr-[10px] flex items-center gap-x-3 w-full flex justify-between hover:bg-gray-100 rounded-lg duration-300",{"bg-gray-100":((E=(k=t.$route)==null?void 0:k.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",Y8,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",X8,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const J8=$e(q8,[["render",K8]]),Q8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},ej={class:"w-full"},tj={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},nj={class:"max-w-sm mx-auto mt-6"},ij={class:"font-medium text-gray-800 dark:text-neutral-200"},rj={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function oj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",ej,[f.createElementVNode("div",tj,[e[0]||(e[0]=f.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),f.createElementVNode("div",nj,[f.createElementVNode("p",ij,f.toDisplayString(n.title),1),f.createElementVNode("p",rj,f.toDisplayString(n.text),1)])])])}const IS=$e(Q8,[["render",oj]]),sj={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},aj={class:"flex w-[160px] flex-wrap gap-[4px]"},lj=["onClick"];function cj(t,e,n,i,r,a){const u=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(u,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:f.normalizeStyle({backgroundColor:n.modelValue})},null,4)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",aj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.colors,l=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:l}),onClick:g=>a.updateColor(l),key:l},null,12,lj))),128))])])]),_:1},512)}const PS=$e(sj,[["render",cj]]),uj={components:{VsChoceColor:PS},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item},t)}}},hj={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},dj={class:"flex flex-col"},pj={class:"flex gap-[30px]"},fj={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},mj={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},gj={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function yj(t,e,n,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",hj,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",dj,[f.createElementVNode("div",pj,[f.createVNode(l,{modelValue:r.text,"onUpdate:modelValue":e[1]||(e[1]=b=>r.text=b),onUpdateValue:e[2]||(e[2]=b=>r.text=b)},{default:f.withCtx(()=>[f.createElementVNode("p",fj,f.toDisplayString(r.text),1)]),_:1},8,["modelValue"]),f.createVNode(l,{modelValue:r.id,"onUpdate:modelValue":e[3]||(e[3]=b=>r.id=b),onUpdateValue:e[4]||(e[4]=b=>r.id=b)},{default:f.withCtx(()=>[f.createElementVNode("p",mj,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",gj,f.toDisplayString((g=n.item)==null?void 0:g.parent),1)])])}const _j={components:{VsReesterUsersItem:$e(uj,[["render",yj]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const i=[...this.list],r=i[n];i.splice(n,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t,e){var i;const n=(i=this.list)==null?void 0:i.findIndex(r=>(r==null?void 0:r.id)===(t==null?void 0:t.id));this.list[n]=t,e&&(this.list[n].id=e),this.$emit("update-list",this.list)}}},bj={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},xj=["onDragstart","onDrop"];function vj(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",bj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.list,(l,g)=>(f.openBlock(),f.createElementBlock("li",{key:l==null?void 0:l.id,draggable:!0,onDragstart:b=>a.dragStart(b,g),onDragover:e[0]||(e[0]=b=>a.dragOver(b)),onDrop:b=>a.drop(b,g),onDragend:e[1]||(e[1]=(...b)=>a.dragEnd&&a.dragEnd(...b))},[f.createVNode(u,{item:l,onUpdateItem:a.updateItem},null,8,["item","onUpdateItem"])],40,xj))),128))])}const wj={components:{VsNoData:IS,VsChoceColor:PS,IconCheck:jx,VsReesterUsersList:$e(_j,[["render",vj],["__scopeId","data-v-293d7735"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,i;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await rt.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,i;try{const{form:r}=this.$refs;await r.doValidation(),await rt.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(n=this.data)==null?void 0:n.children)==null?void 0:i.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(r){console.log(r)}},async updateChildren(t){var e,n;this.data.children=t;try{await rt.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},kj={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},Sj={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},Ej={class:"flex items-end w-full gap-[4px]"};function Cj(t,e,n,i,r,a){var E,C,I,D,R;const u=f.resolveComponent("VsForm"),l=f.resolveComponent("VsChoceColor"),g=f.resolveComponent("IconCheck"),b=f.resolveComponent("VsReesterUsersList"),k=f.resolveComponent("VsNoData");return f.openBlock(),f.createElementBlock("div",kj,[(C=(E=t.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Sj,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",Ej,[r.formVisible?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=$=>r.formValues=$),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0),f.createVNode(l,{modelValue:r.color,"onUpdate:modelValue":e[1]||(e[1]=$=>r.color=$)},null,8,["modelValue"]),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...$)=>a.addOneChild&&a.addOneChild(...$)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[f.createVNode(g,{height:"20",width:"20"})])]),(D=(I=r.data)==null?void 0:I.children)!=null&&D.length?(f.openBlock(),f.createBlock(b,{key:0,list:(R=r.data)==null?void 0:R.children,onUpdateList:a.updateChildren},null,8,["list","onUpdateList"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(k,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const Tj={components:{VsReesterNavList:J8,VsReesterContent:$e(wj,[["render",Cj]])}},Mj={class:"flex items-start gap-0"};function Aj(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",Mj,[f.createVNode(u),f.createVNode(l)])}const e_={...d8,...p8,"vs-dashboard":m8,"vs-custom-button":_8,"vs-group-interface":$8,...{"user-cls-page":$e(Tj,[["render",Aj]])}},DS=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...DS(n.menu)):e.push(n)}),e},So=f.ref(null),t_=f.ref(!1),OS={$form:({token:t,api:e,id:n,form:i})=>new Promise(r=>{var k,E;const{VsDialog:a,VsForm:u}=(E=(k=window.app)==null?void 0:k._context)==null?void 0:E.components,l=document.querySelector("#modal");if(!l){console.error('Modal root element with id "#modal" not found!');return}const g=document.createElement("div");l.appendChild(g);const b=f.createApp({components:{VsDialog:a,VsForm:u},data(){return{visible:!1,formValues:{},scheme:null}},methods:{close(C){this.visible=!1,this.$el.remove(),b.unmount(),r(C||"Success")},async getFormScheme(){try{if(t){const I=await rt.get(`/api/table/${t}`);this.formValues=I.data}const{data:C}=await rt.get(`/api/template/form/${t||i}`);this.scheme=(C==null?void 0:C.schema)||C}catch(C){console.error("Error fetching form scheme:",C)}finally{this.visible=!0}},async updateData(){const C=this.$refs.form;try{await C.doValidation();const{data:I}=await rt.put(`${e||"/api/table/"}${t||n}`,this.formValues);t_.value=!t_.value,this.visible=!1,this.close(I)}catch(I){console.error("Error updating data:",I)}}},mounted(){this.getFormScheme()},template:`
741
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:a}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:l}=i.extensionManager,g=a||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:b,dispatch:k})=>{if(k&&g&&u){const E=g.filter(C=>l.includes(C.type.name));b.ensureMarks(E)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),zF=xo.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>I0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Yf=200,Pi=function(){};Pi.prototype.append=function(e){return e.length?(e=Pi.from(e),!this.length&&e||e.length<Yf&&this.leafAppend(e)||this.length<Yf&&e.leafPrepend(this)||this.appendInner(e)):this},Pi.prototype.prepend=function(e){return e.length?Pi.from(e).append(this):this},Pi.prototype.appendInner=function(e){return new NF(this,e)},Pi.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Pi.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Pi.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Pi.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Pi.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},n,i),r},Pi.from=function(e){return e instanceof Pi?e:e&&e.length?new _S(e):Pi.empty};var _S=function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,a){return r==0&&a==this.length?this:new e(this.values.slice(r,a))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,a,u,l){for(var g=a;g<u;g++)if(r(this.values[g],l+g)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,u,l){for(var g=a-1;g>=u;g--)if(r(this.values[g],l+g)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Yf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Yf)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Pi);Pi.empty=new _S([]);var NF=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,a,u){var l=this.left.length;if(r<l&&this.left.forEachInner(i,r,Math.min(a,l),u)===!1||a>l&&this.right.forEachInner(i,Math.max(r-l,0),Math.min(this.length,a)-l,u+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,a,u){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(i,r-l,Math.max(a,l)-l,u+l)===!1||a<l&&this.left.forEachInvertedInner(i,Math.min(r,l),a,u)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var a=this.left.length;return r<=a?this.left.slice(i,r):i>=a?this.right.slice(i-a,r-a):this.left.slice(i,a).append(this.right.slice(0,r-a))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Pi);const RF=500;class Uo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,a;n&&(r=this.remapping(i,this.items.length),a=r.maps.length);let u=e.tr,l,g,b=[],k=[];return this.items.forEach((E,C)=>{if(!E.step){r||(r=this.remapping(i,C+1),a=r.maps.length),a--,k.push(E);return}if(r){k.push(new hs(E.map));let I=E.step.map(r.slice(a)),D;I&&u.maybeStep(I).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new hs(D,void 0,void 0,b.length+k.length))),a--,D&&r.appendMap(D,a)}else u.maybeStep(E.step);if(E.selection)return l=r?E.selection.map(r.slice(a)):E.selection,g=new Uo(this.items.slice(0,i).append(k.reverse().concat(b)),this.eventCount-1),!1},this.items.length,0),{remaining:g,transform:u,selection:l}}addTransform(e,n,i,r){let a=[],u=this.eventCount,l=this.items,g=!r&&l.length?l.get(l.length-1):null;for(let k=0;k<e.steps.length;k++){let E=e.steps[k].invert(e.docs[k]),C=new hs(e.mapping.maps[k],E,n),I;(I=g&&g.merge(C))&&(C=I,k?a.pop():l=l.slice(0,l.length-1)),a.push(C),n&&(u++,n=void 0),r||(g=C)}let b=u-i.depth;return b>VF&&(l=LF(l,b),u-=b),new Uo(l.append(a),u)}remapping(e,n){let i=new Pc;return this.items.forEach((r,a)=>{let u=r.mirrorOffset!=null&&a-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,u)},e,n),i}addMaps(e){return this.eventCount==0?this:new Uo(this.items.append(e.map(n=>new hs(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(C=>{C.selection&&l--},r);let g=n;this.items.forEach(C=>{let I=a.getMirror(--g);if(I==null)return;u=Math.min(u,I);let D=a.maps[I];if(C.step){let R=e.steps[I].invert(e.docs[I]),$=C.selection&&C.selection.map(a.slice(g+1,I));$&&l++,i.push(new hs(D,R,$))}else i.push(new hs(D))},r);let b=[];for(let C=n;C<u;C++)b.push(new hs(a.maps[C]));let k=this.items.slice(0,r).append(b).append(i),E=new Uo(k,l);return E.emptyItemCount()>RF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.maps.length,r=[],a=0;return this.items.forEach((u,l)=>{if(l>=e)r.push(u),u.selection&&a++;else if(u.step){let g=u.step.map(n.slice(i)),b=g&&g.getMap();if(i--,b&&n.appendMap(b,i),g){let k=u.selection&&u.selection.map(n.slice(i));k&&a++;let E=new hs(b.invert(),g,k),C,I=r.length-1;(C=r.length&&r[I].merge(E))?r[I]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Uo(Pi.from(r.reverse()),a)}}Uo.empty=new Uo(Pi.empty,0);function LF(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class hs{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new hs(n.getMap().invert(),n,this.selection)}}}class Ta{constructor(e,n,i,r,a){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const VF=20;function FF(t,e,n,i){let r=n.getMeta(Rl),a;if(r)return r.historyState;n.getMeta(UF)&&(t=new Ta(t.done,t.undone,null,0,-1));let u=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(u&&u.getMeta(Rl))return u.getMeta(Rl).redo?new Ta(t.done.addTransform(n,void 0,i,Xf(e)),t.undone,bS(n.mapping.maps),t.prevTime,t.prevComposition):new Ta(t.done,t.undone.addTransform(n,void 0,i,Xf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),g=t.prevTime==0||!u&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-i.newGroupDelay||!$F(n,t.prevRanges)),b=u?X0(t.prevRanges,n.mapping):bS(n.mapping.maps);return new Ta(t.done.addTransform(n,g?e.selection.getBookmark():void 0,i,Xf(e)),Uo.empty,b,n.time,l??t.prevComposition)}else return(a=n.getMeta("rebased"))?new Ta(t.done.rebased(n,a),t.undone.rebased(n,a),X0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ta(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),X0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function $F(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(n=!0)}),n}function bS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,a,u)=>e.push(a,u));return e}function X0(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),a=e.map(t[i+1],-1);r<=a&&n.push(r,a)}return n}function jF(t,e,n){let i=Xf(e),r=Rl.get(e).spec.config,a=(n?t.undone:t.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(n?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),g=new Ta(n?l:a.remaining,n?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(Rl,{redo:n,historyState:g})}let K0=!1,xS=null;function Xf(t){let e=t.plugins;if(xS!=e){K0=!1,xS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){K0=!0;break}}return K0}const Rl=new Ar("history"),UF=new Ar("closeHistory");function HF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $i({key:Rl,state:{init(){return new Ta(Uo.empty,Uo.empty,null,0,-1)},apply(e,n,i){return FF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?wS:i=="historyRedo"?kS:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function vS(t,e){return(n,i)=>{let r=Rl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=jF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const wS=vS(!1,!0),kS=vS(!0,!0),qF=Ii.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>wS(t,e),redo:()=>({state:t,dispatch:e})=>kS(t,e)}},addProseMirrorPlugins(){return[HF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),WF=xo.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ci(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:i,$to:r}=n,a=t();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):S2(n)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:u,dispatch:l})=>{var g;if(l){const{$to:b}=u.selection,k=b.end();if(b.nodeAfter)b.nodeAfter.isTextblock?u.setSelection(Vt.create(u.doc,b.pos+1)):b.nodeAfter.isBlock?u.setSelection(Bt.create(u.doc,b.pos)):u.setSelection(Vt.create(u.doc,b.pos));else{const E=(g=b.parent.type.contentMatch.defaultType)===null||g===void 0?void 0:g.create();E&&(u.insert(k,E),u.setSelection(Vt.create(u.doc,k+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[S4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ZF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,YF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,XF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,KF=as.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wc({find:GF,type:this.type}),Wc({find:YF,type:this.type})]},addPasteRules(){return[Gc({find:ZF,type:this.type}),Gc({find:XF,type:this.type})]}}),SS=/^(\d+)\.\s$/,JF=xo.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ci(this.options.HTMLAttributes,n),0]:["ol",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Z0.name,this.editor.getAttributes(Yh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Lh({find:SS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Lh({find:SS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Yh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),QF=xo.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),e6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,t6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,n6=as.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wc({find:e6,type:this.type})]},addPasteRules(){return[Gc({find:t6,type:this.type})]}}),ES=xo.create({name:"text",group:"inline"}),i6=Ii.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,g,b,k,E,C,I,D,R,$,G;const q=[];return this.options.bold!==!1&&q.push(mF.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&q.push(uF.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&q.push(gF.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&q.push(bF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&q.push(yS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&q.push(wF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&q.push(EF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&q.push(OF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&q.push(BF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&q.push(zF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&q.push(qF.configure((k=this.options)===null||k===void 0?void 0:k.history)),this.options.horizontalRule!==!1&&q.push(WF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&q.push(KF.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&q.push(Z0.configure((I=this.options)===null||I===void 0?void 0:I.listItem)),this.options.orderedList!==!1&&q.push(JF.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&q.push(QF.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&q.push(n6.configure(($=this.options)===null||$===void 0?void 0:$.strike)),this.options.text!==!1&&q.push(ES.configure((G=this.options)===null||G===void 0?void 0:G.text)),q}}),r6=Ii.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function o6(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=E4(n),g=new RegExp(`\\s${l}$`),b=a?"^":"",k=i?new RegExp(`${b}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${b}(?:^)?${l}[^\\s${l}]*`,"gm"),E=((e=u.nodeBefore)===null||e===void 0?void 0:e.isText)&&u.nodeBefore.text;if(!E)return null;const C=u.pos-E.length,I=Array.from(E.matchAll(k)).pop();if(!I||I.input===void 0||I.index===void 0)return null;const D=I.input.slice(Math.max(0,I.index-1),I.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const $=C+I.index;let G=$+I[0].length;return i&&g.test(E.slice(G-1,G+1))&&(I[0]+=" ",G+=1),$<u.pos&&G>=u.pos?{range:{from:$,to:G},query:I[0].slice(n.length),text:I[0]}:null}const s6=new Ar("suggestion");function a6({pluginKey:t=s6,editor:e,char:n="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:g=()=>null,items:b=()=>[],render:k=()=>({}),allow:E=()=>!0,findSuggestionMatch:C=o6}){let I;const D=k==null?void 0:k(),R=new $i({key:t,view(){return{update:async($,G)=>{var q,se,Q,Se,_e,Ce,Le;const Ie=(q=this.key)===null||q===void 0?void 0:q.getState(G),Ue=(se=this.key)===null||se===void 0?void 0:se.getState($.state),Je=Ie.active&&Ue.active&&Ie.range.from!==Ue.range.from,It=!Ie.active&&Ue.active,ot=Ie.active&&!Ue.active,zt=!It&&!ot&&Ie.query!==Ue.query,Xt=It||Je&&zt,on=zt||Je,$t=ot||Je&&zt;if(!Xt&&!on&&!$t)return;const Kt=$t&&!Xt?Ie:Ue,Cn=$.dom.querySelector(`[data-decoration-id="${Kt.decorationId}"]`);I={editor:e,range:Kt.range,query:Kt.query,text:Kt.text,items:[],command:dn=>g({editor:e,range:Kt.range,props:dn}),decorationNode:Cn,clientRect:Cn?()=>{var dn;const{decorationId:vn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),pn=$.dom.querySelector(`[data-decoration-id="${vn}"]`);return(pn==null?void 0:pn.getBoundingClientRect())||null}:null},Xt&&((Q=D==null?void 0:D.onBeforeStart)===null||Q===void 0||Q.call(D,I)),on&&((Se=D==null?void 0:D.onBeforeUpdate)===null||Se===void 0||Se.call(D,I)),(on||Xt)&&(I.items=await b({editor:e,query:Kt.query})),$t&&((_e=D==null?void 0:D.onExit)===null||_e===void 0||_e.call(D,I)),on&&((Ce=D==null?void 0:D.onUpdate)===null||Ce===void 0||Ce.call(D,I)),Xt&&((Le=D==null?void 0:D.onStart)===null||Le===void 0||Le.call(D,I))},destroy:()=>{var $;I&&(($=D==null?void 0:D.onExit)===null||$===void 0||$.call(D,I))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply($,G,q,se){const{isEditable:Q}=e,{composing:Se}=e.view,{selection:_e}=$,{empty:Ce,from:Le}=_e,Ie={...G};if(Ie.composing=Se,Q&&(Ce||e.view.composing)){(Le<G.range.from||Le>G.range.to)&&!Se&&!G.composing&&(Ie.active=!1);const Ue=C({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:_e.$from}),Je=`id_${Math.floor(Math.random()*4294967295)}`;Ue&&E({editor:e,state:se,range:Ue.range,isActive:G.active})?(Ie.active=!0,Ie.decorationId=G.decorationId?G.decorationId:Je,Ie.range=Ue.range,Ie.query=Ue.query,Ie.text=Ue.text):Ie.active=!1}else Ie.active=!1;return Ie.active||(Ie.decorationId=null,Ie.range={from:0,to:0},Ie.query=null,Ie.text=null),Ie}},props:{handleKeyDown($,G){var q;const{active:se,range:Q}=R.getState($.state);return se&&((q=D==null?void 0:D.onKeyDown)===null||q===void 0?void 0:q.call(D,{view:$,event:G,range:Q}))||!1},decorations($){const{active:G,range:q,decorationId:se}=R.getState($);return G?fi.create($.doc,[Zr.inline(q.from,q.to,{nodeName:u,class:l,"data-decoration-id":se})]):null}}});return R}const l6=new Ar("mention"),c6=xo.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",ci(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:l6,command:({editor:t,range:e,props:n})=>{var i,r,a;const u=t.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(a=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=ci({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:i}=e,{empty:r,anchor:a}=i;return r?(e.doc.nodesBetween(a-1,a,(u,l)=>{if(u.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[a6({editor:this.editor,...this.options.suggestion})]}}),u6=as.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),h6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function d6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBlockquote&&a.toggleBlockquote(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[f.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const p6=$e(h6,[["render",d6]]),f6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function m6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBulletList&&a.toggleBulletList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const g6=$e(f6,[["render",m6]]),y6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function _6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleOrderedList&&a.toggleOrderedList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const b6=$e(y6,[["render",_6]]),x6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function v6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleCodeBlock&&a.toggleCodeBlock(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const w6=$e(x6,[["render",v6]]),k6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function S6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBold&&a.toggleBold(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("bold")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),f.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const E6=$e(k6,[["render",S6]]),C6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function T6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleItalic&&a.toggleItalic(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("italic")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),f.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const M6=$e(C6,[["render",T6]]),A6={},I6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function P6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",I6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const D6={components:{IconA:$e(A6,[["render",P6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},O6={class:"relative flex"},B6={class:"flex w-[160px] flex-wrap gap-[4px]"},z6=["onClick"];function N6(t,e,n,i,r,a){const u=f.resolveComponent("IconA"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",O6,[f.createVNode(u,{height:"20",width:"20",class:"text-gray-500"}),f.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:f.normalizeStyle({backgroundColor:r.color})},null,4)])]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",B6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.colors,g=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:g}),onClick:b=>a.setColor(g),key:g},null,12,z6))),128))])])]),_:1},512)}const R6=$e(D6,[["render",N6]]),L6={},V6={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-dots-vertical"};function F6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",V6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const CS=$e(L6,[["render",F6]]),$6={components:{IconMore:CS},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function j6(t,e,n,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("underline")||n.editor.isActive("strike")}])},[f.createVNode(u,{height:"18",width:"18",class:"rotate-90"})],2)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=(...g)=>a.toggleUnderline&&a.toggleUnderline(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":n.editor.isActive("underline")}])}," Підкресленний ",2),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...g)=>a.toggleStrike&&a.toggleStrike(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const U6={bold:E6,italic:M6,text_more:$e($6,[["render",j6]]),color:R6,bullet_list:g6,ordered_list:b6,blockquote:p6,codeblock:w6},H6={components:{EditorContent:lF},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(U6).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new aF({content:this.modelValue,extensions:[i6,yS,Yh,r6,u6,ES,c6.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{const e=this.options.filter(n=>{var i,r;return(r=(i=n==null?void 0:n.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{t=document.createElement("div"),t.className="mention-popup",n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)}),document.body.appendChild(t);const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.position="absolute",t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`,e=t},onUpdate:n=>{for(;t.firstChild;)t.removeChild(t.firstChild);n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)});const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},q6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},W6={key:0,class:"flex flex-wrap items-center w-full gap-2 px-3 py-2 border-b editor-toolbar dark:border-gray-600"};function G6(t,e,n,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",q6,[r.editor?(f.openBlock(),f.createElementBlock("div",W6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.controlsList,(l,g)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(l),{key:g,editor:r.editor},null,8,["editor"]))),128))])):f.createCommentVNode("",!0),f.createElementVNode("div",{onClick:e[0]||(e[0]=(...l)=>a.focusEditor&&a.focusEditor(...l)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[f.createVNode(u,{editor:r.editor,class:"relative w-full"},null,8,["editor"])])])}const TS=$e(H6,[["render",G6]]),Z6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},Y6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return Z6(this.name)}}},X6={class:"mr-2"},K6=["src"],J6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},Q6={key:0},e$={key:1,class:"text-sm"};function t$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",X6,[n.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,src:n.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,K6)):n.name?(f.openBlock(),f.createElementBlock("div",J6,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",Q6,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",e$,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const n$={components:{VsWidgetCommentsAvatar:$e(Y6,[["render",t$]]),VsTextEditor:TS},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,textareaValue:""}},computed:{isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const t=ht(this.comment.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(t){t&&(this.textareaValue=this.comment.body)}},methods:{confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await rt.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await rt.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},i$={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},r$={class:"flex justify-between items-center mb-2"},o$={class:"flex items-center"},s$={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},a$={class:"text-sm text-gray-600 dark:text-gray-400"},l$={class:"flex flex-col items-center gap-[4px]"},c$=["innerHTML"],u$={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},h$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function d$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAvatar"),l=f.resolveComponent("VsPopover"),g=f.resolveComponent("VsTextEditor"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",i$,[f.createElementVNode("div",r$,[f.createElementVNode("div",o$,[f.createElementVNode("p",s$,[f.createVNode(u,{name:n.comment.username,avatar:n.comment.avatar},null,8,["name","avatar"]),f.createTextVNode(f.toDisplayString(n.comment.username),1)]),f.createElementVNode("p",a$,[f.createElementVNode("time",null,f.toDisplayString(a.createDate),1)])]),f.createVNode(l,{placement:"bottom"},{reference:f.withCtx(()=>e[6]||(e[6]=[f.createElementVNode("button",{class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-500 dark:text-gray-40 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-50 dark:bg-gray-900 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},[f.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 3"},[f.createElementVNode("path",{d:"M2 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm6.041 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM14 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z"})])],-1)])),default:f.withCtx(()=>[f.createElementVNode("div",l$,[f.createElementVNode("button",{type:"button",class:"block px-[12px] rounded-lg py-[4px] text-start w-[100px] duration-300 hover:bg-gray-100",onClick:e[0]||(e[0]=(...k)=>a.openEditModal&&a.openEditModal(...k))}," Редагувати "),f.createElementVNode("button",{type:"button",class:"block py-2 px-[12px] rounded-lg py-[6px] text-start duration-300 w-[100px] hover:bg-gray-100",onClick:e[1]||(e[1]=k=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),f.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:n.comment.body},null,8,c$)]),f.createVNode(b,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=k=>r.isOpen=k),title:"Редагувати",size:"small"},{footer:f.withCtx(()=>[f.createElementVNode("div",h$,[f.createElementVNode("button",{onClick:e[3]||(e[3]=k=>r.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Відмінити "),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...k)=>a.updateComment&&a.updateComment(...k)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:f.withCtx(()=>[f.createElementVNode("div",u$,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=k=>r.textareaValue=k),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const p$={components:{VsWidgetCommentsItem:$e(n$,[["render",d$]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:t}=await rt.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},f$={class:"flex flex-col"},m$={key:0,class:"max-h-[300px] overflow-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"},g$={key:1},y$={class:"p-4"},_$={class:"mt-1 text-gray-500 dark:text-neutral-500"},b$={class:"mt-4 flex justify-end gap-x-3"};function x$(t,e,n,i,r,a){const u=f.resolveComponent("VsErrorOnLoading"),l=f.resolveComponent("VsWidgetCommentsItem"),g=f.resolveComponent("VsLoader"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock("div",f$,[r.isLoaded?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[r.isLoadFailed?(f.openBlock(),f.createBlock(u,{key:0})):(f.openBlock(),f.createElementBlock(f.Fragment,{key:1},[r.comments.length?(f.openBlock(),f.createElementBlock("div",m$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.comments,(k,E)=>(f.openBlock(),f.createBlock(l,{key:E,comment:k,user:r.user,options:n.options,index:E,id:n.id,onListUpdate:a.getComments,class:"border-top",onOpenModal:e[0]||(e[0]=C=>a.handleOpenModal(C))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(f.openBlock(),f.createElementBlock("div",g$,e[4]||(e[4]=[f.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(f.openBlock(),f.createBlock(g,{key:1,class:"justify-center",text:"Please wait..."})),f.createVNode(b,{title:r.modal.title,size:"small",visible:r.isModalVisible,"onUpdate:visible":e[3]||(e[3]=k=>r.isModalVisible=k)},{default:f.withCtx(()=>[f.createElementVNode("div",y$,[f.createElementVNode("p",_$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",b$,[f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm 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",onClick:e[1]||(e[1]=(...k)=>r.modal.cancel&&r.modal.cancel(...k))},f.toDisplayString(r.modal.cancelButtonText),1),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...k)=>r.modal.confirm&&r.modal.confirm(...k))},f.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const v$=$e(p$,[["render",x$]]),w$={components:{VsTextEditor:TS},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await rt.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t}}},k$={class:"flex flex-col items-start w-full widget-comment-form"},S$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},E$={class:"flex"};function C$(t,e,n,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",k$,[f.createElementVNode("div",S$,[f.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:n.options},null,8,["modelValue","options"])]),f.createElementVNode("div",E$,[f.createElementVNode("button",{ref:"buttonAdd",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",onClick:e[1]||(e[1]=(...l)=>a.addNewComment&&a.addNewComment(...l))}," Відправити коментар ",512)])])}const T$={components:{VsWidgetCommentsList:v$,VsWidgetCommentsAddForm:$e(w$,[["render",C$]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await rt.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},M$={class:"w-full bg-white-200"};function A$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",M$,[e[2]||(e[2]=f.createElementVNode("div",{class:"flex items-center justify-between w-full mb-4 gap-x-2"},null,-1)),f.createVNode(u,{options:r.options,class:"mb-6",id:n.id,onListUpdate:e[0]||(e[0]=g=>a.listUpdate())},null,8,["options","id"]),f.createVNode(l,{options:r.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=g=>a.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const MS=$e(T$,[["render",A$]]),AS=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),I$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),P$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},D$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return P$(this.username)}}}),O$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function B$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",O$,f.toDisplayString(t.inItials),1)}const z$=$e(D$,[["render",B$]]),J0={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(n.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{J0.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${n}`]?u=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(u=document.createElement("link"),u.href=t,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=t,e&&(u.type=e)),window.headLoadedFiles[`_${n}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},N$={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await J0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await J0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},R$={id:"map",style:{height:"9rem",width:"24rem"}};function L$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",R$)}const V$=$e(N$,[["render",L$]]),F$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:z$,VsWidgetHistoryItemMap:V$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return I$(t.cdate)}}}),$$={class:"relative [&_p]:m-0"},j$={class:"flex items-center gap-3"},U$={class:"w-full flex justify-between"},H$={class:"text-gray-500"},q$={class:"text-gray-800 font-medium"},W$={class:"text-gray-500 text-sm"},G$={class:"mt-2 pl-10"},Z$={key:0},Y$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},X$={class:"font-medium"},K$={class:"font-medium"};function J$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",$$,[f.createElementVNode("div",j$,[f.createVNode(u,{username:t.item.username},null,8,["username"]),f.createElementVNode("div",U$,[f.createElementVNode("p",H$,[f.createElementVNode("span",q$,f.toDisplayString(t.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",W$,f.toDisplayString(t.getDate(t.item)),1)])]),f.createElementVNode("div",G$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.item.changes,(g,b)=>(f.openBlock(),f.createElementBlock("div",{key:b},[g.attr==="geom"?(f.openBlock(),f.createElementBlock("div",Z$,[e[1]||(e[1]=f.createElementVNode("p",null,"Додана геометрія:",-1)),g.new?(f.openBlock(),f.createBlock(l,{key:0,point:g.new},null,8,["point"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createElementBlock("div",Y$,[f.createElementVNode("p",null,f.toDisplayString(`- ${t.getTitle(g)}:`),1),f.createElementVNode("p",X$,f.toDisplayString(t.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",K$,f.toDisplayString(t.getNewValue(g)),1)]))]))),128))])])}const Q$=$e(F$,[["render",J$]]),e8=f.defineComponent({components:{VsWidgetHistoryItem:Q$,VsEmptyWidget:qv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?AS(this.history.data.cdate):""},lastEditDate(){return this.history.data?AS(this.history.data.edate):""},authorName(){return this.history.data?this.history.data.author:""}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:t}=await rt.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),t8={class:"bg-white"},n8={key:0,class:"space-y-6 list-none relative !px-0 sm:before:absolute sm:before:top-2 sm:before:bottom-0 sm:before:w-0.5 sm:before:left-4 before:bg-gray-200 max-h-[400px] overflow-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"},i8={key:1,class:"w-full h-[330px] flex items-center justify-center"};function r8(t,e,n,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",t8,[e[0]||(e[0]=f.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(l=t.history.rows)!=null&&l.length?(f.openBlock(),f.createElementBlock("ul",n8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.history.rows,g=>(f.openBlock(),f.createElementBlock("li",{class:"list-none mr-[10px]",key:g.uid},[f.createVNode(u,{item:g},null,8,["item"])]))),128))])):(f.openBlock(),f.createElementBlock("div",i8," Історія відсутні "))])}const o8=$e(e8,[["render",r8]]),s8={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"},a8={class:"inline-block w-full align-middle"},l8={class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},c8={class:"dark:bg-neutral-700"},u8={class:"divide-y divide-gray-200 dark:divide-neutral-700"},h8={key:1,class:"divide-y divide-gray-200 dark:divide-neutral-700"},Kf=10,d8={"vs-widget-map":Z1,"vs-widget-gallery":zN,"vs-widget-comments":MS,"vs-widget-file":Gv,"vs-widget-history":o8,"vs-widget-table":{__name:"vs-widget-table",props:{data:Object,columns:Array,token:String},setup(t){const e=t,n=f.ref([]),i=f.ref(1),r=async()=>{var l,g;if((l=e.data)!=null&&l.tokens[e.token])try{const{data:b}=await rt.get(`/api/table-data/${(g=e.data)==null?void 0:g.tokens[e.token]}`);n.value=b.rows}catch(b){console.error("Ошибка при загрузке данных таблицы:",b)}},a=l=>{i.value=l},u=f.computed(()=>{const l=(i.value-1)*Kf;return n.value.slice(l,l+Kf)});return f.onMounted(()=>{r()}),(l,g)=>{var k,E,C;const b=f.resolveComponent("VsPagination");return f.openBlock(),f.createElementBlock("div",s8,[f.createElementVNode("div",a8,[f.createElementVNode("table",l8,[(k=t.columns)!=null&&k.length?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createElementVNode("thead",c8,[f.createElementVNode("tr",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(I,D)=>(f.openBlock(),f.createElementBlock("th",{key:D,scope:"col",class:"px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase dark:text-neutral-400 min-w-[200px]"},f.toDisplayString(I.title),1))),128))])]),f.createElementVNode("tbody",u8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(I==null?void 0:I[R.name]),1))),128))]))),128))])],64)):(f.openBlock(),f.createElementBlock("tbody",h8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(I,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(R),1))),128))]))),128))]))])]),((E=n.value)==null?void 0:E.length)>Kf?(f.openBlock(),f.createBlock(b,{key:0,goTo:!1,"default-page":1,total:(C=n.value)==null?void 0:C.length,pageSize:Kf,onPageChange:a,backgroundColor:"#F3F4F6"},null,8,["total"])):f.createCommentVNode("",!0)])}}}},p8={"table-format-text":yp,"table-format-select":Ux,"table-format-badge":$x,"table-format-swetch":_p,"table-format-check":_p,"table-format-html":yp,"table-format-tags":Hx,"table-format-date":ay,"table-format-number":j1,"table-format-slot":U1},f8={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},m8={__name:"vs-dashboard",setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",f8,n[0]||(n[0]=[f.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"mb-4 xl:mb-8"},[f.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),f.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),f.createElementVNode("div",{class:"space-y-5"},[f.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[f.createElementVNode("div",{class:"relative w-full"},[f.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[f.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",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"},[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),f.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),f.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),f.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[f.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[f.createElementVNode("span",{class:"sr-only"},"Close"),f.createElementVNode("svg",{class:"shrink-0 size-4",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"},[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),f.createElementVNode("path",{d:"m15 9-6 6"}),f.createElementVNode("path",{d:"m9 9 6 6"})])])])]),f.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[f.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm 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"},[f.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",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"},[f.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),f.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),f.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[f.createElementVNode("span",{class:"hidden sm:block"},"Send"),f.createTextVNode("Invite ")])])]),f.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"})]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),f.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-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"},[f.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[f.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("thead",null,[f.createElementVNode("tr",null,[f.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[f.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),f.createElementVNode("th",{scope:"col",class:"min-w-48"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),f.createElementVNode("th",{scope:"col",class:"min-w-36"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),f.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},g8={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function y8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",{onClick:e[0]||(e[0]=(...u)=>a.notify&&a.notify(...u)),class:"py-2 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"}," Custom component ")}const _8=$e(g8,[["render",y8]]),b8={props:{item:{type:Object},actionsLength:{type:Number}},data(){return{toggletMap:{}}},methods:{toggleHandler(t){this.toggletMap[t]=!this.toggletMap[t],this.$emit("on:toggled",{optionID:t,toggled:this.toggletMap[t]})}}},x8={class:"md:col-span-2"},v8={class:"font-semibold text-gray-800 dark:text-neutral-200"},w8={class:"md:block md:col-span-1 md:text-center"},k8=["onClick"];function S8(t,e,n,i,r,a){var u;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid md:gap-x-6 bg-gray-100 rounded-lg p-3 md:p-5 dark:bg-neutral-700",`grid-cols-${n.actionsLength+2}`])},[f.createElementVNode("li",x8,[f.createElementVNode("h3",v8,f.toDisplayString(n.item.ua),1)]),(u=n.item.menu)!=null&&u.length?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(n.actionsLength,l=>(f.openBlock(),f.createElementBlock("li",w8,[f.createElementVNode("button",{onClick:g=>a.toggleHandler(l),type:"button",class:"text-xs text-blue-600 decoration-2 hover:underline font-medium focus:outline-none focus:underline dark:text-blue-400 dark:hover:text-blue-500"}," Toggle all ",8,k8)]))),256)):f.createCommentVNode("",!0)],2)}const E8=$e(b8,[["render",S8]]),C8={props:{subitem:{type:Object},toggled:{type:Boolean},optionID:{type:Number},actions:{type:Array,default:()=>[]},routes:{type:Array}},data(){return{checkedInputMap:{}}},watch:{toggledAndOptionID:{handler([t,e]){this.updateCheckedInputs(t,e)},deep:!0,immediate:!0}},computed:{toggledAndOptionID(){return[this.toggled,this.optionID]}},methods:{updateCheckedInputs(){for(let t=1;t<=this.actions.length;t++)t===this.optionID&&(this.checkedInputMap[t]=this.toggled),t===this.optionID&&this.sendEmit(this.optionID)},inputHandler(t){this.checkedInputMap[t]=!this.checkedInputMap[t],this.sendEmit(t)},sendEmit(t){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checked:this.checkedInputMap[t],optionID:t-1})}},mounted(){var e;const t=(e=this.routes)==null?void 0:e.find(n=>n.path==this.subitem.path);if(t)for(let n=1;n<=this.actions.length;n++)t.actions.includes(this.actions[n])&&(this.checkedInputMap[n]=!0,this.sendEmit(n))}},T8={class:"md:col-span-2"},M8={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},A8={class:"text-sm text-gray-500 dark:text-neutral-500"},I8={class:"grid grid-cols-2 items-center md:block text-end md:text-center"},P8=["onInput","onUpdate:modelValue"];function D8(t,e,n,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3",`grid-cols-${n.actions.length+2}`])},[f.createElementVNode("li",T8,[f.createElementVNode("p",M8,f.toDisplayString(((u=n.subitem)==null?void 0:u.ua)||""),1),f.createElementVNode("p",A8,f.toDisplayString(((l=n.subitem)==null?void 0:l.path)||""),1)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.actions.length,g=>(f.openBlock(),f.createElementBlock("li",{class:"col-span-1",key:g},[f.createElementVNode("div",I8,[f.withDirectives(f.createElementVNode("input",{onInput:b=>a.inputHandler(g),type:"checkbox",class:"shrink-0 border-gray-300 rounded text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800","onUpdate:modelValue":b=>r.checkedInputMap[g]=b},null,40,P8),[[f.vModelCheckbox,r.checkedInputMap[g]]])])]))),128))],2)}const O8={props:{options:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:E8,VsGroupSecondLevel:$e(C8,[["render",D8]])},data(){return{list:[],history:this.routes,toggledInputs:!1}},methods:{async getData(){try{const t=await rt.get("/api/user-menu");this.list=t.data||{}}catch(t){console.error(t)}},toggleCheck(t,e){try{const n=this.options[t.optionID];this.list[e].menu.map(i=>(i.path==t.subitemPath&&(i[n]=t.checked),i)),this.pushToHistory()}catch(n){console.error(n)}},toggleAll(t,e){this.list[e].toggled=t.toggled,this.list[e].optionID=t.optionID},pushToHistory(){var t;try{this.history=[];const e=this.list.map(n=>{var i;return(i=n.menu)==null?void 0:i.filter(r=>this.options.some(a=>r[a])).map(r=>r.path)}).filter(n=>n&&n.length>0).flat();(t=this.list)==null||t.map(n=>{var i;(i=n.menu)==null||i.map(r=>{if(e.includes(r.path)){const a=this.options.filter(u=>r[u]);this.history.push({path:r.path,actions:a})}})}),this.$emit("on:change",this.history)}catch(e){console.error(e)}}},async mounted(){await this.getData()}},B8={class:"flex items-center justify-center"},z8={class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},N8={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},R8={class:"space-y-8"},L8={class:"space-y-5"};function V8(t,e,n,i,r,a){const u=f.resolveComponent("VsGrouptFirstLevel"),l=f.resolveComponent("VsGroupSecondLevel");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",B8,[f.createElementVNode("div",z8,[f.createElementVNode("div",{class:f.normalizeClass(["grid lg:gap-x-3 md:gap-x-6 p-3 md:p-5",`grid-cols-${n.options.length+2}`])},[e[0]||(e[0]=f.createElementVNode("div",{class:"col-span-2 self-center"},[f.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"}," Групи ")],-1)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.options,(g,b)=>(f.openBlock(),f.createElementBlock("div",{class:"col-span-1 text-center",key:b},[f.createElementVNode("h3",N8,f.toDisplayString(g),1)]))),128))],2),f.createElementVNode("div",R8,[f.createElementVNode("div",L8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.list,(g,b)=>{var k;return f.openBlock(),f.createElementBlock("div",{key:b},[f.createVNode(u,{item:g,"onOn:toggled":E=>a.toggleAll(E,b),actionsLength:(k=n.options)==null?void 0:k.length},null,8,["item","onOn:toggled","actionsLength"]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(g.menu,(E,C)=>(f.openBlock(),f.createBlock(l,{toggled:(g==null?void 0:g.toggled)||!1,optionID:g==null?void 0:g.optionID,key:C,subitem:E,actions:n.options,"onOn:checked":I=>a.toggleCheck(I,b),routes:n.routes},null,8,["toggled","optionID","subitem","actions","onOn:checked","routes"]))),128))])}),128))])])])]),f.createTextVNode(" "+f.toDisplayString(r.history),1)],64)}const F8=$e(O8,[["render",V8]]),$8={__name:"vs-group-interface-page",setup(t){const e=["view","add","edit","delete"],n=[{path:"rest_zone",actions:["view","add"]},{path:"itree.event_report",actions:["edit"]},{path:"itree.invent_street_furniture",actions:["edit","delete"]},{path:"itree.pictures",actions:["add"]},{path:"account_light2",actions:["view"]}];return(i,r)=>(f.openBlock(),f.createBlock(f.unref(F8),{options:e,routes:n}))}},j8={},U8={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",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 H8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",U8,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),f.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const Q0=$e(j8,[["render",H8]]),q8={components:{IconSearch:Q0},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var i;return(i=n==null?void 0:n.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await rt.get("/api/user-cls?type=json");this.data=t}catch{}}}},W8={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},G8={class:"relative"},Z8={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] pr-0 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 100px)"}},Y8={class:"w-[99%] overflow-hidden overflow-ellipsis"},X8={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function K8(t,e,n,i,r,a){const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",W8,[f.createElementVNode("div",G8,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=b=>r.searchValue=b),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("ul",Z8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.rows,b=>{var k,E;return f.openBlock(),f.createElementBlock("li",{key:b==null?void 0:b.id,class:"w-full pr-[10px]"},[f.createVNode(g,{to:r.link+"?name="+((b==null?void 0:b.name)||(b==null?void 0:b.id)),class:f.normalizeClass(["py-2 px-5 group pr-[10px] flex items-center gap-x-3 w-full flex justify-between hover:bg-gray-100 rounded-lg duration-300",{"bg-gray-100":((E=(k=t.$route)==null?void 0:k.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",Y8,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",X8,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const J8=$e(q8,[["render",K8]]),Q8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},ej={class:"w-full"},tj={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},nj={class:"max-w-sm mx-auto mt-6"},ij={class:"font-medium text-gray-800 dark:text-neutral-200"},rj={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function oj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",ej,[f.createElementVNode("div",tj,[e[0]||(e[0]=f.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),f.createElementVNode("div",nj,[f.createElementVNode("p",ij,f.toDisplayString(n.title),1),f.createElementVNode("p",rj,f.toDisplayString(n.text),1)])])])}const IS=$e(Q8,[["render",oj]]),sj={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},aj={class:"flex w-[160px] flex-wrap gap-[4px]"},lj=["onClick"];function cj(t,e,n,i,r,a){const u=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(u,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:f.normalizeStyle({backgroundColor:n.modelValue})},null,4)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",aj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.colors,l=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:l}),onClick:g=>a.updateColor(l),key:l},null,12,lj))),128))])])]),_:1},512)}const PS=$e(sj,[["render",cj]]),uj={components:{VsChoceColor:PS},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item},t)}}},hj={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},dj={class:"flex flex-col"},pj={class:"flex gap-[30px]"},fj={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},mj={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},gj={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function yj(t,e,n,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",hj,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",dj,[f.createElementVNode("div",pj,[f.createVNode(l,{modelValue:r.text,"onUpdate:modelValue":e[1]||(e[1]=b=>r.text=b),onUpdateValue:e[2]||(e[2]=b=>r.text=b)},{default:f.withCtx(()=>[f.createElementVNode("p",fj,f.toDisplayString(r.text),1)]),_:1},8,["modelValue"]),f.createVNode(l,{modelValue:r.id,"onUpdate:modelValue":e[3]||(e[3]=b=>r.id=b),onUpdateValue:e[4]||(e[4]=b=>r.id=b)},{default:f.withCtx(()=>[f.createElementVNode("p",mj,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",gj,f.toDisplayString((g=n.item)==null?void 0:g.parent),1)])])}const _j={components:{VsReesterUsersItem:$e(uj,[["render",yj]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const i=[...this.list],r=i[n];i.splice(n,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t,e){var i;const n=(i=this.list)==null?void 0:i.findIndex(r=>(r==null?void 0:r.id)===(t==null?void 0:t.id));this.list[n]=t,e&&(this.list[n].id=e),this.$emit("update-list",this.list)}}},bj={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},xj=["onDragstart","onDrop"];function vj(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",bj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.list,(l,g)=>(f.openBlock(),f.createElementBlock("li",{key:l==null?void 0:l.id,draggable:!0,onDragstart:b=>a.dragStart(b,g),onDragover:e[0]||(e[0]=b=>a.dragOver(b)),onDrop:b=>a.drop(b,g),onDragend:e[1]||(e[1]=(...b)=>a.dragEnd&&a.dragEnd(...b))},[f.createVNode(u,{item:l,onUpdateItem:a.updateItem},null,8,["item","onUpdateItem"])],40,xj))),128))])}const wj={components:{VsNoData:IS,VsChoceColor:PS,IconCheck:jx,VsReesterUsersList:$e(_j,[["render",vj],["__scopeId","data-v-293d7735"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,i;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await rt.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,i;try{const{form:r}=this.$refs;await r.doValidation(),await rt.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(n=this.data)==null?void 0:n.children)==null?void 0:i.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(r){console.log(r)}},async updateChildren(t){var e,n;this.data.children=t;try{await rt.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},kj={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},Sj={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},Ej={class:"flex items-end w-full gap-[4px]"};function Cj(t,e,n,i,r,a){var E,C,I,D,R;const u=f.resolveComponent("VsForm"),l=f.resolveComponent("VsChoceColor"),g=f.resolveComponent("IconCheck"),b=f.resolveComponent("VsReesterUsersList"),k=f.resolveComponent("VsNoData");return f.openBlock(),f.createElementBlock("div",kj,[(C=(E=t.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Sj,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",Ej,[r.formVisible?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=$=>r.formValues=$),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0),f.createVNode(l,{modelValue:r.color,"onUpdate:modelValue":e[1]||(e[1]=$=>r.color=$)},null,8,["modelValue"]),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...$)=>a.addOneChild&&a.addOneChild(...$)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[f.createVNode(g,{height:"20",width:"20"})])]),(D=(I=r.data)==null?void 0:I.children)!=null&&D.length?(f.openBlock(),f.createBlock(b,{key:0,list:(R=r.data)==null?void 0:R.children,onUpdateList:a.updateChildren},null,8,["list","onUpdateList"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(k,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const Tj={components:{VsReesterNavList:J8,VsReesterContent:$e(wj,[["render",Cj]])}},Mj={class:"flex items-start gap-0"};function Aj(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",Mj,[f.createVNode(u),f.createVNode(l)])}const e_={...d8,...p8,"vs-dashboard":m8,"vs-custom-button":_8,"vs-group-interface":$8,...{"user-cls-page":$e(Tj,[["render",Aj]])}},DS=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...DS(n.menu)):e.push(n)}),e},So=f.ref(null),t_=f.ref(!1),OS={$form:({token:t,api:e,id:n,form:i})=>new Promise(r=>{var E,C,I,D;const{VsDialog:a,VsForm:u}=(C=(E=window.app)==null?void 0:E._context)==null?void 0:C.components,{$notify:l}=(D=(I=window.app)==null?void 0:I.config)==null?void 0:D.globalProperties,g=document.querySelector("#modal");if(!g){console.error('Modal root element with id "#modal" not found!');return}const b=document.createElement("div");g.appendChild(b);const k=f.createApp({components:{VsDialog:a,VsForm:u},data(){return{visible:!1,formValues:{},scheme:null}},methods:{close(R){this.visible=!1,this.$el.remove(),k.unmount(),r(R||"Success")},async getFormScheme(){try{if(t){const $=await rt.get(`/api/table/${t}`);this.formValues=$.data}const{data:R}=await rt.get(`/api/template/form/${t||i}`);this.scheme=(R==null?void 0:R.schema)||R}catch(R){console.error("Error fetching form scheme:",R)}finally{this.visible=!0}},async updateData(){const R=this.$refs.form;try{await R.doValidation();const{data:$}=await rt.put(`${e||"/api/table/"}${t||n}`,this.formValues);t_.value=!t_.value,this.visible=!1,this.close($),l({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch{l({title:"Помилка!",type:"error",message:"Сталася помилка"})}}},mounted(){this.getFormScheme()},template:`
742
742
  <div style="position: relative; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;">
743
743
  <VsDialog title="Редагувати" v-model:visible="visible">
744
744
  <VsForm ref="form" v-if="scheme" :scheme v-model="formValues" class="p-0"/>
@@ -756,7 +756,7 @@ img.ProseMirror-separator {
756
756
  </template>
757
757
  </VsDialog>
758
758
  </div>
759
- `});b.mount(g)}),$api:({api:t,confirm:e,method:n})=>new Promise(i=>{var g,b;const{VsDialog:r}=(b=(g=window.app)==null?void 0:g._context)==null?void 0:b.components,a=document.querySelector("#modal");if(!a){console.error('Modal root element with id "#modal" not found!');return}const u=document.createElement("div");a.appendChild(u);const l=f.createApp({components:{VsDialog:r},data(){return{visible:!1,getConfirm:e}},methods:{close(k){this.visible=!1,this.$el.remove(),l.unmount(),i(k||"Success")},async doRequest(){try{const{data:k}=await rt({url:t||"",method:n||"POST"});this.close(k)}catch(k){console.error("Error updating data:",k)}}},mounted(){e?this.visible=!0:this.doRequest()},template:`
759
+ `});k.mount(b)}),$api:({api:t,confirm:e,method:n})=>new Promise(i=>{var b,k,E,C;const{VsDialog:r}=(k=(b=window.app)==null?void 0:b._context)==null?void 0:k.components,{$notify:a}=(C=(E=window.app)==null?void 0:E.config)==null?void 0:C.globalProperties,u=document.querySelector("#modal");if(!u){console.error('Modal root element with id "#modal" not found!');return}const l=document.createElement("div");u.appendChild(l);const g=f.createApp({components:{VsDialog:r},data(){return{visible:!1,getConfirm:e}},methods:{close(I){this.visible=!1,this.$el.remove(),g.unmount(),i(I||"Success")},async doRequest(){try{const{data:I}=await rt({url:t||"",method:n||"POST"});this.close(I),a({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch{a({title:"Помилка!",type:"error",message:"Сталася помилка"})}}},mounted(){e?this.visible=!0:this.doRequest()},template:`
760
760
  <div style="position: relative; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;">
761
761
  <VsDialog v-model:visible="visible" size="small" :title="getConfirm?.title">
762
762
  <div class="p-4">
@@ -783,4 +783,4 @@ img.ProseMirror-separator {
783
783
  </div>
784
784
  </VsDialog>
785
785
  </div>
786
- `});l.mount(u)})},Ij=async()=>{try{const{data:t}=await rt.get("/api/user-menu");return So.value=t,DS(t)}catch(t){return console.error(t),[]}},Pj=(t,e)=>{Object.entries(e).forEach(([n,i])=>{t.component(n,i)})},Dj={async install(t,{componentsApp:e={},settings:n}){hl.value={...hl,...n};try{const r=(await Ij()).filter(u=>u==null?void 0:u.component).map(u=>({...u,component:{...e_,...e}[u==null?void 0:u.component]}));Pj(t,{...e_,...e}),t.component("admin",GT);const{router:a}=await AA(r);window.app={...t,router:a},window.v3plugin={...t.config.globalProperties,...OS},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...wB,componentsApp:e},$router:a,$v3plugin:OS},t.use(a)}catch(i){console.error(i)}},components:e_},Oj={data(){return{formValues:{},scheme:null,table:"",token:""}},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 i,r;const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:a}}=await rt.get(`/api/template/table/${n}`),{data:u}=await rt.get(`/api/table/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.token=(u==null?void 0:u.token)||"",this.formValues=u||{};const{data:l}=await rt.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){try{await this.$refs.form.doValidation(),await rt.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},async editObjectAndRedirect(){try{await this.$refs.form.doValidation(),await rt.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},Bj={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},zj={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Nj={class:"flex items-center gap-[6px]"},Rj={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},Lj={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 Vj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",Bj,[f.createElementVNode("div",zj,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",Nj,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>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"}," Повернутися "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.onlyEditObject&&a.onlyEditObject(...l)),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"}," Зберегти "),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...l)=>a.editObjectAndRedirect&&a.editObjectAndRedirect(...l)),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"}," Зберегти і повернутися ")])]),f.createElementVNode("div",Rj,[f.createElementVNode("div",Lj,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[3]||(e[3]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const Fj=Object.freeze(Object.defineProperty({__proto__:null,default:$e(Oj,[["render",Vj]])},Symbol.toStringTag,{value:"Module"})),$j={data(){return{formValues:{},scheme:null,table:"",token:""}},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 i,r;const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const a=await rt.get(`/api/table-data/${n}`),{data:u}=await rt.get(`/api/template/form/${(i=a==null?void 0:a.data)==null?void 0:i.form}`);this.scheme=(u==null?void 0:u.schema)||u,this.token=(r=a==null?void 0:a.data)==null?void 0:r.addToken}catch{}},async createObject(){var e,n,i,r,a,u,l,g;const t=this.$refs.form;try{await t.doValidation(),await rt.post(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{let k=((r=(i=(n=(e=Object.entries(t==null?void 0:t.formErrors))==null?void 0:e[0])==null?void 0:n[1])==null?void 0:i[0])==null?void 0:r.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(l=(u=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:u[1])==null?void 0:l[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:k||"Сталася помилка валідаціі",type:"error"})}}}},jj={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},Uj={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Hj={class:"flex items-center gap-[6px]"},qj={style:{height:"calc(100vh - 165px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},Wj={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 Gj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",jj,[f.createElementVNode("div",Uj,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",Hj,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>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"}," Скасувати "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),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"}," Зберегти ")])]),f.createElementVNode("div",qj,[f.createElementVNode("div",Wj,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const Zj=Object.freeze(Object.defineProperty({__proto__:null,default:$e($j,[["render",Gj]])},Symbol.toStringTag,{value:"Module"})),Yj={};function Xj(t,e,n,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const BS=Object.freeze(Object.defineProperty({__proto__:null,default:$e(Yj,[["render",Xj]])},Symbol.toStringTag,{value:"Module"})),Kj={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},Jj={class:"mr-[10px]"},Qj={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},e7={class:"flex items-center gap-[6px] ml-auto"},t7={class:"mr-[10px]"},n7={components:{AdminCardHeader:{__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0},slots:{type:Object}},setup(t){var E,C,I,D,R;const{asyncTemplateSlot:e}=(R=(D=(I=(C=(E=f.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:C.app)==null?void 0:I.config)==null?void 0:D.globalProperties)==null?void 0:R.utils,n=t,i=vA(),r=wA(),a=f.ref(""),u=f.ref(""),l=()=>{i.back()},g=f.computed(()=>{var $;return`/edit?table=${n.getRoute}&id=${($=r==null?void 0:r.params)==null?void 0:$.id}`}),b=()=>{var $,G,q,se;if(!(($=n.slots)!=null&&$.panelLeft))return"div";if((G=n.slots)!=null&&G.panelLeft.includes("<")){const Q=e("PanelLeft",(q=n.slots)==null?void 0:q.panelLeft,["name"]);u.value=Q}else u.value=(se=n.slots)==null?void 0:se.panelLeft},k=()=>{var $,G,q,se;if(!(($=n.slots)!=null&&$.panelRight))return"div";if((G=n.slots)!=null&&G.panelRight.includes("<")){const Q=e("PanelRight",(q=n.slots)==null?void 0:q.panelRight,["name"]);a.value=Q}else a.value=(se=n.slots)==null?void 0:se.panelRight};return b(),k(),($,G)=>{const q=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",Kj,[f.createElementVNode("div",Jj,[f.createElementVNode("button",{onClick:l,class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),f.createElementVNode("h2",Qj,f.toDisplayString(t.title),1)]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(u.value))),f.createElementVNode("div",e7,[f.createElementVNode("div",t7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value)))]),f.createVNode(q,{to:g.value,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:f.withCtx(()=>G[0]||(G[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])])])}}},AdminCardAsyncComponent:{__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(t){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,n=f.ref(""),i=t;return(()=>{const k=e("CustomComponent",i.slot,["data"]);n.value=k})(),(k,E)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(n.value),{data:t.objectData},null,8,["data"]))}}},data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var i,r;return(n==null?void 0:n.table)==((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTitle(){var t,e,n,i,r,a,u,l,g,b,k,E,C,I,D;if((n=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])!=null&&n.name)return((u=(a=(r=(i=this.objectData)==null?void 0:i.rows)==null?void 0:r[0])==null?void 0:a.name)==null?void 0:u.length)<35?(b=(g=(l=this.objectData)==null?void 0:l.rows)==null?void 0:g[0])==null?void 0:b.name:((I=(C=(E=(k=this.objectData)==null?void 0:k.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:I.slice(0,35))+" ...";{const R=(D=this.flattenMenu(So.value))==null?void 0:D.find($=>{var G,q;return($==null?void 0:$.table)===((q=(G=this.$route)==null?void 0:G.params)==null?void 0:q.table)});return R==null?void 0:R.ua}},reloadPageTrigger(){return t_.value}},async mounted(){await this.getObjectData(),await this.checkActiveComponent()},watch:{component(t){this.$router.replace({...this.$route,query:{tab:t}})},reloadPageTrigger(){this.getObjectData()}},methods:{async getObjectData(){var n;const{table:t,id:e}=(n=this.$route)==null?void 0:n.params;(!t||!e)&&this.$router.replace("/404");try{const{data:i}=await rt.get(`/api/table-data/${t}/${e}`);this.objectData=i}catch(i){console.error(i)}},getColClass(t){return`col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,i,r,a,u,l,g;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.tab;else{const b=(a=(r=this.objectData)==null?void 0:r.panels)==null?void 0:a.find(k=>(k==null?void 0:k.type)==="tabs"||(k==null?void 0:k.type)==="vertical-tabs");(u=b==null?void 0:b.items)!=null&&u.length&&(this.component=((l=b.items[0])==null?void 0:l.component)||((g=b.items[0])==null?void 0:g.name))}},flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},i7={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},r7={key:0,class:"bg-white border rounded-xl"},o7={class:"p-[10px] pl-[20px] text-md font-[500]"},s7=["innerHTML"],a7={key:1},l7={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},c7={key:2,class:"p-[20px] border-t"},u7=["innerHTML"],h7={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},d7=["onClick"],p7={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},f7={key:0,class:"p-[20px] border-t"},m7={key:1,class:"p-[20px] border-t"},g7=["innerHTML"],y7={key:3,class:"flex"},_7={class:"flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 h-auto items-start pl-[10px] bg-white py-[20px]"},b7=["onClick"],x7={class:"flex-grow"},v7={key:0,class:"h-full bg-white border rounded-xl"},w7={key:0,class:"p-[20px]"},k7={key:1,class:"p-[20px] border-t"},S7=["innerHTML"];function E7(t,e,n,i,r,a){var g,b,k;const u=f.resolveComponent("AdminCardHeader"),l=f.resolveComponent("AdminCardAsyncComponent");return f.openBlock(),f.createElementBlock("div",i7,[r.objectData&&((g=r.objectData)==null?void 0:g.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute,slots:(b=r.objectData)==null?void 0:b.slots},null,8,["title","get-route","slots"])):f.createCommentVNode("",!0),f.createElementVNode("div",{class:f.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((k=r.objectData)==null?void 0:k.panels,(E,C)=>{var I,D,R,$,G;return f.openBlock(),f.createElementBlock("div",{key:C,class:f.normalizeClass(a.getColClass(E.col))},[E!=null&&E.name?(f.openBlock(),f.createElementBlock("div",r7,[f.createElementVNode("h2",o7,f.toDisplayString((E==null?void 0:E.title)||"Панель"),1),(I=r.objectData)!=null&&I.html[E==null?void 0:E.name]?(f.openBlock(),f.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:(D=r.objectData)==null?void 0:D.html[E==null?void 0:E.name]},null,8,s7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(R=r.objectData)==null?void 0:R.vue[E==null?void 0:E.name],data:(G=($=r.objectData)==null?void 0:$.rows)==null?void 0:G[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):E.type==="container"?(f.openBlock(),f.createElementBlock("div",a7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.items,(q,se)=>{var Q,Se,_e,Ce,Le,Ie,Ue,Je,It,ot;return f.openBlock(),f.createElementBlock("div",{key:se,class:f.normalizeClass([{"mb-[20px]":E.items.length>1},"bg-white border rounded-xl"])},[q!=null&&q.title?(f.openBlock(),f.createElementBlock("h2",l7,f.toDisplayString((q==null?void 0:q.title)||"Панель"),1)):f.createCommentVNode("",!0),q!=null&&q.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":q==null?void 0:q.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(q.component),{geometry:(Se=(Q=r.objectData)==null?void 0:Q.rows[0])==null?void 0:Se.geom,columns:q==null?void 0:q.columns,token:q==null?void 0:q.token,zoom:16,data:r.objectData,id:(Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.id},null,8,["geometry","columns","token","data","id"]))],2)):f.createCommentVNode("",!0),q!=null&&q.name?(f.openBlock(),f.createElementBlock("div",c7,[(Ie=(Le=r.objectData)==null?void 0:Le.html)!=null&&Ie[q==null?void 0:q.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Ue=r.objectData)==null?void 0:Ue.html[q==null?void 0:q.name]},null,8,u7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Je=r.objectData)==null?void 0:Je.vue[q==null?void 0:q.name],data:(ot=(It=r.objectData)==null?void 0:It.rows)==null?void 0:ot[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(E==null?void 0:E.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",h7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E==null?void 0:E.items,q=>(f.openBlock(),f.createElementBlock("button",{key:(q==null?void 0:q.name)||(q==null?void 0:q.component),onClick:se=>r.component=(q==null?void 0:q.component)||(q==null?void 0:q.name),class:f.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name),"":r.component!==(q==null?void 0:q.component)&&r.component!==(q==null?void 0:q.name)}])},f.toDisplayString(q==null?void 0:q.title),11,d7))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.items,(q,se)=>{var Q,Se,_e,Ce,Le,Ie,Ue,Je,It,ot;return f.openBlock(),f.createElementBlock(f.Fragment,{key:se},[r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name)?(f.openBlock(),f.createElementBlock("div",p7,[q!=null&&q.component?(f.openBlock(),f.createElementBlock("div",f7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(q.component),{data:r.objectData,token:q==null?void 0:q.token,columns:q==null?void 0:q.columns,geometry:(Se=(Q=r.objectData)==null?void 0:Q.rows[0])==null?void 0:Se.geom,zoom:16,id:(Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.id},null,8,["data","token","columns","geometry","id"]))])):f.createCommentVNode("",!0),q!=null&&q.name?(f.openBlock(),f.createElementBlock("div",m7,[(Ie=(Le=r.objectData)==null?void 0:Le.html)!=null&&Ie[q==null?void 0:q.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Ue=r.objectData)==null?void 0:Ue.html[q==null?void 0:q.name]},null,8,g7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Je=r.objectData)==null?void 0:Je.vue[q==null?void 0:q.name],data:(ot=(It=r.objectData)==null?void 0:It.rows)==null?void 0:ot[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(E==null?void 0:E.type)==="vertical-tabs"?(f.openBlock(),f.createElementBlock("div",y7,[f.createElementVNode("nav",_7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E==null?void 0:E.items,q=>(f.openBlock(),f.createElementBlock("button",{key:(q==null?void 0:q.name)||(q==null?void 0:q.component),onClick:se=>r.component=(q==null?void 0:q.component)||(q==null?void 0:q.name),class:f.normalizeClass(["relative whitespace-pre-wrap text-left inline-flex items-center w-full py-1 text-sm border-transparent pe-4 gap-x-2 border-e-2 hover:text-blue-600 focus:outline-none focus:text-blue-600",{"font-semibold after:absolute after:top-[0] after:right-[-1px] after:h-full text-blue-600 after:w-[2px] after:bg-blue-600 ":r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name),"text-gray-500":r.component!==(q==null?void 0:q.component)&&r.component!==(q==null?void 0:q.name)}])},f.toDisplayString(q==null?void 0:q.title),11,b7))),128))]),f.createElementVNode("div",x7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.items,(q,se)=>{var Q,Se,_e,Ce,Le,Ie,Ue,Je,It,ot;return f.openBlock(),f.createElementBlock(f.Fragment,{key:se},[r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name)?(f.openBlock(),f.createElementBlock("div",v7,[q!=null&&q.component?(f.openBlock(),f.createElementBlock("div",w7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(q.component),{token:q==null?void 0:q.token,data:r.objectData,columns:q==null?void 0:q.columns,geometry:(Se=(Q=r.objectData)==null?void 0:Q.rows[0])==null?void 0:Se.geom,zoom:16,id:(Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.id},null,8,["token","data","columns","geometry","id"]))])):f.createCommentVNode("",!0),q!=null&&q.name?(f.openBlock(),f.createElementBlock("div",k7,[(Ie=(Le=r.objectData)==null?void 0:Le.html)!=null&&Ie[q==null?void 0:q.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Ue=r.objectData)==null?void 0:Ue.html[q==null?void 0:q.name]},null,8,S7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Je=r.objectData)==null?void 0:Je.vue[q==null?void 0:q.name],data:(ot=(It=r.objectData)==null?void 0:It.rows)==null?void 0:ot[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const C7=Object.freeze(Object.defineProperty({__proto__:null,default:$e(n7,[["render",E7],["__scopeId","data-v-e6a747cc"]])},Symbol.toStringTag,{value:"Module"})),T7={},M7={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 A7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",M7,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),f.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const I7=$e(T7,[["render",A7]]),P7={},D7={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",D7,e[0]||(e[0]=[f.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 B7=$e(P7,[["render",O7]]),z7={},N7={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 R7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",N7,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const zS=$e(z7,[["render",R7]]),L7={components:{IconChevronDown:zS},props:{route:Object},mounted(){var t,e,n;(t=this.route)!=null&&t.menu&&(n=(e=this.route)==null?void 0:e.menu)!=null&&n.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},data(){return{isOpen:!1}}},V7={key:0,class:""},F7={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},$7={key:1};function j7(t,e,n,i,r,a){var g,b,k,E,C,I,D,R,$,G,q,se,Q;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=n.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",V7,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Se=>r.isOpen=!r.isOpen),class:f.normalizeClass(["flex cursor-pointer gap-x-3 py-2 px-3 text-sm text-gray-800 justify-start w-full border-none focus:outline-none text-left rounded-lg items-center hover:bg-gray-100 duration-300",[((k=(b=n.route)==null?void 0:b.menu)==null?void 0:k.some(Se=>{var _e,Ce;return(Se==null?void 0:Se.path)===t.$route.path.replace("/","")||(Se==null?void 0:Se.table)===((Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.table)&&(Se==null?void 0:Se.table)}))&&"bg-gray-100"]])},[f.createTextVNode(f.toDisplayString((E=n.route)==null?void 0:E.ua)+" ",1),f.createVNode(u,{class:f.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var Se;return[f.withDirectives(f.createElementVNode("ul",F7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Se=n.route)==null?void 0:Se.menu,(_e,Ce)=>{var Le,Ie;return f.openBlock(),f.createElementBlock("li",{key:Ce,class:"w-full"},[f.createVNode(l,{to:"/"+(_e==null?void 0:_e.path),class:f.normalizeClass([[((_e==null?void 0:_e.path)===t.$route.path.replace("/","")||((Ie=(Le=t.$route)==null?void 0:Le.params)==null?void 0:Ie.table)===(_e==null?void 0:_e.table)&&(_e==null?void 0:_e.table))&&"bg-gray-100"],"flex gap-x-4 py-2 px-3 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(_e==null?void 0:_e.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(f.openBlock(),f.createElementBlock("div",$7,[f.createVNode(l,{to:((I=(C=n.route)==null?void 0:C.path)==null?void 0:I[0])==="/"?(D=n.route)==null?void 0:D.path:"/"+((R=n.route)==null?void 0:R.path),class:f.normalizeClass([[((($=n.route)==null?void 0:$.path.replace("/",""))===t.$route.path.replace("/","")||((q=(G=t.$route)==null?void 0:G.params)==null?void 0:q.table)===((se=n.route)==null?void 0:se.table)&&((Q=n.route)==null?void 0:Q.table))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:f.withCtx(()=>{var Se;return[f.createTextVNode(f.toDisplayString((Se=n.route)==null?void 0:Se.ua),1)]}),_:1},8,["to","class"])]))}const U7={components:{IconLogout:I7,NavbarItem:$e(L7,[["render",j7]]),IconLogo:B7,IconSearch:Q0},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t,e;return(t=this.searchValue)!=null&&t.trim()?(e=this.flattenMenu(So.value))==null?void 0:e.filter(n=>{var i,r,a;return(a=(i=n==null?void 0:n.ua)==null?void 0:i.toLowerCase())==null?void 0:a.includes((r=this.searchValue)==null?void 0:r.toLowerCase())}):So.value},logo(){var t;return((t=hl.value)==null?void 0:t.logo)||"/assets/logo.svg"}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},H7={class:"flex flex-col h-[100vh] border-r w-[260px] shrink-0"},q7=["src"],W7={class:"relative"},G7={class:"p-[16px] 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"},Z7={class:"flex flex-col flex-wrap w-full pb-3"},Y7={key:0,class:"flex flex-col gap-[6px]"},X7={key:1,class:"text-gray-800 text-lg mt-[20px]"};function K7(t,e,n,i,r,a){var b;const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",H7,[f.createElementVNode("img",{src:a.logo,height:"40",width:"200",class:"my-[20px] ml-[20px]"},null,8,q7),f.createElementVNode("div",W7,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=k=>r.searchValue=k),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("div",G7,[f.createElementVNode("nav",Z7,[(b=a.data)!=null&&b.length?(f.openBlock(),f.createElementBlock("ul",Y7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(k,E)=>(f.openBlock(),f.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[f.createVNode(g,{route:k},null,8,["route"])]))),128))])):(f.openBlock(),f.createElementBlock("div",X7,"Не знайдено"))])])])}const J7=$e(U7,[["render",K7]]),Q7={},e9={class:"shrink-0",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"};function t9(t,e){return f.openBlock(),f.createElementBlock("svg",e9,e[0]||(e[0]=[f.createElementVNode("path",{d:"M18 6 7 17l-5-5"},null,-1),f.createElementVNode("path",{d:"m22 10-7.5 7.5L13 16"},null,-1)]))}const n9=$e(Q7,[["render",t9]]),i9={},r9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function o9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",r9,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),f.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const NS=$e(i9,[["render",o9]]),s9={},a9={class:"shrink-0 size-4",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"};function l9(t,e){return f.openBlock(),f.createElementBlock("svg",a9,e[0]||(e[0]=[f.createElementVNode("polyline",{points:"9 11 12 14 22 4"},null,-1),f.createElementVNode("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"},null,-1)]))}const c9=$e(s9,[["render",l9]]),u9={class:"relative shrink-0"},h9=["src"],d9={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},p9={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},f9={class:"grow"},m9={class:"text-xs text-gray-500 dark:text-neutral-500"},g9={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},y9={class:"text-sm text-gray-500 dark:text-neutral-500"},_9={key:0,class:"sm:group-hover:opacity-100 sm:opacity-0 sm:absolute sm:top-5 sm:end-5 inline-block p-0.5 bg-white border border-gray-200 rounded-lg shadow-sm transition ease-out"},b9={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(t,{emit:e}){const n=e,i=f.ref(!1),r=()=>i.value=!0,a=()=>i.value=!1,u=async()=>{var l;try{await rt.get(`/api/notification-read/${(l=t.item)==null?void 0:l.id}`),await n("update-notification")}catch{}};return(l,g)=>{var k,E,C,I,D,R;const b=f.resolveComponent("VsPopover");return f.openBlock(),f.createElementBlock("li",{class:f.normalizeClass(["relative group w-full flex gap-x-5 text-start p-5 border-b",[(k=t.item)!=null&&k.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",u9,[(E=t.item)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(C=t.item)==null?void 0:C.avatar,alt:"Avatar"},null,8,h9)):(f.openBlock(),f.createElementBlock("div",d9,[f.createVNode(NS)])),(I=t.item)!=null&&I.read?(f.openBlock(),f.createElementBlock("span",p9)):f.createCommentVNode("",!0)]),f.createElementVNode("div",f9,[f.createElementVNode("p",m9,[f.createVNode(ay,{name:"cdate",data:t.item},null,8,["data"])]),f.createElementVNode("span",g9,f.toDisplayString((D=t.item)==null?void 0:D.author),1),f.createElementVNode("p",y9,f.toDisplayString((R=t.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",_9,[f.createVNode(b,{trigger:"hover",placement:"left"},{reference:f.withCtx(()=>[f.createElementVNode("button",{onClick:u,type:"button",class:"hs-tooltip-toggle hs-tooltip relative inline-block size-7 flex shrink-0 justify-center items-center text-gray-500 hover:bg-gray-100 hover:text-gray-800 rounded"},[f.createVNode(c9)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},x9={},v9={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 w9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",v9,e[0]||(e[0]=[f.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),f.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const k9=$e(x9,[["render",w9]]),S9={},E9={class:"shrink-0 size-4",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"};function C9(t,e){return f.openBlock(),f.createElementBlock("svg",E9,e[0]||(e[0]=[f.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1),f.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))}const T9=$e(S9,[["render",C9]]),M9={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},A9={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"},I9={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},P9={class:"h-[50px] px-[20px] border-b w-full flex items-center justify-between rounded-t-lg bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]"},D9={class:"h-[30px] w-[30px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"},O9={class:"max-h-[400px] bg-white overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300"},B9={key:0},z9={__name:"admin-notification",setup(t){var b,k,E,C,I;const e=f.ref(0),n=f.ref([]),i=f.ref(!1),r=f.ref(null),a=(I=(C=(E=(k=(b=f.getCurrentInstance())==null?void 0:b.appContext)==null?void 0:k.app)==null?void 0:E.config)==null?void 0:C.globalProperties)==null?void 0:I.$notify,u=D=>{r.value&&!r.value.contains(D.target)&&(i.value=!1)};f.watch(i,D=>{D?window.addEventListener("click",u):window.removeEventListener("click",u)}),f.onBeforeUnmount(()=>{window.removeEventListener("click",u)});const l=async()=>{try{const{data:D}=await rt.get("/api/notification");n.value=(D==null?void 0:D.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await rt.get("/api/notification-read"),await l()}catch{a({type:"error",message:"Виникла помилка",title:"Помилка!"})}};return(D,R)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"notificationRef",ref:r,class:"hs-tooltip [--placement:bottom] inline-block show relative"},[f.createElementVNode("button",{onClick:R[0]||(R[0]=$=>i.value=!i.value),class:"hs-tooltip-toggle relative 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"},[f.createVNode(k9,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",M9,[R[1]||(R[1]=f.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),f.createElementVNode("span",A9,f.toDisplayString(e.value),1)])):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,null,{default:f.withCtx(()=>{var $;return[i.value?(f.openBlock(),f.createElementBlock("div",I9,[f.createElementVNode("div",P9,[R[2]||(R[2]=f.createElementVNode("nav",{class:"flex"},[f.createElementVNode("button",{type:"button",class:"px-2 py-1.5 relative inline-flex justify-center items-center gap-x-2 text-nowrap hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg focus:outline-none focus:bg-gray-100 after:absolute after:bottom-[-9px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800"}," Всі ")],-1)),f.createElementVNode("button",D9,[f.createVNode(T9)])]),f.createElementVNode("div",O9,[($=n.value)!=null&&$.length?(f.openBlock(),f.createElementBlock("ul",B9,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.value,G=>(f.openBlock(),f.createBlock(b9,{key:G==null?void 0:G.id,item:G,onUpdateNotification:l},null,8,["item"]))),128))])):f.createCommentVNode("",!0)]),f.createElementVNode("button",{onClick:g,class:"h-[50px] border-t w-full rounded-b-lg bg-white shadow p-4 flex justify-center items-center gap-x-2 text-sm text-gray-500 font-medium sm:rounded-b-lg hover:text-blue-600 focus:outline-none"},[f.createVNode(n9,{height:"16",width:"16"}),R[3]||(R[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},N9={},R9={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 L9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",R9,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),f.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),f.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const V9={components:{IconQuestion:$e(N9,[["render",L9]]),IconUser:NS,AdminNotification:z9},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 rt.get("/user");this.userData=t}catch{}},async logout(){try{await rt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},F9={class:"h-[60px] border-b flex justify-end px-[20px]",style:{width:"calc(100vw - 260px)"}},$9={class:"flex items-center gap-[6px]"},j9={href:"docs-softpro.com",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"},U9={class:"relative"},H9=["src"],q9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},W9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},G9=["src"],Z9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},Y9={class:"text-[14px] mr-[10px] text-gray-500"},X9={class:"flex flex-col p-[4px]"};function K9(t,e,n,i,r,a){var k,E,C,I,D,R,$,G,q,se;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",F9,[f.createElementVNode("div",$9,[f.createElementVNode("a",j9,[f.createVNode(u,{height:"24",width:"24"})]),f.createVNode(l),e[4]||(e[4]=f.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),f.createElementVNode("div",U9,[f.createElementVNode("div",{onClick:e[0]||(e[0]=Q=>r.isVisible=!0),class:"cursor-pointer"},[(E=(k=r.userData)==null?void 0:k.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(I=(C=r.userData)==null?void 0:C.user)==null?void 0:I.avatar,alt:"Image Description"},null,8,H9)):(f.openBlock(),f.createElementBlock("div",q9,[f.createVNode(g)]))]),r.isVisible?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[2]||(e[2]=f.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[f.createElementVNode("div",W9,[(R=(D=r.userData)==null?void 0:D.user)!=null&&R.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=($=r.userData)==null?void 0:$.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,G9)):(f.openBlock(),f.createElementBlock("div",Z9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",Y9,f.toDisplayString((se=(q=r.userData)==null?void 0:q.user)==null?void 0:se.username),1)])]),f.createElementVNode("div",X9,[f.createVNode(b,{to:"profile",disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:f.withCtx(()=>e[3]||(e[3]=[f.createTextVNode("Профіль")])),_:1}),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...Q)=>a.logout&&a.logout(...Q)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const J9={components:{navbar:J7,AdminHeader:$e(V9,[["render",K9]])},computed:{isMenu(){return So.value||null}}},Q9={class:"admin-wrapper"},eU={class:"flex flex-col"};function tU(t,e,n,i,r,a){const u=f.resolveComponent("navbar"),l=f.resolveComponent("admin-header"),g=f.resolveComponent("router-view");return f.openBlock(),f.createElementBlock("div",Q9,[f.createVNode(u),f.createElementVNode("div",eU,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createVNode(l),f.createVNode(g)],64)):f.createCommentVNode("",!0)])])}const nU=Object.freeze(Object.defineProperty({__proto__:null,default:$e(J9,[["render",tU],["__scopeId","data-v-36fd7ac9"]])},Symbol.toStringTag,{value:"Module"})),iU={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,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},rU={scope:"col",class:"text-start px-2 py-1"},oU={class:"flex-shrink-0 size-3.5",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"},sU={key:0,d:"m7 15 5 5 5-5"},aU={key:1,d:"m7 9 5-5 5 5"},lU={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500"};function cU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("th",rU,[a.getVisibleIcon?(f.openBlock(),f.createElementBlock("button",{key:0,type:"button",class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500 flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[f.createTextVNode(f.toDisplayString(a.label)+" ",1),(f.openBlock(),f.createElementBlock("svg",oU,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",sU)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",aU)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",lU,f.toDisplayString(a.label),1))])}const uU=$e(iU,[["render",cU]]),hU={},dU={class:"flex-shrink-0 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 pU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",dU,e[0]||(e[0]=[f.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const fU=$e(hU,[["render",pU]]),mU={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},gU={style:{display:"none"}},yU=["height","width","fill"];function _U(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock("svg",gU,e[0]||(e[0]=[f.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[f.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(f.openBlock(),f.createElementBlock("svg",{height:n.height,width:n.width,fill:n.color},e[1]||(e[1]=[f.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,yU))],64)}const bU={components:{IconMore:CS,IconDelete:fU,IconEdit:$e(mU,[["render",_U]])},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 rt.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;try{const{data:e}=await rt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await rt.delete(`/api/table/${e==null?void 0:e.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e;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}),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})}}},xU={class:"hs-dropdown [--placement:bottom-right] inline-flex"},vU={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"},wU={class:"flex flex-col items-start"},kU=["onClick"],SU={class:"text-gray-800"},EU={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},CU={class:"p-4"},TU={class:"flex justify-end mt-4 gap-x-3"};function MU(t,e,n,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),k=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",xU,[f.createVNode(k,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",vU,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,I,D,R,$;return[f.createElementVNode("div",wU,[(C=n.actions)!=null&&C.includes("edit")&&n.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(I=t.$route)==null?void 0:I.params)==null?void 0:D.catchAll}&id=${(R=n.item)==null?void 0:R.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:f.withCtx(()=>[f.createVNode(l,{color:"#000"}),e[4]||(e[4]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"])):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getCustomActions,(G,q)=>(f.openBlock(),f.createElementBlock("button",{key:q,onClick:se=>a.customButtonAction(G),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"},[f.createVNode(b,{class:"opacity-0"}),f.createElementVNode("span",SU,f.toDisplayString(G==null?void 0:G.label),1)],8,kU))),128)),n.isForm?(f.openBlock(),f.createElementBlock("div",EU)):f.createCommentVNode("",!0),($=n.actions)!=null&&$.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["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"},[f.createVNode(b),e[5]||(e[5]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):f.createCommentVNode("",!0)])]}),_:1})]),f.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=C=>r.isDeleteConfirm=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",CU,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",TU,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 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",onClick:e[1]||(e[1]=C=>r.isDeleteConfirm=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...C)=>a.deleteElement&&a.deleteElement(...C))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const AU=$e(bU,[["render",MU]]),IU={},PU={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 DU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",PU,e[0]||(e[0]=[f.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),f.createElementVNode("path",{d:"M7 20V4"},null,-1),f.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),f.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const OU=$e(IU,[["render",DU]]),BU={},zU={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 NU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",zU,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const RU={components:{IconExport:OU,IconChevronDown:zS,IconSuccess:$e(BU,[["render",NU]])},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 rt.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=new Blob([e.data],{type:"application/octet-stream"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(i),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.error("Ошибка при экспорте файла:",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"}}},LU={key:0,class:"flex flex-col items-center"},VU={key:1,class:"p-4"},FU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},$U={class:"flex items-center"},jU={class:"flex items-center gap-[10px] ml-auto"},UU=["onClick"],HU={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},qU={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},WU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},GU={class:"mt-2 space-y-2"},ZU=["id","onChange"],YU=["for"],XU={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},KU={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function JU(t,e,n,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),k=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=E=>r.isOpen=!0),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[7]||(e[7]=f.createTextVNode(" Експорт ")),f.createVNode(l,{height:"12",width:"16"})]),f.createVNode(k,{visible:r.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>r.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",XU,[f.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]=E=>r.isOpen=!1)}," Закрити "),f.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]=E=>r.isSuccessTemplate=!1)}," Вигрузити ще ")])):(f.openBlock(),f.createElementBlock("div",KU,[f.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]=E=>r.isOpen=!1)}," Скасувати "),f.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]=(...E)=>a.exportTable&&a.exportTable(...E))}," Завантажити таблицю ")]))]),default:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",LU,[f.createVNode(g,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=f.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(f.openBlock(),f.createElementBlock("div",VU,[f.createElementVNode("div",FU,[f.createElementVNode("div",$U,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",jU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.actions,E=>(f.openBlock(),f.createElementBlock("button",{key:E==null?void 0:E.name,onClick:E==null?void 0:E.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"},[f.createElementVNode("span",{class:f.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===r.activeAction}])},[(E==null?void 0:E.name)===r.activeAction?(f.openBlock(),f.createElementBlock("span",HU)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,UU))),128))])]),f.createElementVNode("div",qU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[f.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=I=>r.cols=I),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",WU,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",GU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.tableFormats,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C},[f.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:E,onChange:I=>a.selectFormat(E)},null,40,ZU),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,YU)]))),128))])])]))]),_:1},8,["visible"])],64)}const QU=$e(RU,[["render",JU]]),eH={},tH={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 nH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",tH,e[0]||(e[0]=[f.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 iH=$e(eH,[["render",nH]]),rH={props:{column:Object},emits:["update-column"],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)}},oH={class:"flex w-full gap-[8px] items-centr"};function sH(t,e,n,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",oH,[f.withDirectives(f.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=g=>r.value=g),type:"checkbox"},null,512),[[f.vModelCheckbox,r.value]]),f.createTextVNode(" "+f.toDisplayString(((u=n.column)==null?void 0:u.ua)||((l=n.column)==null?void 0:l.title)),1)])}const aH={components:{IconColumns:iH,AdminTableColumnsHiddenItem:$e(rH,[["render",sH]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(t){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}}},lH={class:"py-2 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"},cH={class:"py-[10px] px-[10px] w-[260px]"},uH={class:"flex flex-col gap-[3px] max-h-[400px] w-full 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 hH(t,e,n,i,r,a){const u=f.resolveComponent("IconColumns"),l=f.resolveComponent("AdminTableColumnsHiddenItem"),g=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(g,{trigger:"click",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",lH,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",cH,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",uH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,(b,k)=>(f.openBlock(),f.createElementBlock("li",{key:k},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const dH=$e(aH,[["render",hH]]),pH={},fH={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function mH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",fH,e[0]||(e[0]=[f.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const RS=$e(pH,[["render",mH]]),gH={},yH={class:"vs-table-interface__table-wrp w-full rounded h-fit overflow-hidden"};function _H(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",yH,e[0]||(e[0]=[f.createStaticVNode('<div><div class="p-5 min-h-[500px] flex flex-col justify-center items-center text-center"><svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg><div class="max-w-sm mx-auto mt-6"><p class="font-medium text-gray-800 dark:text-neutral-200"> Дані для відображення відсутні </p><p class="mt-2 text-sm text-gray-500 dark:text-neutral-500"> Змініть параметри пошуку або спробуйте пізніше </p></div></div></div>',1)]))}const bH=$e(gH,[["render",_H]]),xH={props:{row:Object,column:Object,table:String}};function vH(t,e,n,i,r,a){var u,l,g,b,k,E,C,I;return f.openBlock(),f.createBlock(f.resolveDynamicComponent(((u=n.column)==null?void 0:u.format)==="custom"?(l=n.column)==null?void 0:l.component:`table-format-${((b=(g=n.column)==null?void 0:g.format)==null?void 0:b.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>t.$emit("update-table")),name:(k=n.column)==null?void 0:k.name,data:n.row,value:(C=n.row)==null?void 0:C[(E=n.column)==null?void 0:E.name],table:n.table,column:n.column,edit:(I=n.column)==null?void 0:I.edit},null,40,["name","data","value","table","column","edit"])}const LS=$e(xH,[["render",vH]]),wH={},kH={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 SH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",kH,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const EH={components:{IconPlus:RS,IconMinus:$e(wH,[["render",SH]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},CH={class:"hs-accordion"},TH={class:"py-0.5 flex items-center gap-x-0.5 w-full"},MH={class:"text-sm font-medium"},AH={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function IH(t,e,n,i,r,a){const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("IconMinus");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[f.createElementVNode("div",CH,[f.createElementVNode("div",TH,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"rounded-md cursor-pointer grow"},[f.createElementVNode("span",MH,f.toDisplayString(n.title),1)]),f.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=g=>r.expanded=!r.expanded)},[r.expanded?(f.openBlock(),f.createBlock(l,{key:1,width:"14"})):(f.openBlock(),f.createBlock(u,{key:0}))])]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",AH,[f.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const PH={components:{AdminComponentIs:LS,AdminTree:$e(EH,[["render",IH],["__scopeId","data-v-e1f274c9"]]),VsNoData:IS,VsWidgetComments:MS,VsWidgetMap:Z1,VsWidgetFileList:Gv},props:{table:String,columns:Array,row:Object}},DH={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)"}},OH={class:"border-l",style:{height:"calc(100vh - 360px)"}},BH={class:"flex items-center justify-between py-1 gap-x-4"},zH={class:"col-span-1"},NH={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},RH={class:"col-span-2"},LH={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},VH={class:"table-info-card"},FH={class:"table-info-card"};function $H(t,e,n,i,r,a){var C,I,D;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),k=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",DH,[e[0]||(e[0]=f.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[f.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),f.createElementVNode("div",OH,[(I=(C=t.$route)==null?void 0:C.query)!=null&&I.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[n.row?(f.openBlock(),f.createBlock(l,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,R=>(f.openBlock(),f.createElementBlock("dl",BH,[f.createElementVNode("dt",zH,[f.createElementVNode("p",NH,f.toDisplayString((R==null?void 0:R.ua)||(R==null?void 0:R.title))+": ",1)]),f.createElementVNode("dd",RH,[f.createElementVNode("p",LH,[f.createVNode(u,{row:n.row,column:R,table:n.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),(D=n.row)!=null&&D.geom?(f.openBlock(),f.createBlock(l,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R,$;return[(R=n.row)!=null&&R.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:($=n.row)==null?void 0:$.geom,zoom:14},null,8,["geometry"])):(f.openBlock(),f.createBlock(b,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",VH,[f.createVNode(k,{id:(R=n.row)==null?void 0:R.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",FH,[f.createVNode(E,{id:(R=n.row)==null?void 0:R.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const jH=$e(PH,[["render",$H]]),UH={},HH={class:"hidden xl:block 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 qH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",HH,e[0]||(e[0]=[f.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),f.createElementVNode("path",{d:"M15 3v18"},null,-1),f.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const WH=$e(UH,[["render",qH]]),GH={},ZH={class:"h21yx vs0hq",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"};function YH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",ZH,e[0]||(e[0]=[f.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const XH={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:$e(GH,[["render",YH]])},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},KH={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},JH={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-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 QH(t,e,n,i,r,a){const u=f.resolveComponent("IconFilter"),l=f.resolveComponent("VsFilter");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=g=>r.isFilters=!r.isFilters),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=f.createTextVNode(" Фільтри ")),n.onFilters?(f.openBlock(),f.createElementBlock("span",KH,f.toDisplayString(n.onFilters),1)):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var g;return[f.withDirectives(f.createElementVNode("div",{onClick:e[3]||(e[3]=(...b)=>a.closeFilter&&a.closeFilter(...b)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[f.createElementVNode("div",JH,[(g=n.scheme)!=null&&g.length?(f.openBlock(),f.createBlock(l,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=b=>t.$emit("filterChange",b)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=b=>r.isFilters=!1)},null,8,["scheme"])):f.createCommentVNode("",!0)])],512),[[f.vShow,r.isFilters]])]}),_:1})],64)}const eq=$e(XH,[["render",QH]]),tq={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},nq={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"},iq=["onClick"];function rq(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("nav",nq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.tabsList,u=>(f.openBlock(),f.createElementBlock("button",{onClick:l=>t.$emit("update:filterState",u==null?void 0:u.name),class:f.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":(u==null?void 0:u.name)===n.filterState}])},f.toDisplayString(u==null?void 0:u.label),11,iq))),256))])}const oq=$e(tq,[["render",rq]]),sq={},aq={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 lq(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",aq,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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 cq={components:{IconFilter2:$e(sq,[["render",lq]])},props:{filterCustom:String,customList:Array}},uq={class:"py-2 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"},hq={class:"flex flex-col gap-[4px]"},dq=["onClick"];function pq(t,e,n,i,r,a){const u=f.resolveComponent("IconFilter2"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",uq,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",hq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:k=>{var E;t.$emit("update:filterCustom",g==null?void 0:g.name),(E=t.$refs)==null||E.popover.togglePopover()},key:b,class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":n.filterCustom===(g==null?void 0:g.name)}])},f.toDisplayString(g==null?void 0:g.label),11,dq))),128)),f.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=g=>{var b;t.$emit("update:filterCustom",void 0),(b=t.$refs)==null||b.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const fq=$e(cq,[["render",pq]]),mq={class:"flex items-center gap-x-2"},gq={props:{table:String,title:String},components:{AdminTableControl:AU,AdminTableExport:QU,AdminTableColumnsHidden:dH,AdminTableColumn:uU,AdminNodata:bH,IconPlus:RS,IconSearch:Q0,AdminTableCardInfo:jH,IconOpenCard:WH,AdminComponentIs:LS,AdminTableFilters:eq,AdminTableTabs:oq,AdminTableCustomFilters:fq,AdminTableCustomButtons:{__name:"admin-table-custom-buttons",props:{slots:Object},setup(t){var l,g,b,k,E;const{asyncTemplateSlot:e}=(E=(k=(b=(g=(l=f.getCurrentInstance())==null?void 0:l.appContext)==null?void 0:g.app)==null?void 0:b.config)==null?void 0:k.globalProperties)==null?void 0:E.utils,n=f.ref(""),i=f.ref(""),r=t,a=()=>{var C,I,D,R,$;if((C=r.slots)!=null&&C.panelLeft||(i.value="div"),(D=(I=r.slots)==null?void 0:I.panelLeft)!=null&&D.includes("<")){const G=e("PanelLeft",(R=r.slots)==null?void 0:R.panelLeft,["name"]);i.value=G}else i.value=($=r.slots)==null?void 0:$.panelLeft},u=()=>{var C,I,D,R,$;if((C=r.slots)!=null&&C.panelRight||(n.value="div"),(D=(I=r.slots)==null?void 0:I.panelRight)!=null&&D.includes("<")){const G=e("PanelRight",(R=r.slots)==null?void 0:R.panelRight,["name"]);n.value=G}else n.value=($=r.slots)==null?void 0:$.panelRight};return a(),u(),(C,I)=>(f.openBlock(),f.createElementBlock("div",mq,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(i.value))),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(n.value)))]))}}},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()},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;return(t=this.tableData)==null?void 0:t.form},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 i,r;return(n==null?void 0:n.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:((t,e=300)=>{let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{t.apply(this,i)},e)}})(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,i;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({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,i,r;this.visibleColumns=t==null?void 0:t.map(a=>a==null?void 0:a.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:(i=this.visibleColumns)!=null&&i.length?(r=this.visibleColumns)==null?void 0:r.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,i,r,a,u,l,g,b,k,E,C,I,D,R,$;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.limit)||20,this.filters=((u=decodeURI((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filter))==null?void 0:u.replaceAll("+"," "))||null,this.filterState=((g=(l=this.$route)==null?void 0:l.query)==null?void 0:g.filterState)||null,this.filterCustom=((k=(b=this.$route)==null?void 0:b.query)==null?void 0:k.custom)||null,this.searchValue=((C=(E=this.$route)==null?void 0:E.query)==null?void 0:C.search)||"",this.visibleColumns=((R=(D=(I=this.$route)==null?void 0:I.query)==null?void 0:D.columns)==null?void 0:R.split(","))||[],($=this.$route)!=null&&$.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,i;const e=(i=(n=this.tableData)==null?void 0:n.columns)==null?void 0:i.find(r=>r.name===t);if(e){const r=e==null?void 0:e.width;return r!=null&&r.includes("px")?r:`${r}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,i,r,a,u,l,g,b,k;try{const{data:E}=await rt.get(`/api/template/table/${this.table}`),C=await rt.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={...E,...(C==null?void 0:C.data)||{}},this.initialHiddenColumns=(a=(r=(i=(n=this.tableData)==null?void 0:n.columns)==null?void 0:i.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:r.map(I=>I==null?void 0:I.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(I=>{var D;(D=this.visibleColumns)!=null&&D.includes(I==null?void 0:I.name)?I.hidden=!1:I.hidden=!0}):this.visibleColumns=(k=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:k.map(I=>I==null?void 0:I.name)}catch{}},async getFilters(){var t;try{const{data:e}=await rt.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){const e=this.$route.query;this.page=t,!(!(e!=null&&e.page)&&t===1||e.page===t)&&(await this.$router.replace({query:{...e,page:t}}),await this.getTableData())},async changeLimit(t){this.limit=await t,this.defaultPage=1,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}`)},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}})}}},yq={class:"w-[calc(100vw - 320px)] bg-gray-50"},_q={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},bq={class:"text-xl font-medium"},xq={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex pt-[10px]"},vq={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},wq={class:"flex"},kq={class:"flex gap-[6px] ml-auto"},Sq={class:"inline-block w-full align-middle"},Eq={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"},Cq={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},Tq={class:"right-0 border-t border-stone-200"},Mq={key:0,class:"w-[70px] sticky right-0 top-0"},Aq={class:"divide-y divide-gray-200"},Iq={class:"px-4 py-3 text-sm text-gray-600"},Pq=["onClick"],Dq=["onClick"],Oq={class:"p-[20px] flex justify-start items-center w-full"},Bq={class:"w-[200px]"},zq={class:"text-sm text-gray-600 dark:text-neutral-400"},Nq={class:"font-semibold text-gray-800 dark:text-neutral-200"},Rq={key:0},Lq={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function Vq(t,e,n,i,r,a){var Ce,Le,Ie,Ue,Je,It,ot,zt,Xt,on,$t,Kt,Cn,dn,vn,pn,ti,Nn,Pn,Rn,Te,He;const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("router-link"),g=f.resolveComponent("AdminTableTabs"),b=f.resolveComponent("IconSearch"),k=f.resolveComponent("VsText"),E=f.resolveComponent("AdminTableCustomButtons"),C=f.resolveComponent("AdminTableCustomFilters"),I=f.resolveComponent("AdminTableColumnsHidden"),D=f.resolveComponent("AdminTableExport"),R=f.resolveComponent("AdminTableFilters"),$=f.resolveComponent("IconOpenCard"),G=f.resolveComponent("AdminTableColumn"),q=f.resolveComponent("AdminComponentIs"),se=f.resolveComponent("AdminTableControl"),Q=f.resolveComponent("AdminNodata"),Se=f.resolveComponent("VsPagination"),_e=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",yq,[f.createElementVNode("div",_q,[f.createElementVNode("h2",bq,f.toDisplayString(n.title),1),a.isForm?(f.openBlock(),f.createBlock(l,{key:0,to:`/add?table=${(Le=(Ce=t.$route)==null?void 0:Ce.params)==null?void 0:Le.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:f.withCtx(()=>[f.createVNode(u,{height:"16",width:"16"}),e[5]||(e[5]=f.createTextVNode(" Додати "))]),_:1},8,["to"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",xq,[f.createElementVNode("div",vq,[(Ue=(Ie=r.tableData)==null?void 0:Ie.filterState)!=null&&Ue.length?(f.openBlock(),f.createBlock(g,{key:0,tabsList:(Je=r.tableData)==null?void 0:Je.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=De=>r.filterState=De)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",wq,[f.createElementVNode("div",{class:f.normalizeClass([r.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[f.createElementVNode("div",{class:f.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createVNode(b,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),f.createVNode(k,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=De=>r.searchValue=De),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>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"]),f.createElementVNode("div",kq,[(It=r.tableData)!=null&&It.slots?(f.openBlock(),f.createBlock(E,{key:0,slots:(ot=r.tableData)==null?void 0:ot.slots},null,8,["slots"])):f.createCommentVNode("",!0),(Xt=(zt=r.tableData)==null?void 0:zt.filterCustom)!=null&&Xt.length?(f.openBlock(),f.createBlock(C,{key:1,customList:(on=r.tableData)==null?void 0:on.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=De=>r.filterCustom=De)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(I,{columns:($t=r.tableData)==null?void 0:$t.columns,onUpdateColumns:e[3]||(e[3]=De=>r.tableData.columns=De)},null,8,["columns"]),f.createVNode(D,{table:n.table,columns:(Kt=r.tableData)==null?void 0:Kt.columns,page:r.page,"filter-state":r.filterState,"filter-custom":r.filterCustom,filters:r.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"]),(Cn=r.filterScheme)!=null&&Cn.length?(f.openBlock(),f.createBlock(R,{key:2,scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"])):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...De)=>a.toggleCardInfo&&a.toggleCardInfo(...De)),class:"py-2 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"},[f.createVNode($,{class:f.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),f.createElementVNode("div",{class:f.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createElementVNode("div",{style:f.normalizeStyle({height:(vn=(dn=r.tableData)==null?void 0:dn.filterState)!=null&&vn.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"},[f.createElementVNode("div",Sq,[a.isNoData?(f.openBlock(),f.createBlock(Q,{key:1})):(f.openBlock(),f.createElementBlock("table",Eq,[f.createElementVNode("thead",Cq,[f.createElementVNode("tr",Tq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,De=>(f.openBlock(),f.createBlock(G,{key:De.name,style:f.normalizeStyle({width:a.rowWidth(De==null?void 0:De.name),textAlign:De==null?void 0:De.align,wordBreak:De==null?void 0:De.wrap}),data:De,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(ti=(pn=a.getActions)==null?void 0:pn.filter(De=>De!=="add"))!=null&&ti.length?(f.openBlock(),f.createElementBlock("th",Mq)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",Aq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Nn=r.tableData)==null?void 0:Nn.rows,(De,ct)=>{var Nt,Jt,Mt,Tt,nn,we,yn,pr,jt,sn;return f.openBlock(),f.createElementBlock("tr",{key:ct,class:f.normalizeClass({"bg-gray-50":((Jt=(Nt=t.$route)==null?void 0:Nt.query)==null?void 0:Jt.card)===(De==null?void 0:De.id)})},[f.createElementVNode("td",Iq,[f.createElementVNode("button",{onClick:()=>a.pushToCard(De==null?void 0:De.id),class:f.normalizeClass(["text-sm font-medium",[((Mt=r.tableData)==null?void 0:Mt.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(q,{row:De,column:a.columns[0],table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Pq)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Tt=a.columns)==null?void 0:Tt.slice(1),ui=>(f.openBlock(),f.createElementBlock("td",{onClick:Hi=>a.changeActiveCardInfo(De==null?void 0:De.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start whitespace-nowrap",{"cursor-pointer":r.isVisibleCardInfo}]),key:ui.name},[f.createVNode(q,{row:De,column:ui,table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Dq))),128)),(we=(nn=a.getActions)==null?void 0:nn.filter(ui=>ui!=="add"))!=null&&we.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((pr=(yn=t.$route)==null?void 0:yn.query)==null?void 0:pr.card)===(De==null?void 0:De.id),"bg-white":((sn=(jt=t.$route)==null?void 0:jt.query)==null?void 0:sn.card)!==(De==null?void 0:De.id)}])},[f.createVNode(se,{actions:a.getActions,isForm:a.isForm,item:De,table:n.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):f.createCommentVNode("",!0)],2)}),128))])]))])],4)],2),f.createElementVNode("div",Oq,[f.createElementVNode("div",Bq,[f.createElementVNode("p",zq,[f.createElementVNode("span",Nq,[f.createTextVNode(f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((Pn=r.tableData)==null?void 0:Pn.count)||"0 ")+" ",1),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Rq," з")):f.createCommentVNode("",!0)]),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Lq,f.toDisplayString(" "+((Rn=r.tableData)==null?void 0:Rn.filtered)||0),1)):f.createCommentVNode("",!0)])]),Math.ceil(((Te=r.tableData)==null?void 0:Te.filtered)/r.limit)>1?(f.openBlock(),f.createBlock(Se,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((He=r.tableData)==null?void 0:He.filtered)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit,backgroundColor:"#F3F4F6"},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>{var De;return[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(_e,{key:0,table:n.table,columns:(De=r.tableData)==null?void 0:De.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]}),_:1})])])])])}const Fq={components:{AdminTable:$e(gq,[["render",Vq],["__scopeId","data-v-c62adcdb"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){So!=null&&So.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=hl.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 i,r;const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.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 rt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},$q=["innerHTML"];function jq(t,e,n,i,r,a){const u=f.resolveComponent("AdminTable");return r.table?(f.openBlock(),f.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,$q))}const Uq=Object.freeze(Object.defineProperty({__proto__:null,default:$e(Fq,[["render",jq]])},Symbol.toStringTag,{value:"Module"}));return Dj});
786
+ `});g.mount(l)})},Ij=async()=>{try{const{data:t}=await rt.get("/api/user-menu");return So.value=t,DS(t)}catch(t){return console.error(t),[]}},Pj=(t,e)=>{Object.entries(e).forEach(([n,i])=>{t.component(n,i)})},Dj={async install(t,{componentsApp:e={},settings:n}){hl.value={...hl,...n};try{const r=(await Ij()).filter(u=>u==null?void 0:u.component).map(u=>({...u,component:{...e_,...e}[u==null?void 0:u.component]}));Pj(t,{...e_,...e}),t.component("admin",GT);const{router:a}=await AA(r);window.app={...t,router:a},window.v3plugin={...t.config.globalProperties,...OS},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...wB,componentsApp:e},$router:a,$v3plugin:OS},t.use(a)}catch(i){console.error(i)}},components:e_},Oj={data(){return{formValues:{},scheme:null,table:"",token:""}},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 i,r;const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:a}}=await rt.get(`/api/template/table/${n}`),{data:u}=await rt.get(`/api/table/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.token=(u==null?void 0:u.token)||"",this.formValues=u||{};const{data:l}=await rt.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){try{await this.$refs.form.doValidation(),await rt.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},async editObjectAndRedirect(){try{await this.$refs.form.doValidation(),await rt.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},Bj={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},zj={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Nj={class:"flex items-center gap-[6px]"},Rj={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},Lj={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 Vj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",Bj,[f.createElementVNode("div",zj,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",Nj,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>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"}," Повернутися "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.onlyEditObject&&a.onlyEditObject(...l)),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"}," Зберегти "),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...l)=>a.editObjectAndRedirect&&a.editObjectAndRedirect(...l)),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"}," Зберегти і повернутися ")])]),f.createElementVNode("div",Rj,[f.createElementVNode("div",Lj,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[3]||(e[3]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const Fj=Object.freeze(Object.defineProperty({__proto__:null,default:$e(Oj,[["render",Vj]])},Symbol.toStringTag,{value:"Module"})),$j={data(){return{formValues:{},scheme:null,table:"",token:""}},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 i,r;const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const a=await rt.get(`/api/table-data/${n}`),{data:u}=await rt.get(`/api/template/form/${(i=a==null?void 0:a.data)==null?void 0:i.form}`);this.scheme=(u==null?void 0:u.schema)||u,this.token=(r=a==null?void 0:a.data)==null?void 0:r.addToken}catch{}},async createObject(){var e,n,i,r,a,u,l,g;const t=this.$refs.form;try{await t.doValidation(),await rt.post(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{let k=((r=(i=(n=(e=Object.entries(t==null?void 0:t.formErrors))==null?void 0:e[0])==null?void 0:n[1])==null?void 0:i[0])==null?void 0:r.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(l=(u=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:u[1])==null?void 0:l[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:k||"Сталася помилка валідаціі",type:"error"})}}}},jj={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},Uj={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Hj={class:"flex items-center gap-[6px]"},qj={style:{height:"calc(100vh - 165px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},Wj={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 Gj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",jj,[f.createElementVNode("div",Uj,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",Hj,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>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"}," Скасувати "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),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"}," Зберегти ")])]),f.createElementVNode("div",qj,[f.createElementVNode("div",Wj,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const Zj=Object.freeze(Object.defineProperty({__proto__:null,default:$e($j,[["render",Gj]])},Symbol.toStringTag,{value:"Module"})),Yj={};function Xj(t,e,n,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const BS=Object.freeze(Object.defineProperty({__proto__:null,default:$e(Yj,[["render",Xj]])},Symbol.toStringTag,{value:"Module"})),Kj={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},Jj={class:"mr-[10px]"},Qj={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},e7={class:"flex items-center gap-[6px] ml-auto"},t7={class:"mr-[10px]"},n7={components:{AdminCardHeader:{__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0},slots:{type:Object}},setup(t){var E,C,I,D,R;const{asyncTemplateSlot:e}=(R=(D=(I=(C=(E=f.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:C.app)==null?void 0:I.config)==null?void 0:D.globalProperties)==null?void 0:R.utils,n=t,i=vA(),r=wA(),a=f.ref(""),u=f.ref(""),l=()=>{i.back()},g=f.computed(()=>{var $;return`/edit?table=${n.getRoute}&id=${($=r==null?void 0:r.params)==null?void 0:$.id}`}),b=()=>{var $,G,q,se;if(!(($=n.slots)!=null&&$.panelLeft))return"div";if((G=n.slots)!=null&&G.panelLeft.includes("<")){const Q=e("PanelLeft",(q=n.slots)==null?void 0:q.panelLeft,["name"]);u.value=Q}else u.value=(se=n.slots)==null?void 0:se.panelLeft},k=()=>{var $,G,q,se;if(!(($=n.slots)!=null&&$.panelRight))return"div";if((G=n.slots)!=null&&G.panelRight.includes("<")){const Q=e("PanelRight",(q=n.slots)==null?void 0:q.panelRight,["name"]);a.value=Q}else a.value=(se=n.slots)==null?void 0:se.panelRight};return b(),k(),($,G)=>{const q=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",Kj,[f.createElementVNode("div",Jj,[f.createElementVNode("button",{onClick:l,class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),f.createElementVNode("h2",Qj,f.toDisplayString(t.title),1)]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(u.value))),f.createElementVNode("div",e7,[f.createElementVNode("div",t7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value)))]),f.createVNode(q,{to:g.value,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:f.withCtx(()=>G[0]||(G[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])])])}}},AdminCardAsyncComponent:{__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(t){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,n=f.ref(""),i=t;return(()=>{const k=e("CustomComponent",i.slot,["data"]);n.value=k})(),(k,E)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(n.value),{data:t.objectData},null,8,["data"]))}}},data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var i,r;return(n==null?void 0:n.table)==((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTitle(){var t,e,n,i,r,a,u,l,g,b,k,E,C,I,D;if((n=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])!=null&&n.name)return((u=(a=(r=(i=this.objectData)==null?void 0:i.rows)==null?void 0:r[0])==null?void 0:a.name)==null?void 0:u.length)<35?(b=(g=(l=this.objectData)==null?void 0:l.rows)==null?void 0:g[0])==null?void 0:b.name:((I=(C=(E=(k=this.objectData)==null?void 0:k.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:I.slice(0,35))+" ...";{const R=(D=this.flattenMenu(So.value))==null?void 0:D.find($=>{var G,q;return($==null?void 0:$.table)===((q=(G=this.$route)==null?void 0:G.params)==null?void 0:q.table)});return R==null?void 0:R.ua}},reloadPageTrigger(){return t_.value}},async mounted(){await this.getObjectData(),await this.checkActiveComponent()},watch:{component(t){this.$router.replace({...this.$route,query:{tab:t}})},reloadPageTrigger(){this.getObjectData()}},methods:{async getObjectData(){var n;const{table:t,id:e}=(n=this.$route)==null?void 0:n.params;(!t||!e)&&this.$router.replace("/404");try{const{data:i}=await rt.get(`/api/table-data/${t}/${e}`);this.objectData=i}catch(i){console.error(i)}},getColClass(t){return`col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,i,r,a,u,l,g;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.tab;else{const b=(a=(r=this.objectData)==null?void 0:r.panels)==null?void 0:a.find(k=>(k==null?void 0:k.type)==="tabs"||(k==null?void 0:k.type)==="vertical-tabs");(u=b==null?void 0:b.items)!=null&&u.length&&(this.component=((l=b.items[0])==null?void 0:l.component)||((g=b.items[0])==null?void 0:g.name))}},flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},i7={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},r7={key:0,class:"bg-white border rounded-xl"},o7={class:"p-[10px] pl-[20px] text-md font-[500]"},s7=["innerHTML"],a7={key:1},l7={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},c7={key:2,class:"p-[20px] border-t"},u7=["innerHTML"],h7={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},d7=["onClick"],p7={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},f7={key:0,class:"p-[20px] border-t"},m7={key:1,class:"p-[20px] border-t"},g7=["innerHTML"],y7={key:3,class:"flex"},_7={class:"flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 h-auto items-start pl-[10px] bg-white py-[20px]"},b7=["onClick"],x7={class:"flex-grow"},v7={key:0,class:"h-full bg-white border rounded-xl"},w7={key:0,class:"p-[20px]"},k7={key:1,class:"p-[20px] border-t"},S7=["innerHTML"];function E7(t,e,n,i,r,a){var g,b,k;const u=f.resolveComponent("AdminCardHeader"),l=f.resolveComponent("AdminCardAsyncComponent");return f.openBlock(),f.createElementBlock("div",i7,[r.objectData&&((g=r.objectData)==null?void 0:g.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute,slots:(b=r.objectData)==null?void 0:b.slots},null,8,["title","get-route","slots"])):f.createCommentVNode("",!0),f.createElementVNode("div",{class:f.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((k=r.objectData)==null?void 0:k.panels,(E,C)=>{var I,D,R,$,G;return f.openBlock(),f.createElementBlock("div",{key:C,class:f.normalizeClass(a.getColClass(E.col))},[E!=null&&E.name?(f.openBlock(),f.createElementBlock("div",r7,[f.createElementVNode("h2",o7,f.toDisplayString((E==null?void 0:E.title)||"Панель"),1),(I=r.objectData)!=null&&I.html[E==null?void 0:E.name]?(f.openBlock(),f.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:(D=r.objectData)==null?void 0:D.html[E==null?void 0:E.name]},null,8,s7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(R=r.objectData)==null?void 0:R.vue[E==null?void 0:E.name],data:(G=($=r.objectData)==null?void 0:$.rows)==null?void 0:G[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):E.type==="container"?(f.openBlock(),f.createElementBlock("div",a7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.items,(q,se)=>{var Q,Se,_e,Ce,Le,Ie,Ue,Je,It,ot;return f.openBlock(),f.createElementBlock("div",{key:se,class:f.normalizeClass([{"mb-[20px]":E.items.length>1},"bg-white border rounded-xl"])},[q!=null&&q.title?(f.openBlock(),f.createElementBlock("h2",l7,f.toDisplayString((q==null?void 0:q.title)||"Панель"),1)):f.createCommentVNode("",!0),q!=null&&q.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":q==null?void 0:q.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(q.component),{geometry:(Se=(Q=r.objectData)==null?void 0:Q.rows[0])==null?void 0:Se.geom,columns:q==null?void 0:q.columns,token:q==null?void 0:q.token,zoom:16,data:r.objectData,id:(Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.id},null,8,["geometry","columns","token","data","id"]))],2)):f.createCommentVNode("",!0),q!=null&&q.name?(f.openBlock(),f.createElementBlock("div",c7,[(Ie=(Le=r.objectData)==null?void 0:Le.html)!=null&&Ie[q==null?void 0:q.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Ue=r.objectData)==null?void 0:Ue.html[q==null?void 0:q.name]},null,8,u7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Je=r.objectData)==null?void 0:Je.vue[q==null?void 0:q.name],data:(ot=(It=r.objectData)==null?void 0:It.rows)==null?void 0:ot[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(E==null?void 0:E.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",h7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E==null?void 0:E.items,q=>(f.openBlock(),f.createElementBlock("button",{key:(q==null?void 0:q.name)||(q==null?void 0:q.component),onClick:se=>r.component=(q==null?void 0:q.component)||(q==null?void 0:q.name),class:f.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name),"":r.component!==(q==null?void 0:q.component)&&r.component!==(q==null?void 0:q.name)}])},f.toDisplayString(q==null?void 0:q.title),11,d7))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.items,(q,se)=>{var Q,Se,_e,Ce,Le,Ie,Ue,Je,It,ot;return f.openBlock(),f.createElementBlock(f.Fragment,{key:se},[r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name)?(f.openBlock(),f.createElementBlock("div",p7,[q!=null&&q.component?(f.openBlock(),f.createElementBlock("div",f7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(q.component),{data:r.objectData,token:q==null?void 0:q.token,columns:q==null?void 0:q.columns,geometry:(Se=(Q=r.objectData)==null?void 0:Q.rows[0])==null?void 0:Se.geom,zoom:16,id:(Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.id},null,8,["data","token","columns","geometry","id"]))])):f.createCommentVNode("",!0),q!=null&&q.name?(f.openBlock(),f.createElementBlock("div",m7,[(Ie=(Le=r.objectData)==null?void 0:Le.html)!=null&&Ie[q==null?void 0:q.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Ue=r.objectData)==null?void 0:Ue.html[q==null?void 0:q.name]},null,8,g7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Je=r.objectData)==null?void 0:Je.vue[q==null?void 0:q.name],data:(ot=(It=r.objectData)==null?void 0:It.rows)==null?void 0:ot[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(E==null?void 0:E.type)==="vertical-tabs"?(f.openBlock(),f.createElementBlock("div",y7,[f.createElementVNode("nav",_7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E==null?void 0:E.items,q=>(f.openBlock(),f.createElementBlock("button",{key:(q==null?void 0:q.name)||(q==null?void 0:q.component),onClick:se=>r.component=(q==null?void 0:q.component)||(q==null?void 0:q.name),class:f.normalizeClass(["relative whitespace-pre-wrap text-left inline-flex items-center w-full py-1 text-sm border-transparent pe-4 gap-x-2 border-e-2 hover:text-blue-600 focus:outline-none focus:text-blue-600",{"font-semibold after:absolute after:top-[0] after:right-[-1px] after:h-full text-blue-600 after:w-[2px] after:bg-blue-600 ":r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name),"text-gray-500":r.component!==(q==null?void 0:q.component)&&r.component!==(q==null?void 0:q.name)}])},f.toDisplayString(q==null?void 0:q.title),11,b7))),128))]),f.createElementVNode("div",x7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.items,(q,se)=>{var Q,Se,_e,Ce,Le,Ie,Ue,Je,It,ot;return f.openBlock(),f.createElementBlock(f.Fragment,{key:se},[r.component===(q==null?void 0:q.component)||r.component===(q==null?void 0:q.name)?(f.openBlock(),f.createElementBlock("div",v7,[q!=null&&q.component?(f.openBlock(),f.createElementBlock("div",w7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(q.component),{token:q==null?void 0:q.token,data:r.objectData,columns:q==null?void 0:q.columns,geometry:(Se=(Q=r.objectData)==null?void 0:Q.rows[0])==null?void 0:Se.geom,zoom:16,id:(Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.id},null,8,["token","data","columns","geometry","id"]))])):f.createCommentVNode("",!0),q!=null&&q.name?(f.openBlock(),f.createElementBlock("div",k7,[(Ie=(Le=r.objectData)==null?void 0:Le.html)!=null&&Ie[q==null?void 0:q.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Ue=r.objectData)==null?void 0:Ue.html[q==null?void 0:q.name]},null,8,S7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Je=r.objectData)==null?void 0:Je.vue[q==null?void 0:q.name],data:(ot=(It=r.objectData)==null?void 0:It.rows)==null?void 0:ot[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const C7=Object.freeze(Object.defineProperty({__proto__:null,default:$e(n7,[["render",E7],["__scopeId","data-v-e6a747cc"]])},Symbol.toStringTag,{value:"Module"})),T7={},M7={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 A7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",M7,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),f.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const I7=$e(T7,[["render",A7]]),P7={},D7={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",D7,e[0]||(e[0]=[f.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 B7=$e(P7,[["render",O7]]),z7={},N7={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 R7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",N7,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const zS=$e(z7,[["render",R7]]),L7={components:{IconChevronDown:zS},props:{route:Object},mounted(){var t,e,n;(t=this.route)!=null&&t.menu&&(n=(e=this.route)==null?void 0:e.menu)!=null&&n.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},data(){return{isOpen:!1}}},V7={key:0,class:""},F7={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},$7={key:1};function j7(t,e,n,i,r,a){var g,b,k,E,C,I,D,R,$,G,q,se,Q;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=n.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",V7,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Se=>r.isOpen=!r.isOpen),class:f.normalizeClass(["flex cursor-pointer gap-x-3 py-2 px-3 text-sm text-gray-800 justify-start w-full border-none focus:outline-none text-left rounded-lg items-center hover:bg-gray-100 duration-300",[((k=(b=n.route)==null?void 0:b.menu)==null?void 0:k.some(Se=>{var _e,Ce;return(Se==null?void 0:Se.path)===t.$route.path.replace("/","")||(Se==null?void 0:Se.table)===((Ce=(_e=t.$route)==null?void 0:_e.params)==null?void 0:Ce.table)&&(Se==null?void 0:Se.table)}))&&"bg-gray-100"]])},[f.createTextVNode(f.toDisplayString((E=n.route)==null?void 0:E.ua)+" ",1),f.createVNode(u,{class:f.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var Se;return[f.withDirectives(f.createElementVNode("ul",F7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Se=n.route)==null?void 0:Se.menu,(_e,Ce)=>{var Le,Ie;return f.openBlock(),f.createElementBlock("li",{key:Ce,class:"w-full"},[f.createVNode(l,{to:"/"+(_e==null?void 0:_e.path),class:f.normalizeClass([[((_e==null?void 0:_e.path)===t.$route.path.replace("/","")||((Ie=(Le=t.$route)==null?void 0:Le.params)==null?void 0:Ie.table)===(_e==null?void 0:_e.table)&&(_e==null?void 0:_e.table))&&"bg-gray-100"],"flex gap-x-4 py-2 px-3 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(_e==null?void 0:_e.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(f.openBlock(),f.createElementBlock("div",$7,[f.createVNode(l,{to:((I=(C=n.route)==null?void 0:C.path)==null?void 0:I[0])==="/"?(D=n.route)==null?void 0:D.path:"/"+((R=n.route)==null?void 0:R.path),class:f.normalizeClass([[((($=n.route)==null?void 0:$.path.replace("/",""))===t.$route.path.replace("/","")||((q=(G=t.$route)==null?void 0:G.params)==null?void 0:q.table)===((se=n.route)==null?void 0:se.table)&&((Q=n.route)==null?void 0:Q.table))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:f.withCtx(()=>{var Se;return[f.createTextVNode(f.toDisplayString((Se=n.route)==null?void 0:Se.ua),1)]}),_:1},8,["to","class"])]))}const U7={components:{IconLogout:I7,NavbarItem:$e(L7,[["render",j7]]),IconLogo:B7,IconSearch:Q0},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t,e;return(t=this.searchValue)!=null&&t.trim()?(e=this.flattenMenu(So.value))==null?void 0:e.filter(n=>{var i,r,a;return(a=(i=n==null?void 0:n.ua)==null?void 0:i.toLowerCase())==null?void 0:a.includes((r=this.searchValue)==null?void 0:r.toLowerCase())}):So.value},logo(){var t;return((t=hl.value)==null?void 0:t.logo)||"/assets/logo.svg"}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},H7={class:"flex flex-col h-[100vh] border-r w-[260px] shrink-0"},q7=["src"],W7={class:"relative"},G7={class:"p-[16px] 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"},Z7={class:"flex flex-col flex-wrap w-full pb-3"},Y7={key:0,class:"flex flex-col gap-[6px]"},X7={key:1,class:"text-gray-800 text-lg mt-[20px]"};function K7(t,e,n,i,r,a){var b;const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",H7,[f.createElementVNode("img",{src:a.logo,height:"40",width:"200",class:"my-[20px] ml-[20px]"},null,8,q7),f.createElementVNode("div",W7,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=k=>r.searchValue=k),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("div",G7,[f.createElementVNode("nav",Z7,[(b=a.data)!=null&&b.length?(f.openBlock(),f.createElementBlock("ul",Y7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(k,E)=>(f.openBlock(),f.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[f.createVNode(g,{route:k},null,8,["route"])]))),128))])):(f.openBlock(),f.createElementBlock("div",X7,"Не знайдено"))])])])}const J7=$e(U7,[["render",K7]]),Q7={},e9={class:"shrink-0",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"};function t9(t,e){return f.openBlock(),f.createElementBlock("svg",e9,e[0]||(e[0]=[f.createElementVNode("path",{d:"M18 6 7 17l-5-5"},null,-1),f.createElementVNode("path",{d:"m22 10-7.5 7.5L13 16"},null,-1)]))}const n9=$e(Q7,[["render",t9]]),i9={},r9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function o9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",r9,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),f.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const NS=$e(i9,[["render",o9]]),s9={},a9={class:"shrink-0 size-4",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"};function l9(t,e){return f.openBlock(),f.createElementBlock("svg",a9,e[0]||(e[0]=[f.createElementVNode("polyline",{points:"9 11 12 14 22 4"},null,-1),f.createElementVNode("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"},null,-1)]))}const c9=$e(s9,[["render",l9]]),u9={class:"relative shrink-0"},h9=["src"],d9={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},p9={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},f9={class:"grow"},m9={class:"text-xs text-gray-500 dark:text-neutral-500"},g9={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},y9={class:"text-sm text-gray-500 dark:text-neutral-500"},_9={key:0,class:"sm:group-hover:opacity-100 sm:opacity-0 sm:absolute sm:top-5 sm:end-5 inline-block p-0.5 bg-white border border-gray-200 rounded-lg shadow-sm transition ease-out"},b9={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(t,{emit:e}){const n=e,i=f.ref(!1),r=()=>i.value=!0,a=()=>i.value=!1,u=async()=>{var l;try{await rt.get(`/api/notification-read/${(l=t.item)==null?void 0:l.id}`),await n("update-notification")}catch{}};return(l,g)=>{var k,E,C,I,D,R;const b=f.resolveComponent("VsPopover");return f.openBlock(),f.createElementBlock("li",{class:f.normalizeClass(["relative group w-full flex gap-x-5 text-start p-5 border-b",[(k=t.item)!=null&&k.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",u9,[(E=t.item)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(C=t.item)==null?void 0:C.avatar,alt:"Avatar"},null,8,h9)):(f.openBlock(),f.createElementBlock("div",d9,[f.createVNode(NS)])),(I=t.item)!=null&&I.read?(f.openBlock(),f.createElementBlock("span",p9)):f.createCommentVNode("",!0)]),f.createElementVNode("div",f9,[f.createElementVNode("p",m9,[f.createVNode(ay,{name:"cdate",data:t.item},null,8,["data"])]),f.createElementVNode("span",g9,f.toDisplayString((D=t.item)==null?void 0:D.author),1),f.createElementVNode("p",y9,f.toDisplayString((R=t.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",_9,[f.createVNode(b,{trigger:"hover",placement:"left"},{reference:f.withCtx(()=>[f.createElementVNode("button",{onClick:u,type:"button",class:"hs-tooltip-toggle hs-tooltip relative inline-block size-7 flex shrink-0 justify-center items-center text-gray-500 hover:bg-gray-100 hover:text-gray-800 rounded"},[f.createVNode(c9)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},x9={},v9={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 w9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",v9,e[0]||(e[0]=[f.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),f.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const k9=$e(x9,[["render",w9]]),S9={},E9={class:"shrink-0 size-4",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"};function C9(t,e){return f.openBlock(),f.createElementBlock("svg",E9,e[0]||(e[0]=[f.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1),f.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))}const T9=$e(S9,[["render",C9]]),M9={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},A9={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"},I9={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},P9={class:"h-[50px] px-[20px] border-b w-full flex items-center justify-between rounded-t-lg bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]"},D9={class:"h-[30px] w-[30px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"},O9={class:"max-h-[400px] bg-white overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300"},B9={key:0},z9={__name:"admin-notification",setup(t){var b,k,E,C,I;const e=f.ref(0),n=f.ref([]),i=f.ref(!1),r=f.ref(null),a=(I=(C=(E=(k=(b=f.getCurrentInstance())==null?void 0:b.appContext)==null?void 0:k.app)==null?void 0:E.config)==null?void 0:C.globalProperties)==null?void 0:I.$notify,u=D=>{r.value&&!r.value.contains(D.target)&&(i.value=!1)};f.watch(i,D=>{D?window.addEventListener("click",u):window.removeEventListener("click",u)}),f.onBeforeUnmount(()=>{window.removeEventListener("click",u)});const l=async()=>{try{const{data:D}=await rt.get("/api/notification");n.value=(D==null?void 0:D.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await rt.get("/api/notification-read"),await l()}catch{a({type:"error",message:"Виникла помилка",title:"Помилка!"})}};return(D,R)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"notificationRef",ref:r,class:"hs-tooltip [--placement:bottom] inline-block show relative"},[f.createElementVNode("button",{onClick:R[0]||(R[0]=$=>i.value=!i.value),class:"hs-tooltip-toggle relative 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"},[f.createVNode(k9,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",M9,[R[1]||(R[1]=f.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),f.createElementVNode("span",A9,f.toDisplayString(e.value),1)])):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,null,{default:f.withCtx(()=>{var $;return[i.value?(f.openBlock(),f.createElementBlock("div",I9,[f.createElementVNode("div",P9,[R[2]||(R[2]=f.createElementVNode("nav",{class:"flex"},[f.createElementVNode("button",{type:"button",class:"px-2 py-1.5 relative inline-flex justify-center items-center gap-x-2 text-nowrap hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg focus:outline-none focus:bg-gray-100 after:absolute after:bottom-[-9px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800"}," Всі ")],-1)),f.createElementVNode("button",D9,[f.createVNode(T9)])]),f.createElementVNode("div",O9,[($=n.value)!=null&&$.length?(f.openBlock(),f.createElementBlock("ul",B9,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.value,G=>(f.openBlock(),f.createBlock(b9,{key:G==null?void 0:G.id,item:G,onUpdateNotification:l},null,8,["item"]))),128))])):f.createCommentVNode("",!0)]),f.createElementVNode("button",{onClick:g,class:"h-[50px] border-t w-full rounded-b-lg bg-white shadow p-4 flex justify-center items-center gap-x-2 text-sm text-gray-500 font-medium sm:rounded-b-lg hover:text-blue-600 focus:outline-none"},[f.createVNode(n9,{height:"16",width:"16"}),R[3]||(R[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},N9={},R9={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 L9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",R9,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),f.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),f.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const V9={components:{IconQuestion:$e(N9,[["render",L9]]),IconUser:NS,AdminNotification:z9},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 rt.get("/user");this.userData=t}catch{}},async logout(){try{await rt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},F9={class:"h-[60px] border-b flex justify-end px-[20px]",style:{width:"calc(100vw - 260px)"}},$9={class:"flex items-center gap-[6px]"},j9={href:"docs-softpro.com",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"},U9={class:"relative"},H9=["src"],q9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},W9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},G9=["src"],Z9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},Y9={class:"text-[14px] mr-[10px] text-gray-500"},X9={class:"flex flex-col p-[4px]"};function K9(t,e,n,i,r,a){var k,E,C,I,D,R,$,G,q,se;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",F9,[f.createElementVNode("div",$9,[f.createElementVNode("a",j9,[f.createVNode(u,{height:"24",width:"24"})]),f.createVNode(l),e[4]||(e[4]=f.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),f.createElementVNode("div",U9,[f.createElementVNode("div",{onClick:e[0]||(e[0]=Q=>r.isVisible=!0),class:"cursor-pointer"},[(E=(k=r.userData)==null?void 0:k.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(I=(C=r.userData)==null?void 0:C.user)==null?void 0:I.avatar,alt:"Image Description"},null,8,H9)):(f.openBlock(),f.createElementBlock("div",q9,[f.createVNode(g)]))]),r.isVisible?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[2]||(e[2]=f.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[f.createElementVNode("div",W9,[(R=(D=r.userData)==null?void 0:D.user)!=null&&R.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=($=r.userData)==null?void 0:$.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,G9)):(f.openBlock(),f.createElementBlock("div",Z9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",Y9,f.toDisplayString((se=(q=r.userData)==null?void 0:q.user)==null?void 0:se.username),1)])]),f.createElementVNode("div",X9,[f.createVNode(b,{to:"profile",disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:f.withCtx(()=>e[3]||(e[3]=[f.createTextVNode("Профіль")])),_:1}),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...Q)=>a.logout&&a.logout(...Q)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const J9={components:{navbar:J7,AdminHeader:$e(V9,[["render",K9]])},computed:{isMenu(){return So.value||null}}},Q9={class:"admin-wrapper"},eU={class:"flex flex-col"};function tU(t,e,n,i,r,a){const u=f.resolveComponent("navbar"),l=f.resolveComponent("admin-header"),g=f.resolveComponent("router-view");return f.openBlock(),f.createElementBlock("div",Q9,[f.createVNode(u),f.createElementVNode("div",eU,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createVNode(l),f.createVNode(g)],64)):f.createCommentVNode("",!0)])])}const nU=Object.freeze(Object.defineProperty({__proto__:null,default:$e(J9,[["render",tU],["__scopeId","data-v-36fd7ac9"]])},Symbol.toStringTag,{value:"Module"})),iU={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,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},rU={scope:"col",class:"text-start px-2 py-1"},oU={class:"flex-shrink-0 size-3.5",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"},sU={key:0,d:"m7 15 5 5 5-5"},aU={key:1,d:"m7 9 5-5 5 5"},lU={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500"};function cU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("th",rU,[a.getVisibleIcon?(f.openBlock(),f.createElementBlock("button",{key:0,type:"button",class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500 flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[f.createTextVNode(f.toDisplayString(a.label)+" ",1),(f.openBlock(),f.createElementBlock("svg",oU,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",sU)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",aU)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",lU,f.toDisplayString(a.label),1))])}const uU=$e(iU,[["render",cU]]),hU={},dU={class:"flex-shrink-0 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 pU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",dU,e[0]||(e[0]=[f.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const fU=$e(hU,[["render",pU]]),mU={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},gU={style:{display:"none"}},yU=["height","width","fill"];function _U(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock("svg",gU,e[0]||(e[0]=[f.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[f.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(f.openBlock(),f.createElementBlock("svg",{height:n.height,width:n.width,fill:n.color},e[1]||(e[1]=[f.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,yU))],64)}const bU={components:{IconMore:CS,IconDelete:fU,IconEdit:$e(mU,[["render",_U]])},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 rt.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;try{const{data:e}=await rt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await rt.delete(`/api/table/${e==null?void 0:e.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e;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}),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})}}},xU={class:"hs-dropdown [--placement:bottom-right] inline-flex"},vU={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"},wU={class:"flex flex-col items-start"},kU=["onClick"],SU={class:"text-gray-800"},EU={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},CU={class:"p-4"},TU={class:"flex justify-end mt-4 gap-x-3"};function MU(t,e,n,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),k=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",xU,[f.createVNode(k,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",vU,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,I,D,R,$;return[f.createElementVNode("div",wU,[(C=n.actions)!=null&&C.includes("edit")&&n.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(I=t.$route)==null?void 0:I.params)==null?void 0:D.catchAll}&id=${(R=n.item)==null?void 0:R.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:f.withCtx(()=>[f.createVNode(l,{color:"#000"}),e[4]||(e[4]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"])):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getCustomActions,(G,q)=>(f.openBlock(),f.createElementBlock("button",{key:q,onClick:se=>a.customButtonAction(G),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"},[f.createVNode(b,{class:"opacity-0"}),f.createElementVNode("span",SU,f.toDisplayString(G==null?void 0:G.label),1)],8,kU))),128)),n.isForm?(f.openBlock(),f.createElementBlock("div",EU)):f.createCommentVNode("",!0),($=n.actions)!=null&&$.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["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"},[f.createVNode(b),e[5]||(e[5]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):f.createCommentVNode("",!0)])]}),_:1})]),f.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=C=>r.isDeleteConfirm=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",CU,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",TU,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 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",onClick:e[1]||(e[1]=C=>r.isDeleteConfirm=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...C)=>a.deleteElement&&a.deleteElement(...C))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const AU=$e(bU,[["render",MU]]),IU={},PU={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 DU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",PU,e[0]||(e[0]=[f.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),f.createElementVNode("path",{d:"M7 20V4"},null,-1),f.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),f.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const OU=$e(IU,[["render",DU]]),BU={},zU={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 NU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",zU,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const RU={components:{IconExport:OU,IconChevronDown:zS,IconSuccess:$e(BU,[["render",NU]])},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 rt.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=new Blob([e.data],{type:"application/octet-stream"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(i),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.error("Ошибка при экспорте файла:",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"}}},LU={key:0,class:"flex flex-col items-center"},VU={key:1,class:"p-4"},FU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},$U={class:"flex items-center"},jU={class:"flex items-center gap-[10px] ml-auto"},UU=["onClick"],HU={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},qU={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},WU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},GU={class:"mt-2 space-y-2"},ZU=["id","onChange"],YU=["for"],XU={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},KU={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function JU(t,e,n,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),k=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=E=>r.isOpen=!0),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[7]||(e[7]=f.createTextVNode(" Експорт ")),f.createVNode(l,{height:"12",width:"16"})]),f.createVNode(k,{visible:r.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>r.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",XU,[f.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]=E=>r.isOpen=!1)}," Закрити "),f.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]=E=>r.isSuccessTemplate=!1)}," Вигрузити ще ")])):(f.openBlock(),f.createElementBlock("div",KU,[f.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]=E=>r.isOpen=!1)}," Скасувати "),f.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]=(...E)=>a.exportTable&&a.exportTable(...E))}," Завантажити таблицю ")]))]),default:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",LU,[f.createVNode(g,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=f.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(f.openBlock(),f.createElementBlock("div",VU,[f.createElementVNode("div",FU,[f.createElementVNode("div",$U,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",jU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.actions,E=>(f.openBlock(),f.createElementBlock("button",{key:E==null?void 0:E.name,onClick:E==null?void 0:E.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"},[f.createElementVNode("span",{class:f.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===r.activeAction}])},[(E==null?void 0:E.name)===r.activeAction?(f.openBlock(),f.createElementBlock("span",HU)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,UU))),128))])]),f.createElementVNode("div",qU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[f.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=I=>r.cols=I),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",WU,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",GU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.tableFormats,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C},[f.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:E,onChange:I=>a.selectFormat(E)},null,40,ZU),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,YU)]))),128))])])]))]),_:1},8,["visible"])],64)}const QU=$e(RU,[["render",JU]]),eH={},tH={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 nH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",tH,e[0]||(e[0]=[f.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 iH=$e(eH,[["render",nH]]),rH={props:{column:Object},emits:["update-column"],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)}},oH={class:"flex w-full gap-[8px] items-centr"};function sH(t,e,n,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",oH,[f.withDirectives(f.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=g=>r.value=g),type:"checkbox"},null,512),[[f.vModelCheckbox,r.value]]),f.createTextVNode(" "+f.toDisplayString(((u=n.column)==null?void 0:u.ua)||((l=n.column)==null?void 0:l.title)),1)])}const aH={components:{IconColumns:iH,AdminTableColumnsHiddenItem:$e(rH,[["render",sH]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(t){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}}},lH={class:"py-2 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"},cH={class:"py-[10px] px-[10px] w-[260px]"},uH={class:"flex flex-col gap-[3px] max-h-[400px] w-full 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 hH(t,e,n,i,r,a){const u=f.resolveComponent("IconColumns"),l=f.resolveComponent("AdminTableColumnsHiddenItem"),g=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(g,{trigger:"click",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",lH,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",cH,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",uH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,(b,k)=>(f.openBlock(),f.createElementBlock("li",{key:k},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const dH=$e(aH,[["render",hH]]),pH={},fH={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function mH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",fH,e[0]||(e[0]=[f.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const RS=$e(pH,[["render",mH]]),gH={},yH={class:"vs-table-interface__table-wrp w-full rounded h-fit overflow-hidden"};function _H(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",yH,e[0]||(e[0]=[f.createStaticVNode('<div><div class="p-5 min-h-[500px] flex flex-col justify-center items-center text-center"><svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg><div class="max-w-sm mx-auto mt-6"><p class="font-medium text-gray-800 dark:text-neutral-200"> Дані для відображення відсутні </p><p class="mt-2 text-sm text-gray-500 dark:text-neutral-500"> Змініть параметри пошуку або спробуйте пізніше </p></div></div></div>',1)]))}const bH=$e(gH,[["render",_H]]),xH={props:{row:Object,column:Object,table:String}};function vH(t,e,n,i,r,a){var u,l,g,b,k,E,C,I;return f.openBlock(),f.createBlock(f.resolveDynamicComponent(((u=n.column)==null?void 0:u.format)==="custom"?(l=n.column)==null?void 0:l.component:`table-format-${((b=(g=n.column)==null?void 0:g.format)==null?void 0:b.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>t.$emit("update-table")),name:(k=n.column)==null?void 0:k.name,data:n.row,value:(C=n.row)==null?void 0:C[(E=n.column)==null?void 0:E.name],table:n.table,column:n.column,edit:(I=n.column)==null?void 0:I.edit},null,40,["name","data","value","table","column","edit"])}const LS=$e(xH,[["render",vH]]),wH={},kH={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 SH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",kH,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const EH={components:{IconPlus:RS,IconMinus:$e(wH,[["render",SH]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},CH={class:"hs-accordion"},TH={class:"py-0.5 flex items-center gap-x-0.5 w-full"},MH={class:"text-sm font-medium"},AH={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function IH(t,e,n,i,r,a){const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("IconMinus");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[f.createElementVNode("div",CH,[f.createElementVNode("div",TH,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"rounded-md cursor-pointer grow"},[f.createElementVNode("span",MH,f.toDisplayString(n.title),1)]),f.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=g=>r.expanded=!r.expanded)},[r.expanded?(f.openBlock(),f.createBlock(l,{key:1,width:"14"})):(f.openBlock(),f.createBlock(u,{key:0}))])]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",AH,[f.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const PH={components:{AdminComponentIs:LS,AdminTree:$e(EH,[["render",IH],["__scopeId","data-v-e1f274c9"]]),VsNoData:IS,VsWidgetComments:MS,VsWidgetMap:Z1,VsWidgetFileList:Gv},props:{table:String,columns:Array,row:Object}},DH={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)"}},OH={class:"border-l",style:{height:"calc(100vh - 360px)"}},BH={class:"flex items-center justify-between py-1 gap-x-4"},zH={class:"col-span-1"},NH={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},RH={class:"col-span-2"},LH={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},VH={class:"table-info-card"},FH={class:"table-info-card"};function $H(t,e,n,i,r,a){var C,I,D;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),k=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",DH,[e[0]||(e[0]=f.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[f.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),f.createElementVNode("div",OH,[(I=(C=t.$route)==null?void 0:C.query)!=null&&I.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[n.row?(f.openBlock(),f.createBlock(l,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,R=>(f.openBlock(),f.createElementBlock("dl",BH,[f.createElementVNode("dt",zH,[f.createElementVNode("p",NH,f.toDisplayString((R==null?void 0:R.ua)||(R==null?void 0:R.title))+": ",1)]),f.createElementVNode("dd",RH,[f.createElementVNode("p",LH,[f.createVNode(u,{row:n.row,column:R,table:n.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),(D=n.row)!=null&&D.geom?(f.openBlock(),f.createBlock(l,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R,$;return[(R=n.row)!=null&&R.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:($=n.row)==null?void 0:$.geom,zoom:14},null,8,["geometry"])):(f.openBlock(),f.createBlock(b,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",VH,[f.createVNode(k,{id:(R=n.row)==null?void 0:R.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",FH,[f.createVNode(E,{id:(R=n.row)==null?void 0:R.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const jH=$e(PH,[["render",$H]]),UH={},HH={class:"hidden xl:block 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 qH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",HH,e[0]||(e[0]=[f.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),f.createElementVNode("path",{d:"M15 3v18"},null,-1),f.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const WH=$e(UH,[["render",qH]]),GH={},ZH={class:"h21yx vs0hq",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"};function YH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",ZH,e[0]||(e[0]=[f.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const XH={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:$e(GH,[["render",YH]])},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},KH={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},JH={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-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 QH(t,e,n,i,r,a){const u=f.resolveComponent("IconFilter"),l=f.resolveComponent("VsFilter");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=g=>r.isFilters=!r.isFilters),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=f.createTextVNode(" Фільтри ")),n.onFilters?(f.openBlock(),f.createElementBlock("span",KH,f.toDisplayString(n.onFilters),1)):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var g;return[f.withDirectives(f.createElementVNode("div",{onClick:e[3]||(e[3]=(...b)=>a.closeFilter&&a.closeFilter(...b)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[f.createElementVNode("div",JH,[(g=n.scheme)!=null&&g.length?(f.openBlock(),f.createBlock(l,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=b=>t.$emit("filterChange",b)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=b=>r.isFilters=!1)},null,8,["scheme"])):f.createCommentVNode("",!0)])],512),[[f.vShow,r.isFilters]])]}),_:1})],64)}const eq=$e(XH,[["render",QH]]),tq={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},nq={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"},iq=["onClick"];function rq(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("nav",nq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.tabsList,u=>(f.openBlock(),f.createElementBlock("button",{onClick:l=>t.$emit("update:filterState",u==null?void 0:u.name),class:f.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":(u==null?void 0:u.name)===n.filterState}])},f.toDisplayString(u==null?void 0:u.label),11,iq))),256))])}const oq=$e(tq,[["render",rq]]),sq={},aq={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 lq(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",aq,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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 cq={components:{IconFilter2:$e(sq,[["render",lq]])},props:{filterCustom:String,customList:Array}},uq={class:"py-2 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"},hq={class:"flex flex-col gap-[4px]"},dq=["onClick"];function pq(t,e,n,i,r,a){const u=f.resolveComponent("IconFilter2"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",uq,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",hq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:k=>{var E;t.$emit("update:filterCustom",g==null?void 0:g.name),(E=t.$refs)==null||E.popover.togglePopover()},key:b,class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":n.filterCustom===(g==null?void 0:g.name)}])},f.toDisplayString(g==null?void 0:g.label),11,dq))),128)),f.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=g=>{var b;t.$emit("update:filterCustom",void 0),(b=t.$refs)==null||b.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const fq=$e(cq,[["render",pq]]),mq={class:"flex items-center gap-x-2"},gq={props:{table:String,title:String},components:{AdminTableControl:AU,AdminTableExport:QU,AdminTableColumnsHidden:dH,AdminTableColumn:uU,AdminNodata:bH,IconPlus:RS,IconSearch:Q0,AdminTableCardInfo:jH,IconOpenCard:WH,AdminComponentIs:LS,AdminTableFilters:eq,AdminTableTabs:oq,AdminTableCustomFilters:fq,AdminTableCustomButtons:{__name:"admin-table-custom-buttons",props:{slots:Object},setup(t){var l,g,b,k,E;const{asyncTemplateSlot:e}=(E=(k=(b=(g=(l=f.getCurrentInstance())==null?void 0:l.appContext)==null?void 0:g.app)==null?void 0:b.config)==null?void 0:k.globalProperties)==null?void 0:E.utils,n=f.ref(""),i=f.ref(""),r=t,a=()=>{var C,I,D,R,$;if((C=r.slots)!=null&&C.panelLeft||(i.value="div"),(D=(I=r.slots)==null?void 0:I.panelLeft)!=null&&D.includes("<")){const G=e("PanelLeft",(R=r.slots)==null?void 0:R.panelLeft,["name"]);i.value=G}else i.value=($=r.slots)==null?void 0:$.panelLeft},u=()=>{var C,I,D,R,$;if((C=r.slots)!=null&&C.panelRight||(n.value="div"),(D=(I=r.slots)==null?void 0:I.panelRight)!=null&&D.includes("<")){const G=e("PanelRight",(R=r.slots)==null?void 0:R.panelRight,["name"]);n.value=G}else n.value=($=r.slots)==null?void 0:$.panelRight};return a(),u(),(C,I)=>(f.openBlock(),f.createElementBlock("div",mq,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(i.value))),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(n.value)))]))}}},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()},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;return(t=this.tableData)==null?void 0:t.form},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 i,r;return(n==null?void 0:n.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:((t,e=300)=>{let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{t.apply(this,i)},e)}})(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,i;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({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,i,r;this.visibleColumns=t==null?void 0:t.map(a=>a==null?void 0:a.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:(i=this.visibleColumns)!=null&&i.length?(r=this.visibleColumns)==null?void 0:r.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,i,r,a,u,l,g,b,k,E,C,I,D,R,$;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.limit)||20,this.filters=((u=decodeURI((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filter))==null?void 0:u.replaceAll("+"," "))||null,this.filterState=((g=(l=this.$route)==null?void 0:l.query)==null?void 0:g.filterState)||null,this.filterCustom=((k=(b=this.$route)==null?void 0:b.query)==null?void 0:k.custom)||null,this.searchValue=((C=(E=this.$route)==null?void 0:E.query)==null?void 0:C.search)||"",this.visibleColumns=((R=(D=(I=this.$route)==null?void 0:I.query)==null?void 0:D.columns)==null?void 0:R.split(","))||[],($=this.$route)!=null&&$.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,i;const e=(i=(n=this.tableData)==null?void 0:n.columns)==null?void 0:i.find(r=>r.name===t);if(e){const r=e==null?void 0:e.width;return r!=null&&r.includes("px")?r:`${r}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,i,r,a,u,l,g,b,k;try{const{data:E}=await rt.get(`/api/template/table/${this.table}`),C=await rt.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={...E,...(C==null?void 0:C.data)||{}},this.initialHiddenColumns=(a=(r=(i=(n=this.tableData)==null?void 0:n.columns)==null?void 0:i.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:r.map(I=>I==null?void 0:I.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(I=>{var D;(D=this.visibleColumns)!=null&&D.includes(I==null?void 0:I.name)?I.hidden=!1:I.hidden=!0}):this.visibleColumns=(k=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:k.map(I=>I==null?void 0:I.name)}catch{}},async getFilters(){var t;try{const{data:e}=await rt.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){const e=this.$route.query;this.page=t,!(!(e!=null&&e.page)&&t===1||e.page===t)&&(await this.$router.replace({query:{...e,page:t}}),await this.getTableData())},async changeLimit(t){this.limit=await t,this.defaultPage=1,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}`)},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}})}}},yq={class:"w-[calc(100vw - 320px)] bg-gray-50"},_q={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},bq={class:"text-xl font-medium"},xq={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex pt-[10px]"},vq={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},wq={class:"flex"},kq={class:"flex gap-[6px] ml-auto"},Sq={class:"inline-block w-full align-middle"},Eq={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"},Cq={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},Tq={class:"right-0 border-t border-stone-200"},Mq={key:0,class:"w-[70px] sticky right-0 top-0"},Aq={class:"divide-y divide-gray-200"},Iq={class:"px-4 py-3 text-sm text-gray-600"},Pq=["onClick"],Dq=["onClick"],Oq={class:"p-[20px] flex justify-start items-center w-full"},Bq={class:"w-[200px]"},zq={class:"text-sm text-gray-600 dark:text-neutral-400"},Nq={class:"font-semibold text-gray-800 dark:text-neutral-200"},Rq={key:0},Lq={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function Vq(t,e,n,i,r,a){var Ce,Le,Ie,Ue,Je,It,ot,zt,Xt,on,$t,Kt,Cn,dn,vn,pn,ti,Nn,Pn,Rn,Te,He;const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("router-link"),g=f.resolveComponent("AdminTableTabs"),b=f.resolveComponent("IconSearch"),k=f.resolveComponent("VsText"),E=f.resolveComponent("AdminTableCustomButtons"),C=f.resolveComponent("AdminTableCustomFilters"),I=f.resolveComponent("AdminTableColumnsHidden"),D=f.resolveComponent("AdminTableExport"),R=f.resolveComponent("AdminTableFilters"),$=f.resolveComponent("IconOpenCard"),G=f.resolveComponent("AdminTableColumn"),q=f.resolveComponent("AdminComponentIs"),se=f.resolveComponent("AdminTableControl"),Q=f.resolveComponent("AdminNodata"),Se=f.resolveComponent("VsPagination"),_e=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",yq,[f.createElementVNode("div",_q,[f.createElementVNode("h2",bq,f.toDisplayString(n.title),1),a.isForm?(f.openBlock(),f.createBlock(l,{key:0,to:`/add?table=${(Le=(Ce=t.$route)==null?void 0:Ce.params)==null?void 0:Le.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:f.withCtx(()=>[f.createVNode(u,{height:"16",width:"16"}),e[5]||(e[5]=f.createTextVNode(" Додати "))]),_:1},8,["to"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",xq,[f.createElementVNode("div",vq,[(Ue=(Ie=r.tableData)==null?void 0:Ie.filterState)!=null&&Ue.length?(f.openBlock(),f.createBlock(g,{key:0,tabsList:(Je=r.tableData)==null?void 0:Je.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=De=>r.filterState=De)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",wq,[f.createElementVNode("div",{class:f.normalizeClass([r.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[f.createElementVNode("div",{class:f.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createVNode(b,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),f.createVNode(k,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=De=>r.searchValue=De),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>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"]),f.createElementVNode("div",kq,[(It=r.tableData)!=null&&It.slots?(f.openBlock(),f.createBlock(E,{key:0,slots:(ot=r.tableData)==null?void 0:ot.slots},null,8,["slots"])):f.createCommentVNode("",!0),(Xt=(zt=r.tableData)==null?void 0:zt.filterCustom)!=null&&Xt.length?(f.openBlock(),f.createBlock(C,{key:1,customList:(on=r.tableData)==null?void 0:on.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=De=>r.filterCustom=De)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(I,{columns:($t=r.tableData)==null?void 0:$t.columns,onUpdateColumns:e[3]||(e[3]=De=>r.tableData.columns=De)},null,8,["columns"]),f.createVNode(D,{table:n.table,columns:(Kt=r.tableData)==null?void 0:Kt.columns,page:r.page,"filter-state":r.filterState,"filter-custom":r.filterCustom,filters:r.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"]),(Cn=r.filterScheme)!=null&&Cn.length?(f.openBlock(),f.createBlock(R,{key:2,scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"])):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...De)=>a.toggleCardInfo&&a.toggleCardInfo(...De)),class:"py-2 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"},[f.createVNode($,{class:f.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),f.createElementVNode("div",{class:f.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createElementVNode("div",{style:f.normalizeStyle({height:(vn=(dn=r.tableData)==null?void 0:dn.filterState)!=null&&vn.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"},[f.createElementVNode("div",Sq,[a.isNoData?(f.openBlock(),f.createBlock(Q,{key:1})):(f.openBlock(),f.createElementBlock("table",Eq,[f.createElementVNode("thead",Cq,[f.createElementVNode("tr",Tq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,De=>(f.openBlock(),f.createBlock(G,{key:De.name,style:f.normalizeStyle({width:a.rowWidth(De==null?void 0:De.name),textAlign:De==null?void 0:De.align,wordBreak:De==null?void 0:De.wrap}),data:De,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(ti=(pn=a.getActions)==null?void 0:pn.filter(De=>De!=="add"))!=null&&ti.length?(f.openBlock(),f.createElementBlock("th",Mq)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",Aq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Nn=r.tableData)==null?void 0:Nn.rows,(De,ct)=>{var Nt,Jt,Mt,Tt,nn,we,yn,pr,jt,sn;return f.openBlock(),f.createElementBlock("tr",{key:ct,class:f.normalizeClass({"bg-gray-50":((Jt=(Nt=t.$route)==null?void 0:Nt.query)==null?void 0:Jt.card)===(De==null?void 0:De.id)})},[f.createElementVNode("td",Iq,[f.createElementVNode("button",{onClick:()=>a.pushToCard(De==null?void 0:De.id),class:f.normalizeClass(["text-sm font-medium",[((Mt=r.tableData)==null?void 0:Mt.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(q,{row:De,column:a.columns[0],table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Pq)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Tt=a.columns)==null?void 0:Tt.slice(1),ui=>(f.openBlock(),f.createElementBlock("td",{onClick:Hi=>a.changeActiveCardInfo(De==null?void 0:De.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start whitespace-nowrap",{"cursor-pointer":r.isVisibleCardInfo}]),key:ui.name},[f.createVNode(q,{row:De,column:ui,table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Dq))),128)),(we=(nn=a.getActions)==null?void 0:nn.filter(ui=>ui!=="add"))!=null&&we.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((pr=(yn=t.$route)==null?void 0:yn.query)==null?void 0:pr.card)===(De==null?void 0:De.id),"bg-white":((sn=(jt=t.$route)==null?void 0:jt.query)==null?void 0:sn.card)!==(De==null?void 0:De.id)}])},[f.createVNode(se,{actions:a.getActions,isForm:a.isForm,item:De,table:n.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):f.createCommentVNode("",!0)],2)}),128))])]))])],4)],2),f.createElementVNode("div",Oq,[f.createElementVNode("div",Bq,[f.createElementVNode("p",zq,[f.createElementVNode("span",Nq,[f.createTextVNode(f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((Pn=r.tableData)==null?void 0:Pn.count)||"0 ")+" ",1),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Rq," з")):f.createCommentVNode("",!0)]),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Lq,f.toDisplayString(" "+((Rn=r.tableData)==null?void 0:Rn.filtered)||0),1)):f.createCommentVNode("",!0)])]),Math.ceil(((Te=r.tableData)==null?void 0:Te.filtered)/r.limit)>1?(f.openBlock(),f.createBlock(Se,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((He=r.tableData)==null?void 0:He.filtered)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit,backgroundColor:"#F3F4F6"},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>{var De;return[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(_e,{key:0,table:n.table,columns:(De=r.tableData)==null?void 0:De.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]}),_:1})])])])])}const Fq={components:{AdminTable:$e(gq,[["render",Vq],["__scopeId","data-v-c62adcdb"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){So!=null&&So.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=hl.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 i,r;const t=this.flattenMenu(So.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.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 rt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},$q=["innerHTML"];function jq(t,e,n,i,r,a){const u=f.resolveComponent("AdminTable");return r.table?(f.openBlock(),f.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,$q))}const Uq=Object.freeze(Object.defineProperty({__proto__:null,default:$e(Fq,[["render",jq]])},Symbol.toStringTag,{value:"Module"}));return Dj});