@opengis/admin 0.1.73 → 0.1.74
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{IconChevronDown-Bo0VyMHX.js → IconChevronDown-B65ioxEK.js} +1 -1
- package/dist/{add-page-CyIBxGV_.js → add-page-Dva8zP3n.js} +1 -1
- package/dist/{admin-interface-Dwr6luwW.js → admin-interface-BfAJWo-U.js} +2 -2
- package/dist/{admin-view-CFzoulzN.js → admin-view-DW5O-fWK.js} +2 -2
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +6 -6
- package/dist/{card-page-GyqV7foK.js → card-page-TcYbRehu.js} +65 -65
- package/dist/{card-view-DLrRTkKE.js → card-view-CRIWNsOX.js} +1 -1
- package/dist/{edit-page-DUBOxKSi.js → edit-page-Cx50IR_w.js} +1 -1
- package/dist/{import-file-BvAgSmhY.js → import-file-CFLFN46x.js} +7 -7
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/admin.umd.cjs
CHANGED
@@ -636,9 +636,9 @@ uniform ${V} ${F} u_${G};
|
|
636
636
|
`);return{dom:g,text:C,slice:e}}function Ek(t,e,n,i,r){let a=r.parent.type.spec.code,u,l;if(!n&&!e)return null;let g=e&&(i||a||!n);if(g){if(t.someProp("transformPastedText",C=>{e=C(e,a||i,t)}),a)return e?new dt(Ve.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
637
637
|
`))),0,0):dt.empty;let E=t.someProp("clipboardTextParser",C=>C(e,r,i,t));if(E)l=E;else{let C=r.marks(),{schema:P}=t.state,D=Sl.fromSchema(P);u=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(R=>{let j=u.appendChild(document.createElement("p"));R&&j.appendChild(D.serializeNode(P.text(R,C)))})}}else t.someProp("transformPastedHTML",E=>{n=E(n,t)}),u=k5(n),Mh&&S5(u);let b=u&&u.querySelector("[data-pm-slice]"),S=b&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(b.getAttribute("data-pm-slice")||"");if(S&&S[3])for(let E=+S[3];E>0;E--){let C=u.firstChild;for(;C&&C.nodeType!=1;)C=C.nextSibling;if(!C)break;u=C}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||xh.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(g||S),context:r,ruleFromNode(C){return C.nodeName=="BR"&&!C.nextSibling&&C.parentNode&&!x5.test(C.parentNode.nodeName)?{ignore:!0}:null}})),S)l=E5(Ak(l,+S[1],+S[2]),S[4]);else if(l=dt.maxOpen(v5(l.content,r),!0),l.openStart||l.openEnd){let E=0,C=0;for(let P=l.content.firstChild;E<l.openStart&&!P.type.spec.isolating;E++,P=P.firstChild);for(let P=l.content.lastChild;C<l.openEnd&&!P.type.spec.isolating;C++,P=P.lastChild);l=Ak(l,E,C)}return t.someProp("transformPasted",E=>{l=E(l,t)}),l}const x5=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function v5(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),a,u=[];if(t.forEach(l=>{if(!u)return;let g=r.findWrapping(l.type),b;if(!g)return u=null;if(b=u.length&&a.length&&Tk(g,a,l,u[u.length-1],0))u[u.length-1]=b;else{u.length&&(u[u.length-1]=Mk(u[u.length-1],a.length));let S=Ck(l,g);u.push(S),r=r.matchType(S.type),a=g}}),u)return Ve.from(u)}return t}function Ck(t,e,n=0){for(let i=e.length-1;i>=n;i--)t=e[i].create(null,Ve.from(t));return t}function Tk(t,e,n,i,r){if(r<t.length&&r<e.length&&t[r]==e[r]){let a=Tk(t,e,n,i.lastChild,r+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(r==t.length-1?n.type:t[r+1]))return i.copy(i.content.append(Ve.from(Ck(n,t,r+1))))}}function Mk(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Mk(t.lastChild,e-1)),i=t.contentMatchAt(t.childCount).fillBefore(Ve.empty,!0);return t.copy(n.append(i))}function t0(t,e,n,i,r,a){let u=e<0?t.firstChild:t.lastChild,l=u.content;return t.childCount>1&&(a=0),r<i-1&&(l=t0(l,e,n,i,r+1,a)),r>=n&&(l=e<0?u.contentMatchAt(0).fillBefore(l,a<=r).append(l):l.append(u.contentMatchAt(u.childCount).fillBefore(Ve.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,u.copy(l))}function Ak(t,e,n){return e<t.openStart&&(t=new dt(t0(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new dt(t0(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ik={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Pk=null;function Dk(){return Pk||(Pk=document.implementation.createHTMLDocument("title"))}function w5(t){let e=window.trustedTypes;return e?e.createPolicy("detachedDocument",{createHTML:n=>n}).createHTML(t):t}function k5(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Dk().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),r;if((r=i&&Ik[i[1].toLowerCase()])&&(t=r.map(a=>"<"+a+">").join("")+t+r.map(a=>"</"+a+">").reverse().join("")),n.innerHTML=w5(t),r)for(let a=0;a<r.length;a++)n=n.querySelector(r[a])||n;return n}function S5(t){let e=t.querySelectorAll(Ji?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let i=e[n];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}function E5(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,i;try{i=JSON.parse(e)}catch{return t}let{content:r,openStart:a,openEnd:u}=t;for(let l=i.length-2;l>=0;l-=2){let g=n.nodes[i[l]];if(!g||g.hasRequiredAttrs())break;r=Ve.from(g.create(i[l+1],r)),a++,u++}return new dt(r,a,u)}const hr={},dr={},C5={touchstart:!0,touchmove:!0};class T5{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function M5(t){for(let e in hr){let n=hr[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=i=>{I5(t,i)&&!i0(t,i)&&(t.editable||!(i.type in dr))&&n(t,i)},C5[e]?{passive:!0}:void 0)}ur&&t.dom.addEventListener("input",()=>null),n0(t)}function va(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function A5(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function n0(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=i=>i0(t,i))})}function i0(t,e){return t.someProp("handleDOMEvents",n=>{let i=n[e.type];return i?i(t,e)||e.defaultPrevented:!1})}function I5(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function P5(t,e){!i0(t,e)&&hr[e.type]&&(t.editable||!(e.type in dr))&&hr[e.type](t,e)}dr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!zk(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(js&&Ji&&n.keyCode==13)))if(t.domObserver.selectionChanged(t.domSelectionRange())?t.domObserver.flush():n.keyCode!=229&&t.domObserver.forceFlush(),Lc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();t.input.lastIOSEnter=i,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==i&&(t.someProp("handleKeyDown",r=>r(t,Cl(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",i=>i(t,n))||b5(t,n)?n.preventDefault():va(t,"key")},dr.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},dr.keypress=(t,e)=>{let n=e;if(zk(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ys&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let i=t.state.selection;if(!(i instanceof Ft)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(n.charCode);!/[\r\n]/.test(r)&&!t.someProp("handleTextInput",a=>a(t,i.$from.pos,i.$to.pos,r))&&t.dispatch(t.state.tr.insertText(r).scrollIntoView()),n.preventDefault()}};function Sf(t){return{left:t.clientX,top:t.clientY}}function D5(t,e){let n=e.x-t.clientX,i=e.y-t.clientY;return n*n+i*i<100}function r0(t,e,n,i,r){if(i==-1)return!1;let a=t.state.doc.resolve(i);for(let u=a.depth+1;u>0;u--)if(t.someProp(e,l=>u>a.depth?l(t,n,a.nodeAfter,a.before(u),r,!0):l(t,n,a.node(u),a.before(u),r,!1)))return!0;return!1}function $c(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let i=t.state.tr.setSelection(e);i.setMeta("pointer",!0),t.dispatch(i)}function O5(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),i=n.nodeAfter;return i&&i.isAtom&&zt.isSelectable(i)?($c(t,new zt(n)),!0):!1}function z5(t,e){if(e==-1)return!1;let n=t.state.selection,i,r;n instanceof zt&&(i=n.node);let a=t.state.doc.resolve(e);for(let u=a.depth+1;u>0;u--){let l=u>a.depth?a.nodeAfter:a.node(u);if(zt.isSelectable(l)){i&&n.$from.depth>0&&u>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?r=a.before(n.$from.depth):r=a.before(u);break}}return r!=null?($c(t,zt.create(t.state.doc,r)),!0):!1}function N5(t,e,n,i,r){return r0(t,"handleClickOn",e,n,i)||t.someProp("handleClick",a=>a(t,e,i))||(r?z5(t,n):O5(t,n))}function B5(t,e,n,i){return r0(t,"handleDoubleClickOn",e,n,i)||t.someProp("handleDoubleClick",r=>r(t,e,i))}function R5(t,e,n,i){return r0(t,"handleTripleClickOn",e,n,i)||t.someProp("handleTripleClick",r=>r(t,e,i))||L5(t,n,i)}function L5(t,e,n){if(n.button!=0)return!1;let i=t.state.doc;if(e==-1)return i.inlineContent?($c(t,Ft.create(i,0,i.content.size)),!0):!1;let r=i.resolve(e);for(let a=r.depth+1;a>0;a--){let u=a>r.depth?r.nodeAfter:r.node(a),l=r.before(a);if(u.inlineContent)$c(t,Ft.create(i,l+1,l+1+u.content.size));else if(zt.isSelectable(u))$c(t,zt.create(i,l));else continue;return!0}}function s0(t){return Ef(t)}const Ok=ys?"metaKey":"ctrlKey";hr.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let i=s0(t),r=Date.now(),a="singleClick";r-t.input.lastClick.time<500&&D5(n,t.input.lastClick)&&!n[Ok]&&(t.input.lastClick.type=="singleClick"?a="doubleClick":t.input.lastClick.type=="doubleClick"&&(a="tripleClick")),t.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a};let u=t.posAtCoords(Sf(n));u&&(a=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new V5(t,u,n,!!i)):(a=="doubleClick"?B5:R5)(t,u.pos,u.inside,n)?n.preventDefault():va(t,"pointer"))};class V5{constructor(e,n,i,r){this.view=e,this.pos=n,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!i[Ok],this.allowDefault=i.shiftKey;let a,u;if(n.inside>-1)a=e.state.doc.nodeAt(n.inside),u=n.inside;else{let S=e.state.doc.resolve(n.pos);a=S.parent,u=S.depth?S.before():0}const l=r?null:i.target,g=l?e.docView.nearestDesc(l,!0):null;this.target=g&&g.dom.nodeType==1?g.dom:null;let{selection:b}=e.state;(i.button==0&&a.type.spec.draggable&&a.type.spec.selectable!==!1||b instanceof zt&&b.from<=u&&b.to>u)&&(this.mightDrag={node:a,pos:u,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$s&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),va(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Bo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Sf(e))),this.updateAllowDefault(e),this.allowDefault||!n?va(this.view,"pointer"):N5(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ur&&this.mightDrag&&!this.mightDrag.node.isAtom||Ji&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?($c(this.view,Gt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):va(this.view,"pointer")}move(e){this.updateAllowDefault(e),va(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}hr.touchstart=t=>{t.input.lastTouch=Date.now(),s0(t),va(t,"pointer")},hr.touchmove=t=>{t.input.lastTouch=Date.now(),va(t,"pointer")},hr.contextmenu=t=>s0(t);function zk(t,e){return t.composing?!0:ur&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const F5=js?5e3:-1;dr.compositionstart=dr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ft&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ef(t,!0),t.markCursor=null;else if(Ef(t,!e.selection.empty),$s&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=t.domSelectionRange();for(let r=i.focusNode,a=i.focusOffset;r&&r.nodeType==1&&a!=0;){let u=a<0?r.lastChild:r.childNodes[a-1];if(!u)break;if(u.nodeType==3){let l=t.domSelection();l&&l.collapse(u,u.nodeValue.length);break}else r=u,a=-1}}t.input.composing=!0}Nk(t,F5)},dr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Nk(t,20))};function Nk(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ef(t),e))}function Bk(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=j5());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function $5(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=OR(e.focusNode,e.focusOffset),i=zR(e.focusNode,e.focusOffset);if(n&&i&&n!=i){let r=i.pmViewDesc,a=t.domObserver.lastChangedTextNode;if(n==a||i==a)return a;if(!r||!r.isText(i.nodeValue))return i;if(t.input.compositionNode==i){let u=n.pmViewDesc;if(!(!u||!u.isText(n.nodeValue)))return i}}return n||i}function j5(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ef(t,e=!1){if(!(js&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Bk(t),e||t.docView&&t.docView.dirty){let n=Xy(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function U5(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(e),t.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Oh=Ar&&ya<15||Lc&&VR<604;hr.copy=dr.cut=(t,e)=>{let n=e,i=t.state.selection,r=n.type=="cut";if(i.empty)return;let a=Oh?null:n.clipboardData,u=i.content(),{dom:l,text:g}=Sk(t,u);a?(n.preventDefault(),a.clearData(),a.setData("text/html",l.innerHTML),a.setData("text/plain",g)):U5(t,l),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function H5(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function q5(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),n?zh(t,i.value,null,r,e):zh(t,i.textContent,i.innerHTML,r,e)},50)}function zh(t,e,n,i,r){let a=Ek(t,e,n,i,t.state.selection.$from);if(t.someProp("handlePaste",g=>g(t,r,a||dt.empty)))return!0;if(!a)return!1;let u=H5(a),l=u?t.state.tr.replaceSelectionWith(u,i):t.state.tr.replaceSelection(a);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Rk(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}dr.paste=(t,e)=>{let n=e;if(t.composing&&!js)return;let i=Oh?null:n.clipboardData,r=t.input.shiftKey&&t.input.lastKeyCode!=45;i&&zh(t,Rk(i),i.getData("text/html"),r,n)?n.preventDefault():q5(t,n)};class Lk{constructor(e,n,i){this.slice=e,this.move=n,this.node=i}}const Vk=ys?"altKey":"ctrlKey";hr.dragstart=(t,e)=>{let n=e,i=t.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=t.state.selection,a=r.empty?null:t.posAtCoords(Sf(n)),u;if(!(a&&a.pos>=r.from&&a.pos<=(r instanceof zt?r.to-1:r.to))){if(i&&i.mightDrag)u=zt.create(t.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let E=t.docView.nearestDesc(n.target,!0);E&&E.node.type.spec.draggable&&E!=t.docView&&(u=zt.create(t.state.doc,E.posBefore))}}let l=(u||t.state.selection).content(),{dom:g,text:b,slice:S}=Sk(t,l);(!n.dataTransfer.files.length||!Ji||Hw>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Oh?"Text":"text/html",g.innerHTML),n.dataTransfer.effectAllowed="copyMove",Oh||n.dataTransfer.setData("text/plain",b),t.dragging=new Lk(S,!n[Vk],u)},hr.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},dr.dragover=dr.dragenter=(t,e)=>e.preventDefault(),dr.drop=(t,e)=>{let n=e,i=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let r=t.posAtCoords(Sf(n));if(!r)return;let a=t.state.doc.resolve(r.pos),u=i&&i.slice;u?t.someProp("transformPasted",D=>{u=D(u,t)}):u=Ek(t,Rk(n.dataTransfer),Oh?null:n.dataTransfer.getData("text/html"),!1,a);let l=!!(i&&!n[Vk]);if(t.someProp("handleDrop",D=>D(t,n,u||dt.empty,l))){n.preventDefault();return}if(!u)return;n.preventDefault();let g=u?Mw(t.state.doc,a.pos,u):a.pos;g==null&&(g=a.pos);let b=t.state.tr;if(l){let{node:D}=i;D?D.replace(b):b.deleteSelection()}let S=b.mapping.map(g),E=u.openStart==0&&u.openEnd==0&&u.content.childCount==1,C=b.doc;if(E?b.replaceRangeWith(S,S,u.content.firstChild):b.replaceRange(S,S,u),b.doc.eq(C))return;let P=b.doc.resolve(S);if(E&&zt.isSelectable(u.content.firstChild)&&P.nodeAfter&&P.nodeAfter.sameMarkup(u.content.firstChild))b.setSelection(new zt(P));else{let D=b.mapping.map(g);b.mapping.maps[b.mapping.maps.length-1].forEach((R,j,W,ee)=>D=ee),b.setSelection(Jy(t,P,b.doc.resolve(D)))}t.focus(),t.dispatch(b.setMeta("uiEvent","drop"))},hr.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Bo(t)},20))},hr.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},hr.beforeinput=(t,e)=>{if(Ji&&js&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:i}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=i||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",a=>a(t,Cl(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in dr)hr[t]=dr[t];function Nh(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Cf{constructor(e,n){this.toDOM=e,this.spec=n||Il,this.side=this.spec.side||0}map(e,n,i,r){let{pos:a,deleted:u}=e.mapResult(n.from+r,this.side<0?-1:1);return u?null:new Gr(a-i,a-i,this)}valid(){return!0}eq(e){return this==e||e instanceof Cf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Nh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class wa{constructor(e,n){this.attrs=e,this.spec=n||Il}map(e,n,i,r){let a=e.map(n.from+r,this.spec.inclusiveStart?-1:1)-i,u=e.map(n.to+r,this.spec.inclusiveEnd?1:-1)-i;return a>=u?null:new Gr(a,u,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof wa&&Nh(this.attrs,e.attrs)&&Nh(this.spec,e.spec)}static is(e){return e.type instanceof wa}destroy(){}}class o0{constructor(e,n){this.attrs=e,this.spec=n||Il}map(e,n,i,r){let a=e.mapResult(n.from+r,1);if(a.deleted)return null;let u=e.mapResult(n.to+r,-1);return u.deleted||u.pos<=a.pos?null:new Gr(a.pos-i,u.pos-i,this)}valid(e,n){let{index:i,offset:r}=e.content.findIndex(n.from),a;return r==n.from&&!(a=e.child(i)).isText&&r+a.nodeSize==n.to}eq(e){return this==e||e instanceof o0&&Nh(this.attrs,e.attrs)&&Nh(this.spec,e.spec)}destroy(){}}class Gr{constructor(e,n,i){this.from=e,this.to=n,this.type=i}copy(e,n){return new Gr(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,i){return this.type.map(e,this,n,i)}static widget(e,n,i){return new Gr(e,e,new Cf(n,i))}static inline(e,n,i,r){return new Gr(e,n,new wa(i,r))}static node(e,n,i,r){return new Gr(e,n,new o0(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof wa}get widget(){return this.type instanceof Cf}}const jc=[],Il={};class pi{constructor(e,n){this.local=e.length?e:jc,this.children=n.length?n:jc}static create(e,n){return n.length?Tf(n,e,0,Il):Qi}find(e,n,i){let r=[];return this.findInner(e??0,n??1e9,r,0,i),r}findInner(e,n,i,r,a){for(let u=0;u<this.local.length;u++){let l=this.local[u];l.from<=n&&l.to>=e&&(!a||a(l.spec))&&i.push(l.copy(l.from+r,l.to+r))}for(let u=0;u<this.children.length;u+=3)if(this.children[u]<n&&this.children[u+1]>e){let l=this.children[u]+1;this.children[u+2].findInner(e-l,n-l,i,r+l,a)}}map(e,n,i){return this==Qi||e.maps.length==0?this:this.mapInner(e,n,0,0,i||Il)}mapInner(e,n,i,r,a){let u;for(let l=0;l<this.local.length;l++){let g=this.local[l].map(e,i,r);g&&g.type.valid(n,g)?(u||(u=[])).push(g):a.onRemove&&a.onRemove(this.local[l].spec)}return this.children.length?W5(this.children,u||[],e,n,i,r,a):u?new pi(u.sort(Pl),jc):Qi}add(e,n){return n.length?this==Qi?pi.create(e,n):this.addInner(e,n,0):this}addInner(e,n,i){let r,a=0;e.forEach((l,g)=>{let b=g+i,S;if(S=$k(n,l,b)){for(r||(r=this.children.slice());a<r.length&&r[a]<g;)a+=3;r[a]==g?r[a+2]=r[a+2].addInner(l,S,b+1):r.splice(a,0,g,g+l.nodeSize,Tf(S,l,b+1,Il)),a+=3}});let u=Fk(a?jk(n):n,-i);for(let l=0;l<u.length;l++)u[l].type.valid(e,u[l])||u.splice(l--,1);return new pi(u.length?this.local.concat(u).sort(Pl):this.local,r||this.children)}remove(e){return e.length==0||this==Qi?this:this.removeInner(e,0)}removeInner(e,n){let i=this.children,r=this.local;for(let a=0;a<i.length;a+=3){let u,l=i[a]+n,g=i[a+1]+n;for(let S=0,E;S<e.length;S++)(E=e[S])&&E.from>l&&E.to<g&&(e[S]=null,(u||(u=[])).push(E));if(!u)continue;i==this.children&&(i=this.children.slice());let b=i[a+2].removeInner(u,l+1);b!=Qi?i[a+2]=b:(i.splice(a,3),a-=3)}if(r.length){for(let a=0,u;a<e.length;a++)if(u=e[a])for(let l=0;l<r.length;l++)r[l].eq(u,n)&&(r==this.local&&(r=this.local.slice()),r.splice(l--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new pi(r,i):Qi}forChild(e,n){if(this==Qi)return this;if(n.isLeaf)return pi.empty;let i,r;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(i=this.children[l+2]);break}let a=e+1,u=a+n.content.size;for(let l=0;l<this.local.length;l++){let g=this.local[l];if(g.from<u&&g.to>a&&g.type instanceof wa){let b=Math.max(a,g.from)-a,S=Math.min(u,g.to)-a;b<S&&(r||(r=[])).push(g.copy(b,S))}}if(r){let l=new pi(r.sort(Pl),jc);return i?new ka([l,i]):l}return i||Qi}eq(e){if(this==e)return!0;if(!(e instanceof pi)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return a0(this.localsInner(e))}localsInner(e){if(this==Qi)return jc;if(e.inlineContent||!this.local.some(wa.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof wa||n.push(this.local[i]);return n}forEachSet(e){e(this)}}pi.empty=new pi([],[]),pi.removeOverlap=a0;const Qi=pi.empty;class ka{constructor(e){this.members=e}map(e,n){const i=this.members.map(r=>r.map(e,n,Il));return ka.from(i)}forChild(e,n){if(n.isLeaf)return pi.empty;let i=[];for(let r=0;r<this.members.length;r++){let a=this.members[r].forChild(e,n);a!=Qi&&(a instanceof ka?i=i.concat(a.members):i.push(a))}return ka.from(i)}eq(e){if(!(e instanceof ka)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,i=!0;for(let r=0;r<this.members.length;r++){let a=this.members[r].localsInner(e);if(a.length)if(!n)n=a;else{i&&(n=n.slice(),i=!1);for(let u=0;u<a.length;u++)n.push(a[u])}}return n?a0(i?n:n.sort(Pl)):jc}static from(e){switch(e.length){case 0:return Qi;case 1:return e[0];default:return new ka(e.every(n=>n instanceof pi)?e:e.reduce((n,i)=>n.concat(i instanceof pi?i:i.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function W5(t,e,n,i,r,a,u){let l=t.slice();for(let b=0,S=a;b<n.maps.length;b++){let E=0;n.maps[b].forEach((C,P,D,R)=>{let j=R-D-(P-C);for(let W=0;W<l.length;W+=3){let ee=l[W+1];if(ee<0||C>ee+S-E)continue;let le=l[W]+S-E;P>=le?l[W+1]=C<=le?-2:-1:C>=S&&j&&(l[W]+=j,l[W+1]+=j)}E+=j}),S=n.maps[b].map(S,-1)}let g=!1;for(let b=0;b<l.length;b+=3)if(l[b+1]<0){if(l[b+1]==-2){g=!0,l[b+1]=-1;continue}let S=n.map(t[b]+a),E=S-r;if(E<0||E>=i.content.size){g=!0;continue}let C=n.map(t[b+1]+a,-1),P=C-r,{index:D,offset:R}=i.content.findIndex(E),j=i.maybeChild(D);if(j&&R==E&&R+j.nodeSize==P){let W=l[b+2].mapInner(n,j,S+1,t[b]+a+1,u);W!=Qi?(l[b]=E,l[b+1]=P,l[b+2]=W):(l[b+1]=-2,g=!0)}else g=!0}if(g){let b=G5(l,t,e,n,r,a,u),S=Tf(b,i,0,u);e=S.local;for(let E=0;E<l.length;E+=3)l[E+1]<0&&(l.splice(E,3),E-=3);for(let E=0,C=0;E<S.children.length;E+=3){let P=S.children[E];for(;C<l.length&&l[C]<P;)C+=3;l.splice(C,0,S.children[E],S.children[E+1],S.children[E+2])}}return new pi(e.sort(Pl),l)}function Fk(t,e){if(!e||!t.length)return t;let n=[];for(let i=0;i<t.length;i++){let r=t[i];n.push(new Gr(r.from+e,r.to+e,r.type))}return n}function G5(t,e,n,i,r,a,u){function l(g,b){for(let S=0;S<g.local.length;S++){let E=g.local[S].map(i,r,b);E?n.push(E):u.onRemove&&u.onRemove(g.local[S].spec)}for(let S=0;S<g.children.length;S+=3)l(g.children[S+2],g.children[S]+b+1)}for(let g=0;g<t.length;g+=3)t[g+1]==-1&&l(t[g+2],e[g]+a+1);return n}function $k(t,e,n){if(e.isLeaf)return null;let i=n+e.nodeSize,r=null;for(let a=0,u;a<t.length;a++)(u=t[a])&&u.from>n&&u.to<i&&((r||(r=[])).push(u),t[a]=null);return r}function jk(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Tf(t,e,n,i){let r=[],a=!1;e.forEach((l,g)=>{let b=$k(t,l,g+n);if(b){a=!0;let S=Tf(b,l,n+g+1,i);S!=Qi&&r.push(g,g+l.nodeSize,S)}});let u=Fk(a?jk(t):t,-n).sort(Pl);for(let l=0;l<u.length;l++)u[l].type.valid(e,u[l])||(i.onRemove&&i.onRemove(u[l].spec),u.splice(l--,1));return u.length||r.length?new pi(u,r):Qi}function Pl(t,e){return t.from-e.from||t.to-e.to}function a0(t){let e=t;for(let n=0;n<e.length-1;n++){let i=e[n];if(i.from!=i.to)for(let r=n+1;r<e.length;r++){let a=e[r];if(a.from==i.from){a.to!=i.to&&(e==t&&(e=t.slice()),e[r]=a.copy(a.from,i.to),Uk(e,r+1,a.copy(i.to,a.to)));continue}else{a.from<i.to&&(e==t&&(e=t.slice()),e[n]=i.copy(i.from,a.from),Uk(e,r,i.copy(a.from,i.to)));break}}}return e}function Uk(t,e,n){for(;e<t.length&&Pl(n,t[e])>0;)e++;t.splice(e,0,n)}function l0(t){let e=[];return t.someProp("decorations",n=>{let i=n(t.state);i&&i!=Qi&&e.push(i)}),t.cursorWrapper&&e.push(pi.create(t.state.doc,[t.cursorWrapper.deco])),ka.from(e)}const Z5={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Y5=Ar&&ya<=11;class X5{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class K5{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new X5,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let r=0;r<i.length;r++)this.queue.push(i[r]);Ar&&ya<=11&&i.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),Y5&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Z5)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(gk(this.view)){if(this.suppressingSelectionUpdates)return Bo(this.view);if(Ar&&ya<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&El(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,i;for(let a=e.focusNode;a;a=Ch(a))n.add(a);for(let a=e.anchorNode;a;a=Ch(a))if(n.has(a)){i=a;break}let r=i&&this.view.docView.nearestDesc(i);if(r&&r.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}selectionChanged(e){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&gk(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let i=e.domSelectionRange(),r=this.selectionChanged(i),a=-1,u=-1,l=!1,g=[];if(e.editable)for(let S=0;S<n.length;S++){let E=this.registerMutation(n[S],g);E&&(a=a<0?E.from:Math.min(E.from,a),u=u<0?E.to:Math.max(E.to,u),E.typeOver&&(l=!0))}if($s&&g.length){let S=g.filter(E=>E.nodeName=="BR");if(S.length==2){let[E,C]=S;E.parentNode&&E.parentNode.parentNode==C.parentNode?C.remove():E.remove()}else{let{focusNode:E}=this.currentSelection;for(let C of S){let P=C.parentNode;P&&P.nodeName=="LI"&&(!E||eL(e,E)!=P)&&C.remove()}}}let b=null;a<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&xf(i)&&(b=Xy(e))&&b.eq(Gt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Bo(e),this.currentSelection.set(i),e.scrollToSelection()):(a>-1||r)&&(a>-1&&(e.docView.markDirty(a,u),J5(e)),this.handleDOMChange(a,u,l,g),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(i)||Bo(e),this.currentSelection.set(i))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let i=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(i==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!i||i.ignoreMutation(e))return null;if(e.type=="childList"){for(let S=0;S<e.addedNodes.length;S++){let E=e.addedNodes[S];n.push(E),E.nodeType==3&&(this.lastChangedTextNode=E)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(e.target))return{from:i.posBefore,to:i.posAfter};let r=e.previousSibling,a=e.nextSibling;if(Ar&&ya<=11&&e.addedNodes.length)for(let S=0;S<e.addedNodes.length;S++){let{previousSibling:E,nextSibling:C}=e.addedNodes[S];(!E||Array.prototype.indexOf.call(e.addedNodes,E)<0)&&(r=E),(!C||Array.prototype.indexOf.call(e.addedNodes,C)<0)&&(a=C)}let u=r&&r.parentNode==e.target?$i(r)+1:0,l=i.localPosFromDOM(e.target,u,-1),g=a&&a.parentNode==e.target?$i(a):e.target.childNodes.length,b=i.localPosFromDOM(e.target,g,1);return{from:l,to:b}}else return e.type=="attributes"?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=e.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Hk=new WeakMap,qk=!1;function J5(t){if(!Hk.has(t)&&(Hk.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=$s,qk)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),qk=!0}}function Wk(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,a=e.endOffset,u=t.domAtPos(t.state.selection.anchor);return El(u.node,u.offset,r,a)&&([n,i,r,a]=[r,a,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:a}}function Q5(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return Wk(t,r)}let n;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",i,!0),n?Wk(t,n):null}function eL(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let i=t.docView.nearestDesc(n,!0);if(i&&i.node.isBlock)return n}return null}function tL(t,e,n){let{node:i,fromOffset:r,toOffset:a,from:u,to:l}=t.docView.parseRange(e,n),g=t.domSelectionRange(),b,S=g.anchorNode;if(S&&t.dom.contains(S.nodeType==1?S:S.parentNode)&&(b=[{node:S,offset:g.anchorOffset}],xf(g)||b.push({node:g.focusNode,offset:g.focusOffset})),Ji&&t.input.lastKeyCode===8)for(let j=a;j>r;j--){let W=i.childNodes[j-1],ee=W.pmViewDesc;if(W.nodeName=="BR"&&!ee){a=j;break}if(!ee||ee.size)break}let E=t.state.doc,C=t.someProp("domParser")||xh.fromSchema(t.state.schema),P=E.resolve(u),D=null,R=C.parse(i,{topNode:P.parent,topMatch:P.parent.contentMatchAt(P.index()),topOpen:!0,from:r,to:a,preserveWhitespace:P.parent.type.whitespace=="pre"?"full":!0,findPositions:b,ruleFromNode:nL,context:P});if(b&&b[0].pos!=null){let j=b[0].pos,W=b[1]&&b[1].pos;W==null&&(W=j),D={anchor:j+u,head:W+u}}return{doc:R,sel:D,from:u,to:l}}function nL(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ur&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||ur&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const iL=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function rL(t,e,n,i,r){let a=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let Pe=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Xe=Xy(t,Pe);if(Xe&&!t.state.selection.eq(Xe)){if(Ji&&js&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Rt=>Rt(t,Cl(13,"Enter"))))return;let rt=t.state.tr.setSelection(Xe);Pe=="pointer"?rt.setMeta("pointer",!0):Pe=="key"&&rt.scrollIntoView(),a&&rt.setMeta("composition",a),t.dispatch(rt)}return}let u=t.state.doc.resolve(e),l=u.sharedDepth(n);e=u.before(l+1),n=t.state.doc.resolve(n).after(l+1);let g=t.state.selection,b=tL(t,e,n),S=t.state.doc,E=S.slice(b.from,b.to),C,P;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(C=t.state.selection.to,P="end"):(C=t.state.selection.from,P="start"),t.input.lastKeyCode=null;let D=aL(E.content,b.doc.content,b.from,C,P);if(D&&t.input.domChangeCount++,(Lc&&t.input.lastIOSEnter>Date.now()-225||js)&&r.some(Pe=>Pe.nodeType==1&&!iL.test(Pe.nodeName))&&(!D||D.endA>=D.endB)&&t.someProp("handleKeyDown",Pe=>Pe(t,Cl(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!D)if(i&&g instanceof Ft&&!g.empty&&g.$head.sameParent(g.$anchor)&&!t.composing&&!(b.sel&&b.sel.anchor!=b.sel.head))D={start:g.from,endA:g.to,endB:g.to};else{if(b.sel){let Pe=Gk(t,t.state.doc,b.sel);if(Pe&&!Pe.eq(t.state.selection)){let Xe=t.state.tr.setSelection(Pe);a&&Xe.setMeta("composition",a),t.dispatch(Xe)}}return}t.state.selection.from<t.state.selection.to&&D.start==D.endB&&t.state.selection instanceof Ft&&(D.start>t.state.selection.from&&D.start<=t.state.selection.from+2&&t.state.selection.from>=b.from?D.start=t.state.selection.from:D.endA<t.state.selection.to&&D.endA>=t.state.selection.to-2&&t.state.selection.to<=b.to&&(D.endB+=t.state.selection.to-D.endA,D.endA=t.state.selection.to)),Ar&&ya<=11&&D.endB==D.start+1&&D.endA==D.start&&D.start>b.from&&b.doc.textBetween(D.start-b.from-1,D.start-b.from+1)==" "&&(D.start--,D.endA--,D.endB--);let R=b.doc.resolveNoCache(D.start-b.from),j=b.doc.resolveNoCache(D.endB-b.from),W=S.resolve(D.start),ee=R.sameParent(j)&&R.parent.inlineContent&&W.end()>=D.endA,le;if((Lc&&t.input.lastIOSEnter>Date.now()-225&&(!ee||r.some(Pe=>Pe.nodeName=="DIV"||Pe.nodeName=="P"))||!ee&&R.pos<b.doc.content.size&&!R.sameParent(j)&&(le=Gt.findFrom(b.doc.resolve(R.pos+1),1,!0))&&le.head==j.pos)&&t.someProp("handleKeyDown",Pe=>Pe(t,Cl(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>D.start&&oL(S,D.start,D.endA,R,j)&&t.someProp("handleKeyDown",Pe=>Pe(t,Cl(8,"Backspace")))){js&&Ji&&t.domObserver.suppressSelectionUpdates();return}Ji&&js&&D.endB==D.start&&(t.input.lastAndroidDelete=Date.now()),js&&!ee&&R.start()!=j.start()&&j.parentOffset==0&&R.depth==j.depth&&b.sel&&b.sel.anchor==b.sel.head&&b.sel.head==D.endA&&(D.endB-=2,j=b.doc.resolveNoCache(D.endB-b.from),setTimeout(()=>{t.someProp("handleKeyDown",function(Pe){return Pe(t,Cl(13,"Enter"))})},20));let J=D.start,Te=D.endA,xe,Ae,$e;if(ee){if(R.pos==j.pos)Ar&&ya<=11&&R.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Bo(t),20)),xe=t.state.tr.delete(J,Te),Ae=S.resolve(D.start).marksAcross(S.resolve(D.endA));else if(D.endA==D.endB&&($e=sL(R.parent.content.cut(R.parentOffset,j.parentOffset),W.parent.content.cut(W.parentOffset,D.endA-W.start()))))xe=t.state.tr,$e.type=="add"?xe.addMark(J,Te,$e.mark):xe.removeMark(J,Te,$e.mark);else if(R.parent.child(R.index()).isText&&R.index()==j.index()-(j.textOffset?0:1)){let Pe=R.parent.textBetween(R.parentOffset,j.parentOffset);if(t.someProp("handleTextInput",Xe=>Xe(t,J,Te,Pe)))return;xe=t.state.tr.insertText(Pe,J,Te)}}if(xe||(xe=t.state.tr.replace(J,Te,b.doc.slice(D.start-b.from,D.endB-b.from))),b.sel){let Pe=Gk(t,xe.doc,b.sel);Pe&&!(Ji&&js&&t.composing&&Pe.empty&&(D.start!=D.endB||t.input.lastAndroidDelete<Date.now()-100)&&(Pe.head==J||Pe.head==xe.mapping.map(Te)-1)||Ar&&Pe.empty&&Pe.head==J)&&xe.setSelection(Pe)}Ae&&xe.ensureMarks(Ae),a&&xe.setMeta("composition",a),t.dispatch(xe.scrollIntoView())}function Gk(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Jy(t,e.resolve(n.anchor),e.resolve(n.head))}function sL(t,e){let n=t.firstChild.marks,i=e.firstChild.marks,r=n,a=i,u,l,g;for(let S=0;S<i.length;S++)r=i[S].removeFromSet(r);for(let S=0;S<n.length;S++)a=n[S].removeFromSet(a);if(r.length==1&&a.length==0)l=r[0],u="add",g=S=>S.mark(l.addToSet(S.marks));else if(r.length==0&&a.length==1)l=a[0],u="remove",g=S=>S.mark(l.removeFromSet(S.marks));else return null;let b=[];for(let S=0;S<e.childCount;S++)b.push(g(e.child(S)));if(Ve.from(b).eq(t))return{mark:l,type:u}}function oL(t,e,n,i,r){if(n-e<=r.pos-i.pos||c0(i,!0,!1)<r.pos)return!1;let a=t.resolve(e);if(!i.parent.isTextblock){let l=a.nodeAfter;return l!=null&&n==e+l.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let u=t.resolve(c0(a,!0,!0));return!u.parent.isTextblock||u.pos>n||c0(u,!0,!1)<n?!1:i.parent.content.cut(i.parentOffset).eq(u.parent.content)}function c0(t,e,n){let i=t.depth,r=e?t.end():t.pos;for(;i>0&&(e||t.indexAfter(i)==t.node(i).childCount);)i--,r++,e=!1;if(n){let a=t.node(i).maybeChild(t.indexAfter(i));for(;a&&!a.isLeaf;)a=a.firstChild,r++}return r}function aL(t,e,n,i,r){let a=t.findDiffStart(e,n);if(a==null)return null;let{a:u,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(r=="end"){let g=Math.max(0,a-Math.min(u,l));i-=u+g-a}if(u<a&&t.size<e.size){let g=i<=a&&i>=u?a-i:0;a-=g,a&&a<e.size&&Zk(e.textBetween(a-1,a+1))&&(a+=g?1:-1),l=a+(l-u),u=a}else if(l<a){let g=i<=a&&i>=l?a-i:0;a-=g,a&&a<t.size&&Zk(t.textBetween(a-1,a+1))&&(a+=g?1:-1),u=a+(u-l),l=a}return{start:a,endA:u,endB:l}}function Zk(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class lL{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new T5,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Qk),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Kk(this),Xk(this),this.nodeViews=Jk(this),this.docView=rk(this.state.doc,Yk(this),l0(this),this.dom,this),this.domObserver=new K5(this,(i,r,a,u)=>rL(this,i,r,a,u)),this.domObserver.start(),M5(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&n0(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Qk),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let i in this._props)n[i]=this._props[i];n.state=this.state;for(let i in e)n[i]=e[i];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var i;let r=this.state,a=!1,u=!1;e.storedMarks&&this.composing&&(Bk(this),u=!0),this.state=e;let l=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let P=Jk(this);uL(P,this.nodeViews)&&(this.nodeViews=P,a=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&n0(this),this.editable=Kk(this),Xk(this);let g=l0(this),b=Yk(this),S=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",E=a||!this.docView.matchesNode(e.doc,b,g);(E||!e.selection.eq(r.selection))&&(u=!0);let C=S=="preserve"&&u&&this.dom.style.overflowAnchor==null&&jR(this);if(u){this.domObserver.stop();let P=E&&(Ar||Ji)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&cL(r.selection,e.selection);if(E){let D=Ji?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=$5(this)),(a||!this.docView.update(e.doc,b,g,this))&&(this.docView.updateOuterDeco(b),this.docView.destroy(),this.docView=rk(e.doc,b,g,this.dom,this)),D&&!this.trackWrites&&(P=!0)}P||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&d5(this))?Bo(this,P):(fk(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((i=this.dragging)===null||i===void 0)&&i.node&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),S=="reset"?this.dom.scrollTop=0:S=="to selection"?this.scrollToSelection():C&&UR(C)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof zt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&qw(this,n.getBoundingClientRect(),e)}else qw(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let i=this.state.plugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let i=this.pluginViews[n];i.update&&i.update(this,e)}}updateDraggedNode(e,n){let i=e.node,r=-1;if(this.state.doc.nodeAt(i.from)==i.node)r=i.from;else{let a=i.from+(this.state.doc.content.size-n.doc.content.size);(a>0&&this.state.doc.nodeAt(a))==i.node&&(r=a)}this.dragging=new Lk(e.slice,e.move,r<0?void 0:zt.create(this.state.doc,r))}someProp(e,n){let i=this._props&&this._props[e],r;if(i!=null&&(r=n?n(i):i))return r;for(let u=0;u<this.directPlugins.length;u++){let l=this.directPlugins[u].props[e];if(l!=null&&(r=n?n(l):l))return r}let a=this.state.plugins;if(a)for(let u=0;u<a.length;u++){let l=a[u].props[e];if(l!=null&&(r=n?n(l):l))return r}}hasFocus(){if(Ar){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&HR(this.dom),Bo(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return YR(this,e)}coordsAtPos(e,n=1){return Kw(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,i=-1){let r=this.docView.posFromDOM(e,n,i);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,n){return e5(this,n||this.state,e)}pasteHTML(e,n){return zh(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return zh(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(A5(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],l0(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,PR())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return P5(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?ur&&this.root.nodeType===11&&BR(this.dom.ownerDocument)==this.dom&&Q5(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Yk(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let i in n)i=="class"?e.class+=" "+n[i]:i=="style"?e.style=(e.style?e.style+";":"")+n[i]:!e[i]&&i!="contenteditable"&&i!="nodeName"&&(e[i]=String(n[i]))}),e.translate||(e.translate="no"),[Gr.node(0,t.state.doc.content.size,e)]}function Xk(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Gr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Kk(t){return!t.someProp("editable",e=>e(t.state)===!1)}function cL(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Jk(t){let e=Object.create(null);function n(i){for(let r in i)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=i[r])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function uL(t,e){let n=0,i=0;for(let r in t){if(t[r]!=e[r])return!0;n++}for(let r in e)i++;return n!=i}function Qk(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Sa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Mf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},hL=typeof navigator<"u"&&/Mac/.test(navigator.platform),dL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ji=0;ji<10;ji++)Sa[48+ji]=Sa[96+ji]=String(ji);for(var ji=1;ji<=24;ji++)Sa[ji+111]="F"+ji;for(var ji=65;ji<=90;ji++)Sa[ji]=String.fromCharCode(ji+32),Mf[ji]=String.fromCharCode(ji);for(var u0 in Sa)Mf.hasOwnProperty(u0)||(Mf[u0]=Sa[u0]);function pL(t){var e=hL&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||dL&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Mf:Sa)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const fL=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function mL(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let i,r,a,u;for(let l=0;l<e.length-1;l++){let g=e[l];if(/^(cmd|meta|m)$/i.test(g))u=!0;else if(/^a(lt)?$/i.test(g))i=!0;else if(/^(c|ctrl|control)$/i.test(g))r=!0;else if(/^s(hift)?$/i.test(g))a=!0;else if(/^mod$/i.test(g))fL?u=!0:r=!0;else throw new Error("Unrecognized modifier name: "+g)}return i&&(n="Alt-"+n),r&&(n="Ctrl-"+n),u&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function gL(t){let e=Object.create(null);for(let n in t)e[mL(n)]=t[n];return e}function h0(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function yL(t){return new Fi({props:{handleKeyDown:e2(t)}})}function e2(t){let e=gL(t);return function(n,i){let r=pL(i),a,u=e[h0(r,i)];if(u&&u(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let l=e[h0(r,i,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((i.shiftKey||i.altKey||i.metaKey||r.charCodeAt(0)>127)&&(a=Sa[i.keyCode])&&a!=r){let l=e[h0(a,i)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const _L=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function t2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const bL=(t,e,n)=>{let i=t2(t,n);if(!i)return!1;let r=d0(i);if(!r){let u=i.blockRange(),l=u&&Dc(u);return l==null?!1:(e&&e(t.tr.lift(u,l).scrollIntoView()),!0)}let a=r.nodeBefore;if(s2(t,r,e,-1))return!0;if(i.parent.content.size==0&&(Uc(a,"end")||zt.isSelectable(a)))for(let u=i.depth;;u--){let l=yf(t.doc,i.before(u),i.after(u),dt.empty);if(l&&l.slice.size<l.to-l.from){if(e){let g=t.tr.step(l);g.setSelection(Uc(a,"end")?Gt.findFrom(g.doc.resolve(g.mapping.map(r.pos,-1)),-1):zt.create(g.doc,r.pos-a.nodeSize)),e(g.scrollIntoView())}return!0}if(u==1||i.node(u-1).childCount>1)break}return a.isAtom&&r.depth==i.depth-1?(e&&e(t.tr.delete(r.pos-a.nodeSize,r.pos).scrollIntoView()),!0):!1},xL=(t,e,n)=>{let i=t2(t,n);if(!i)return!1;let r=d0(i);return r?n2(t,r,e):!1},vL=(t,e,n)=>{let i=i2(t,n);if(!i)return!1;let r=p0(i);return r?n2(t,r,e):!1};function n2(t,e,n){let i=e.nodeBefore,r=i,a=e.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let S=r.lastChild;if(!S)return!1;r=S}let u=e.nodeAfter,l=u,g=e.pos+1;for(;!l.isTextblock;g++){if(l.type.spec.isolating)return!1;let S=l.firstChild;if(!S)return!1;l=S}let b=yf(t.doc,a,g,dt.empty);if(!b||b.from!=a||b instanceof Ci&&b.slice.size>=g-a)return!1;if(n){let S=t.tr.step(b);S.setSelection(Ft.create(S.doc,a)),n(S.scrollIntoView())}return!0}function Uc(t,e,n=!1){for(let i=t;i;i=e=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const wL=(t,e,n)=>{let{$head:i,empty:r}=t.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;a=d0(i)}let u=a&&a.nodeBefore;return!u||!zt.isSelectable(u)?!1:(e&&e(t.tr.setSelection(zt.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function d0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function i2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const kL=(t,e,n)=>{let i=i2(t,n);if(!i)return!1;let r=p0(i);if(!r)return!1;let a=r.nodeAfter;if(s2(t,r,e,1))return!0;if(i.parent.content.size==0&&(Uc(a,"start")||zt.isSelectable(a))){let u=yf(t.doc,i.before(),i.after(),dt.empty);if(u&&u.slice.size<u.to-u.from){if(e){let l=t.tr.step(u);l.setSelection(Uc(a,"start")?Gt.findFrom(l.doc.resolve(l.mapping.map(r.pos)),1):zt.create(l.doc,l.mapping.map(r.pos))),e(l.scrollIntoView())}return!0}}return a.isAtom&&r.depth==i.depth-1?(e&&e(t.tr.delete(r.pos,r.pos+a.nodeSize).scrollIntoView()),!0):!1},SL=(t,e,n)=>{let{$head:i,empty:r}=t.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;a=p0(i)}let u=a&&a.nodeAfter;return!u||!zt.isSelectable(u)?!1:(e&&e(t.tr.setSelection(zt.create(t.doc,a.pos)).scrollIntoView()),!0)};function p0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const EL=(t,e)=>{let n=t.selection,i=n instanceof zt,r;if(i){if(n.node.isTextblock||!ma(t.doc,n.from))return!1;r=n.from}else if(r=gf(t.doc,n.from,-1),r==null)return!1;if(e){let a=t.tr.join(r);i&&a.setSelection(zt.create(a.doc,r-t.doc.resolve(r).nodeBefore.nodeSize)),e(a.scrollIntoView())}return!0},CL=(t,e)=>{let n=t.selection,i;if(n instanceof zt){if(n.node.isTextblock||!ma(t.doc,n.to))return!1;i=n.to}else if(i=gf(t.doc,n.to,1),i==null)return!1;return e&&e(t.tr.join(i).scrollIntoView()),!0},TL=(t,e)=>{let{$from:n,$to:i}=t.selection,r=n.blockRange(i),a=r&&Dc(r);return a==null?!1:(e&&e(t.tr.lift(r,a).scrollIntoView()),!0)},ML=(t,e)=>{let{$head:n,$anchor:i}=t.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(e&&e(t.tr.insertText(`
|
638
638
|
`).scrollIntoView()),!0)};function r2(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const AL=(t,e)=>{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),a=n.indexAfter(-1),u=r2(r.contentMatchAt(a));if(!u||!r.canReplaceWith(a,a,u))return!1;if(e){let l=n.after(),g=t.tr.replaceWith(l,l,u.createAndFill());g.setSelection(Gt.near(g.doc.resolve(l),1)),e(g.scrollIntoView())}return!0},IL=(t,e)=>{let n=t.selection,{$from:i,$to:r}=n;if(n instanceof Fs||i.parent.inlineContent||r.parent.inlineContent)return!1;let a=r2(r.parent.contentMatchAt(r.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){let u=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,l=t.tr.insert(u,a.createAndFill());l.setSelection(Ft.create(l.doc,u+1)),e(l.scrollIntoView())}return!0},PL=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let a=n.before();if(Oc(t.doc,a))return e&&e(t.tr.split(a).scrollIntoView()),!0}let i=n.blockRange(),r=i&&Dc(i);return r==null?!1:(e&&e(t.tr.lift(i,r).scrollIntoView()),!0)},DL=(t,e)=>{let{$from:n,to:i}=t.selection,r,a=n.sharedDepth(i);return a==0?!1:(r=n.before(a),e&&e(t.tr.setSelection(zt.create(t.doc,r))),!0)};function OL(t,e,n){let i=e.nodeBefore,r=e.nodeAfter,a=e.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&e.parent.canReplace(a-1,a)?(n&&n(t.tr.delete(e.pos-i.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(a,a+1)||!(r.isTextblock||ma(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,i.type,i.contentMatchAt(i.childCount)).join(e.pos).scrollIntoView()),!0)}function s2(t,e,n,i){let r=e.nodeBefore,a=e.nodeAfter,u,l,g=r.type.spec.isolating||a.type.spec.isolating;if(!g&&OL(t,e,n))return!0;let b=!g&&e.parent.canReplace(e.index(),e.index()+1);if(b&&(u=(l=r.contentMatchAt(r.childCount)).findWrapping(a.type))&&l.matchType(u[0]||a.type).validEnd){if(n){let P=e.pos+a.nodeSize,D=Ve.empty;for(let W=u.length-1;W>=0;W--)D=Ve.from(u[W].create(null,D));D=Ve.from(r.copy(D));let R=t.tr.step(new Ti(e.pos-1,P,e.pos,P,new dt(D,1,0),u.length,!0)),j=P+2*u.length;ma(R.doc,j)&&R.join(j),n(R.scrollIntoView())}return!0}let S=a.type.spec.isolating||i>0&&g?null:Gt.findFrom(e,1),E=S&&S.$from.blockRange(S.$to),C=E&&Dc(E);if(C!=null&&C>=e.depth)return n&&n(t.tr.lift(E,C).scrollIntoView()),!0;if(b&&Uc(a,"start",!0)&&Uc(r,"end")){let P=r,D=[];for(;D.push(P),!P.isTextblock;)P=P.lastChild;let R=a,j=1;for(;!R.isTextblock;R=R.firstChild)j++;if(P.canReplace(P.childCount,P.childCount,R.content)){if(n){let W=Ve.empty;for(let le=D.length-1;le>=0;le--)W=Ve.from(D[le].copy(W));let ee=t.tr.step(new Ti(e.pos-D.length,e.pos+a.nodeSize,e.pos+j,e.pos+a.nodeSize-j,new dt(W,D.length,0),0,!0));n(ee.scrollIntoView())}return!0}}return!1}function o2(t){return function(e,n){let i=e.selection,r=t<0?i.$from:i.$to,a=r.depth;for(;r.node(a).isInline;){if(!a)return!1;a--}return r.node(a).isTextblock?(n&&n(e.tr.setSelection(Ft.create(e.doc,t<0?r.start(a):r.end(a)))),!0):!1}}const zL=o2(-1),NL=o2(1);function BL(t,e=null){return function(n,i){let{$from:r,$to:a}=n.selection,u=r.blockRange(a),l=u&&Ny(u,t,e);return l?(i&&i(n.tr.wrap(u,l).scrollIntoView()),!0):!1}}function a2(t,e=null){return function(n,i){let r=!1;for(let a=0;a<n.selection.ranges.length&&!r;a++){let{$from:{pos:u},$to:{pos:l}}=n.selection.ranges[a];n.doc.nodesBetween(u,l,(g,b)=>{if(r)return!1;if(!(!g.isTextblock||g.hasMarkup(t,e)))if(g.type==t)r=!0;else{let S=n.doc.resolve(b),E=S.index();r=S.parent.canReplaceWith(E,E+1,t)}})}if(!r)return!1;if(i){let a=n.tr;for(let u=0;u<n.selection.ranges.length;u++){let{$from:{pos:l},$to:{pos:g}}=n.selection.ranges[u];a.setBlockType(l,g,t,e)}i(a.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function RL(t,e=null){return function(n,i){let{$from:r,$to:a}=n.selection,u=r.blockRange(a),l=!1,g=u;if(!u)return!1;if(u.depth>=2&&r.node(u.depth-1).type.compatibleContent(t)&&u.startIndex==0){if(r.index(u.depth-1)==0)return!1;let S=n.doc.resolve(u.start-2);g=new lf(S,S,u.depth),u.endIndex<u.parent.childCount&&(u=new lf(r,n.doc.resolve(a.end(u.depth)),u.depth)),l=!0}let b=Ny(g,t,e,u);return b?(i&&i(LL(n.tr,u,b,l,t).scrollIntoView()),!0):!1}}function LL(t,e,n,i,r){let a=Ve.empty;for(let S=n.length-1;S>=0;S--)a=Ve.from(n[S].type.create(n[S].attrs,a));t.step(new Ti(e.start-(i?2:0),e.end,e.start,e.end,new dt(a,0,0),n.length,!0));let u=0;for(let S=0;S<n.length;S++)n[S].type==r&&(u=S+1);let l=n.length-u,g=e.start+n.length-(i?2:0),b=e.parent;for(let S=e.startIndex,E=e.endIndex,C=!0;S<E;S++,C=!1)!C&&Oc(t.doc,g,l)&&(t.split(g,l),g+=2*l),g+=b.child(S).nodeSize;return t}function VL(t){return function(e,n){let{$from:i,$to:r}=e.selection,a=i.blockRange(r,u=>u.childCount>0&&u.firstChild.type==t);return a?n?i.node(a.depth-1).type==t?FL(e,n,t,a):$L(e,n,a):!0:!1}}function FL(t,e,n,i){let r=t.tr,a=i.end,u=i.$to.end(i.depth);a<u&&(r.step(new Ti(a-1,u,a,u,new dt(Ve.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new lf(r.doc.resolve(i.$from.pos),r.doc.resolve(u),i.depth));const l=Dc(i);if(l==null)return!1;r.lift(i,l);let g=r.mapping.map(a,-1)-1;return ma(r.doc,g)&&r.join(g),e(r.scrollIntoView()),!0}function $L(t,e,n){let i=t.tr,r=n.parent;for(let P=n.end,D=n.endIndex-1,R=n.startIndex;D>R;D--)P-=r.child(D).nodeSize,i.delete(P-1,P+1);let a=i.doc.resolve(n.start),u=a.nodeAfter;if(i.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,g=n.endIndex==r.childCount,b=a.node(-1),S=a.index(-1);if(!b.canReplace(S+(l?0:1),S+1,u.content.append(g?Ve.empty:Ve.from(r))))return!1;let E=a.pos,C=E+u.nodeSize;return i.step(new Ti(E-(l?1:0),C+(g?1:0),E+1,C-1,new dt((l?Ve.empty:Ve.from(r.copy(Ve.empty))).append(g?Ve.empty:Ve.from(r.copy(Ve.empty))),l?0:1,g?0:1),l?0:1)),e(i.scrollIntoView()),!0}function jL(t){return function(e,n){let{$from:i,$to:r}=e.selection,a=i.blockRange(r,b=>b.childCount>0&&b.firstChild.type==t);if(!a)return!1;let u=a.startIndex;if(u==0)return!1;let l=a.parent,g=l.child(u-1);if(g.type!=t)return!1;if(n){let b=g.lastChild&&g.lastChild.type==l.type,S=Ve.from(b?t.create():null),E=new dt(Ve.from(t.create(null,Ve.from(l.type.create(null,S)))),b?3:1,0),C=a.start,P=a.end;n(e.tr.step(new Ti(C-(b?3:1),P,C,P,E,1,!0)).scrollIntoView())}return!0}}function Af(t){const{state:e,transaction:n}=t;let{selection:i}=n,{doc:r}=n,{storedMarks:a}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return a},get selection(){return i},get doc(){return r},get tr(){return i=n.selection,r=n.doc,a=n.storedMarks,n}}}class If{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:i}=this,{view:r}=n,{tr:a}=i,u=this.buildProps(a);return Object.fromEntries(Object.entries(e).map(([l,g])=>[l,(...S)=>{const E=g(...S)(u);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(a),E}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:u}=r,l=[],g=!!e,b=e||a.tr,S=()=>(!g&&n&&!b.getMeta("preventDispatch")&&!this.hasCustomState&&u.dispatch(b),l.every(C=>C===!0)),E={...Object.fromEntries(Object.entries(i).map(([C,P])=>[C,(...R)=>{const j=this.buildProps(b,n),W=P(...R)(j);return l.push(W),E}])),run:S};return E}createCan(e){const{rawCommands:n,state:i}=this,r=!1,a=e||i.tr,u=this.buildProps(a,r);return{...Object.fromEntries(Object.entries(n).map(([g,b])=>[g,(...S)=>b(...S)({...u,dispatch:void 0})])),chain:()=>this.createChain(a,r)}}buildProps(e,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:u}=r,l={tr:e,editor:r,view:u,state:Af({state:a,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(i).map(([g,b])=>[g,(...S)=>b(...S)(l)]))}};return l}}class UL{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const i=this.callbacks[e];return i&&i.forEach(r=>r.apply(this,n)),this}off(e,n){const i=this.callbacks[e];return i&&(n?this.callbacks[e]=i.filter(r=>r!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function kt(t,e,n){return t.config[e]===void 0&&t.parent?kt(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?kt(t.parent,e,n):null}):t.config[e]}function Pf(t){const e=t.filter(r=>r.type==="extension"),n=t.filter(r=>r.type==="node"),i=t.filter(r=>r.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:i}}function l2(t){const e=[],{nodeExtensions:n,markExtensions:i}=Pf(t),r=[...n,...i],a={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(u=>{const l={name:u.name,options:u.options,storage:u.storage,extensions:r},g=kt(u,"addGlobalAttributes",l);if(!g)return;g().forEach(S=>{S.types.forEach(E=>{Object.entries(S.attributes).forEach(([C,P])=>{e.push({type:E,name:C,attribute:{...a,...P}})})})})}),r.forEach(u=>{const l={name:u.name,options:u.options,storage:u.storage},g=kt(u,"addAttributes",l);if(!g)return;const b=g();Object.entries(b).forEach(([S,E])=>{const C={...a,...E};typeof(C==null?void 0:C.default)=="function"&&(C.default=C.default()),C!=null&&C.isRequired&&(C==null?void 0:C.default)===void 0&&delete C.default,e.push({type:u.name,name:S,attribute:C})})}),e}function Mi(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ci(...t){return t.filter(e=>!!e).reduce((e,n)=>{const i={...e};return Object.entries(n).forEach(([r,a])=>{if(!i[r]){i[r]=a;return}if(r==="class"){const l=a?a.split(" "):[],g=i[r]?i[r].split(" "):[],b=l.filter(S=>!g.includes(S));i[r]=[...g,...b].join(" ")}else if(r==="style"){const l=a?a.split(";").map(S=>S.trim()).filter(Boolean):[],g=i[r]?i[r].split(";").map(S=>S.trim()).filter(Boolean):[],b=new Map;g.forEach(S=>{const[E,C]=S.split(":").map(P=>P.trim());b.set(E,C)}),l.forEach(S=>{const[E,C]=S.split(":").map(P=>P.trim());b.set(E,C)}),i[r]=Array.from(b.entries()).map(([S,E])=>`${S}: ${E}`).join("; ")}else i[r]=a}),i},{})}function f0(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,i)=>ci(n,i),{})}function c2(t){return typeof t=="function"}function nn(t,e=void 0,...n){return c2(t)?e?t.bind(e)(...n):t(...n):t}function HL(t={}){return Object.keys(t).length===0&&t.constructor===Object}function qL(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function u2(t,e){return"style"in t?t:{...t,getAttrs:n=>{const i=t.getAttrs?t.getAttrs(n):t.attrs;if(i===!1)return!1;const r=e.reduce((a,u)=>{const l=u.attribute.parseHTML?u.attribute.parseHTML(n):qL(n.getAttribute(u.name));return l==null?a:{...a,[u.name]:l}},{});return{...i,...r}}}}function h2(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&HL(n)?!1:n!=null))}function WL(t,e){var n;const i=l2(t),{nodeExtensions:r,markExtensions:a}=Pf(t),u=(n=r.find(b=>kt(b,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(r.map(b=>{const S=i.filter(W=>W.type===b.name),E={name:b.name,options:b.options,storage:b.storage,editor:e},C=t.reduce((W,ee)=>{const le=kt(ee,"extendNodeSchema",E);return{...W,...le?le(b):{}}},{}),P=h2({...C,content:nn(kt(b,"content",E)),marks:nn(kt(b,"marks",E)),group:nn(kt(b,"group",E)),inline:nn(kt(b,"inline",E)),atom:nn(kt(b,"atom",E)),selectable:nn(kt(b,"selectable",E)),draggable:nn(kt(b,"draggable",E)),code:nn(kt(b,"code",E)),whitespace:nn(kt(b,"whitespace",E)),defining:nn(kt(b,"defining",E)),isolating:nn(kt(b,"isolating",E)),attrs:Object.fromEntries(S.map(W=>{var ee;return[W.name,{default:(ee=W==null?void 0:W.attribute)===null||ee===void 0?void 0:ee.default}]}))}),D=nn(kt(b,"parseHTML",E));D&&(P.parseDOM=D.map(W=>u2(W,S)));const R=kt(b,"renderHTML",E);R&&(P.toDOM=W=>R({node:W,HTMLAttributes:f0(W,S)}));const j=kt(b,"renderText",E);return j&&(P.toText=j),[b.name,P]})),g=Object.fromEntries(a.map(b=>{const S=i.filter(j=>j.type===b.name),E={name:b.name,options:b.options,storage:b.storage,editor:e},C=t.reduce((j,W)=>{const ee=kt(W,"extendMarkSchema",E);return{...j,...ee?ee(b):{}}},{}),P=h2({...C,inclusive:nn(kt(b,"inclusive",E)),excludes:nn(kt(b,"excludes",E)),group:nn(kt(b,"group",E)),spanning:nn(kt(b,"spanning",E)),code:nn(kt(b,"code",E)),attrs:Object.fromEntries(S.map(j=>{var W;return[j.name,{default:(W=j==null?void 0:j.attribute)===null||W===void 0?void 0:W.default}]}))}),D=nn(kt(b,"parseHTML",E));D&&(P.parseDOM=D.map(j=>u2(j,S)));const R=kt(b,"renderHTML",E);return R&&(P.toDOM=j=>R({mark:j,HTMLAttributes:f0(j,S)})),[b.name,P]}));return new cw({topNode:u,nodes:l,marks:g})}function m0(t,e){return e.nodes[t]||e.marks[t]||null}function d2(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const GL=(t,e=500)=>{let n="";const i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-e),i,(r,a,u,l)=>{var g,b;const S=((b=(g=r.type.spec).toText)===null||b===void 0?void 0:b.call(g,{node:r,pos:a,parent:u,index:l}))||r.textContent||"%leaf%";n+=r.isAtom&&!r.isText?S:S.slice(0,Math.max(0,i-a))}),n};function g0(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Df{constructor(e){this.find=e.find,this.handler=e.handler}}const ZL=(t,e)=>{if(g0(e))return e.exec(t);const n=e(t);if(!n)return null;const i=[n.text];return i.index=n.index,i.input=t,i.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(n.replaceWith)),i};function Of(t){var e;const{editor:n,from:i,to:r,text:a,rules:u,plugin:l}=t,{view:g}=n;if(g.composing)return!1;const b=g.state.doc.resolve(i);if(b.parent.type.spec.code||!((e=b.nodeBefore||b.nodeAfter)===null||e===void 0)&&e.marks.find(C=>C.type.spec.code))return!1;let S=!1;const E=GL(b)+a;return u.forEach(C=>{if(S)return;const P=ZL(E,C.find);if(!P)return;const D=g.state.tr,R=Af({state:g.state,transaction:D}),j={from:i-(P[0].length-a.length),to:r},{commands:W,chain:ee,can:le}=new If({editor:n,state:R});C.handler({state:R,range:j,match:P,commands:W,chain:ee,can:le})===null||!D.steps.length||(D.setMeta(l,{transform:D,from:i,to:r,text:a}),g.dispatch(D),S=!0)}),S}function YL(t){const{editor:e,rules:n}=t,i=new Fi({state:{init(){return null},apply(r,a){const u=r.getMeta(i);if(u)return u;const l=r.getMeta("applyInputRules");return!!l&&setTimeout(()=>{const{from:b,text:S}=l,E=b+S.length;Of({editor:e,from:b,to:E,text:S,rules:n,plugin:i})}),r.selectionSet||r.docChanged?null:a}},props:{handleTextInput(r,a,u,l){return Of({editor:e,from:a,to:u,text:l,rules:n,plugin:i})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:a}=r.state.selection;a&&Of({editor:e,from:a.pos,to:a.pos,text:"",rules:n,plugin:i})}),!1)},handleKeyDown(r,a){if(a.key!=="Enter")return!1;const{$cursor:u}=r.state.selection;return u?Of({editor:e,from:u.pos,to:u.pos,text:`
|
639
|
-
`,rules:n,plugin:i}):!1}},isInputRules:!0});return i}function XL(t){return Object.prototype.toString.call(t).slice(8,-1)}function zf(t){return XL(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Nf(t,e){const n={...t};return zf(t)&&zf(e)&&Object.keys(e).forEach(i=>{zf(e[i])&&zf(t[i])?n[i]=Nf(t[i],e[i]):n[i]=e[i]}),n}class oo{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nn(kt(this,"addOptions",{name:this.name}))),this.storage=nn(kt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new oo(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nf(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new oo(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nn(kt(n,"addOptions",{name:n.name})),n.storage=nn(kt(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:i}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const u=r.marks();if(!!!u.find(b=>(b==null?void 0:b.type.name)===n.name))return!1;const g=u.find(b=>(b==null?void 0:b.type.name)===n.name);return g&&i.removeStoredMark(g),i.insertText(" ",r.pos),e.view.dispatch(i),!0}return!1}}function KL(t){return typeof t=="number"}class JL{constructor(e){this.find=e.find,this.handler=e.handler}}const QL=(t,e,n)=>{if(g0(e))return[...t.matchAll(e)];const i=e(t,n);return i?i.map(r=>{const a=[r.text];return a.index=r.index,a.input=t,a.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),a.push(r.replaceWith)),a}):[]};function
|
639
|
+
`,rules:n,plugin:i}):!1}},isInputRules:!0});return i}function XL(t){return Object.prototype.toString.call(t).slice(8,-1)}function zf(t){return XL(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Nf(t,e){const n={...t};return zf(t)&&zf(e)&&Object.keys(e).forEach(i=>{zf(e[i])&&zf(t[i])?n[i]=Nf(t[i],e[i]):n[i]=e[i]}),n}class oo{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nn(kt(this,"addOptions",{name:this.name}))),this.storage=nn(kt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new oo(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nf(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new oo(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nn(kt(n,"addOptions",{name:n.name})),n.storage=nn(kt(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:i}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const u=r.marks();if(!!!u.find(b=>(b==null?void 0:b.type.name)===n.name))return!1;const g=u.find(b=>(b==null?void 0:b.type.name)===n.name);return g&&i.removeStoredMark(g),i.insertText(" ",r.pos),e.view.dispatch(i),!0}return!1}}function KL(t){return typeof t=="number"}class JL{constructor(e){this.find=e.find,this.handler=e.handler}}const QL=(t,e,n)=>{if(g0(e))return[...t.matchAll(e)];const i=e(t,n);return i?i.map(r=>{const a=[r.text];return a.index=r.index,a.input=t,a.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),a.push(r.replaceWith)),a}):[]};function e3(t){const{editor:e,state:n,from:i,to:r,rule:a,pasteEvent:u,dropEvent:l}=t,{commands:g,chain:b,can:S}=new If({editor:e,state:n}),E=[];return n.doc.nodesBetween(i,r,(P,D)=>{if(!P.isTextblock||P.type.spec.code)return;const R=Math.max(i,D),j=Math.min(r,D+P.content.size),W=P.textBetween(R-D,j-D,void 0,"");QL(W,a.find,u).forEach(le=>{if(le.index===void 0)return;const J=R+le.index+1,Te=J+le[0].length,xe={from:n.tr.mapping.map(J),to:n.tr.mapping.map(Te)},Ae=a.handler({state:n,range:xe,match:le,commands:g,chain:b,can:S,pasteEvent:u,dropEvent:l});E.push(Ae)})}),E.every(P=>P!==null)}const t3=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function n3(t){const{editor:e,rules:n}=t;let i=null,r=!1,a=!1,u=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l=typeof DragEvent<"u"?new DragEvent("drop"):null;const g=({state:S,from:E,to:C,rule:P,pasteEvt:D})=>{const R=S.tr,j=Af({state:S,transaction:R});if(!(!e3({editor:e,state:j,from:Math.max(E-1,0),to:C.b-1,rule:P,pasteEvent:D,dropEvent:l})||!R.steps.length))return l=typeof DragEvent<"u"?new DragEvent("drop"):null,u=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,R};return n.map(S=>new Fi({view(E){const C=P=>{var D;i=!((D=E.dom.parentElement)===null||D===void 0)&&D.contains(P.target)?E.dom.parentElement:null};return window.addEventListener("dragstart",C),{destroy(){window.removeEventListener("dragstart",C)}}},props:{handleDOMEvents:{drop:(E,C)=>(a=i===E.dom.parentElement,l=C,!1),paste:(E,C)=>{var P;const D=(P=C.clipboardData)===null||P===void 0?void 0:P.getData("text/html");return u=C,r=!!(D!=null&&D.includes("data-pm-slice")),!1}}},appendTransaction:(E,C,P)=>{const D=E[0],R=D.getMeta("uiEvent")==="paste"&&!r,j=D.getMeta("uiEvent")==="drop"&&!a,W=D.getMeta("applyPasteRules"),ee=!!W;if(!R&&!j&&!ee)return;if(ee){const{from:Te,text:xe}=W,Ae=Te+xe.length,$e=t3(xe);return g({rule:S,state:P,from:Te,to:{b:Ae},pasteEvt:$e})}const le=C.doc.content.findDiffStart(P.doc.content),J=C.doc.content.findDiffEnd(P.doc.content);if(!(!KL(le)||!J||le===J.b))return g({rule:S,state:P,from:le,to:J,pasteEvt:u})}}))}function i3(t){const e=t.filter((n,i)=>t.indexOf(n)!==i);return Array.from(new Set(e))}class Hc{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Hc.resolve(e),this.schema=WL(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Hc.sort(Hc.flatten(e)),i=i3(n.map(r=>r.name));return i.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${i.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const i={name:n.name,options:n.options,storage:n.storage},r=kt(n,"addExtensions",i);return r?[n,...this.flatten(r())]:n}).flat(10)}static sort(e){return e.sort((i,r)=>{const a=kt(i,"priority")||100,u=kt(r,"priority")||100;return a>u?-1:a<u?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const i={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:m0(n.name,this.schema)},r=kt(n,"addCommands",i);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this,n=Hc.sort([...this.extensions].reverse()),i=[],r=[],a=n.map(u=>{const l={name:u.name,options:u.options,storage:u.storage,editor:e,type:m0(u.name,this.schema)},g=[],b=kt(u,"addKeyboardShortcuts",l);let S={};if(u.type==="mark"&&kt(u,"exitable",l)&&(S.ArrowRight=()=>oo.handleExit({editor:e,mark:u})),b){const R=Object.fromEntries(Object.entries(b()).map(([j,W])=>[j,()=>W({editor:e})]));S={...S,...R}}const E=yL(S);g.push(E);const C=kt(u,"addInputRules",l);d2(u,e.options.enableInputRules)&&C&&i.push(...C());const P=kt(u,"addPasteRules",l);d2(u,e.options.enablePasteRules)&&P&&r.push(...P());const D=kt(u,"addProseMirrorPlugins",l);if(D){const R=D();g.push(...R)}return g}).flat();return[YL({editor:e,rules:i}),...n3({editor:e,rules:r}),...a]}get attributes(){return l2(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Pf(this.extensions);return Object.fromEntries(n.filter(i=>!!kt(i,"addNodeView")).map(i=>{const r=this.attributes.filter(g=>g.type===i.name),a={name:i.name,options:i.options,storage:i.storage,editor:e,type:Mi(i.name,this.schema)},u=kt(i,"addNodeView",a);if(!u)return[];const l=(g,b,S,E,C)=>{const P=f0(g,r);return u()({node:g,view:b,getPos:S,decorations:E,innerDecorations:C,editor:e,extension:i,HTMLAttributes:P})};return[i.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const i={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:m0(e.name,this.schema)};e.type==="mark"&&(!((n=nn(kt(e,"keepOnSplit",i)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const r=kt(e,"onBeforeCreate",i),a=kt(e,"onCreate",i),u=kt(e,"onUpdate",i),l=kt(e,"onSelectionUpdate",i),g=kt(e,"onTransaction",i),b=kt(e,"onFocus",i),S=kt(e,"onBlur",i),E=kt(e,"onDestroy",i);r&&this.editor.on("beforeCreate",r),a&&this.editor.on("create",a),u&&this.editor.on("update",u),l&&this.editor.on("selectionUpdate",l),g&&this.editor.on("transaction",g),b&&this.editor.on("focus",b),S&&this.editor.on("blur",S),E&&this.editor.on("destroy",E)})}}class Ai{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nn(kt(this,"addOptions",{name:this.name}))),this.storage=nn(kt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ai(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nf(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ai({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nn(kt(n,"addOptions",{name:n.name})),n.storage=nn(kt(n,"addStorage",{name:n.name,options:n.options})),n}}function p2(t,e,n){const{from:i,to:r}=e,{blockSeparator:a=`
|
640
640
|
|
641
|
-
`,textSerializers:u={}}=n||{};let l="";return t.nodesBetween(i,r,(g,b,S,E)=>{var C;g.isBlock&&b>i&&(l+=a);const P=u==null?void 0:u[g.type.name];if(P)return S&&(l+=P({node:g,pos:b,parent:S,index:E,range:e})),!1;g.isText&&(l+=(C=g==null?void 0:g.text)===null||C===void 0?void 0:C.slice(Math.max(i,b)-b,r-b))}),l}function f2(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const r4=Ai.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Fi({key:new Mr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:i,selection:r}=e,{ranges:a}=r,u=Math.min(...a.map(S=>S.$from.pos)),l=Math.max(...a.map(S=>S.$to.pos)),g=f2(n);return p2(i,{from:u,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:g})}}})]}}),s4=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),o4=(t=!1)=>({commands:e})=>e.setContent("",t),a4=()=>({state:t,tr:e,dispatch:n})=>{const{selection:i}=e,{ranges:r}=i;return n&&r.forEach(({$from:a,$to:u})=>{t.doc.nodesBetween(a.pos,u.pos,(l,g)=>{if(l.type.isText)return;const{doc:b,mapping:S}=e,E=b.resolve(S.map(g)),C=b.resolve(S.map(g+l.nodeSize)),P=E.blockRange(C);if(!P)return;const D=Dc(P);if(l.type.isTextblock){const{defaultType:R}=E.parent.contentMatchAt(E.index());e.setNodeMarkup(P.start,R)}(D||D===0)&&e.lift(P,D)})}),!0},l4=t=>e=>t(e),c4=()=>({state:t,dispatch:e})=>IL(t,e),u4=(t,e)=>({editor:n,tr:i})=>{const{state:r}=n,a=r.doc.slice(t.from,t.to);i.deleteRange(t.from,t.to);const u=i.mapping.map(e);return i.insert(u,a.content),i.setSelection(new Ft(i.doc.resolve(u-1))),!0},h4=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,i=n.$anchor.node();if(i.content.size>0)return!1;const r=t.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===i.type){if(e){const l=r.before(a),g=r.after(a);t.delete(l,g).scrollIntoView()}return!0}return!1},d4=t=>({tr:e,state:n,dispatch:i})=>{const r=Mi(t,n.schema),a=e.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===r){if(i){const g=a.before(u),b=a.after(u);e.delete(g,b).scrollIntoView()}return!0}return!1},p4=t=>({tr:e,dispatch:n})=>{const{from:i,to:r}=t;return n&&e.delete(i,r),!0},f4=()=>({state:t,dispatch:e})=>_L(t,e),m4=()=>({commands:t})=>t.keyboardShortcut("Enter"),g4=()=>({state:t,dispatch:e})=>AL(t,e);function Bf(t,e,n={strict:!0}){const i=Object.keys(e);return i.length?i.every(r=>n.strict?e[r]===t[r]:g0(e[r])?e[r].test(t[r]):e[r]===t[r]):!0}function y0(t,e,n={}){return t.find(i=>i.type===e&&Bf(i.attrs,n))}function y4(t,e,n={}){return!!y0(t,e,n)}function _0(t,e,n={}){if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if(t.parentOffset===i.offset&&i.offset!==0&&(i=t.parent.childBefore(t.parentOffset)),!i.node)return;const r=y0([...i.node.marks],e,n);if(!r)return;let a=i.index,u=t.start()+i.offset,l=a+1,g=u+i.node.nodeSize;for(y0([...i.node.marks],e,n);a>0&&r.isInSet(t.parent.child(a-1).marks);)a-=1,u-=t.parent.child(a).nodeSize;for(;l<t.parent.childCount&&y4([...t.parent.child(l).marks],e,n);)g+=t.parent.child(l).nodeSize,l+=1;return{from:u,to:g}}function Ea(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const _4=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const a=Ea(t,i.schema),{doc:u,selection:l}=n,{$from:g,from:b,to:S}=l;if(r){const E=_0(g,a,e);if(E&&E.from<=b&&E.to>=S){const C=Ft.create(u,E.from,E.to);n.setSelection(C)}}return!0},b4=t=>e=>{const n=typeof t=="function"?t(e):t;for(let i=0;i<n.length;i+=1)if(n[i](e))return!0;return!1};function b0(t){return t instanceof Ft}function Ro(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function m2(t,e=null){if(!e)return null;const n=Gt.atStart(t),i=Gt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return i;const r=n.from,a=i.to;return e==="all"?Ft.create(t,Ro(0,r,a),Ro(t.content.size,r,a)):Ft.create(t,Ro(e,r,a),Ro(e,r,a))}function x0(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const x4=(t=null,e={})=>({editor:n,view:i,tr:r,dispatch:a})=>{e={scrollIntoView:!0,...e};const u=()=>{x0()&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(i.hasFocus()&&t===null||t===!1)return!0;if(a&&t===null&&!b0(n.state.selection))return u(),!0;const l=m2(r.doc,t)||n.state.selection,g=n.state.selection.eq(l);return a&&(g||r.setSelection(l),g&&r.storedMarks&&r.setStoredMarks(r.storedMarks),u()),!0},v4=(t,e)=>n=>t.every((i,r)=>e(i,{...n,index:r})),w4=(t,e)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),g2=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const i=e[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?t.removeChild(i):i.nodeType===1&&g2(i)}return t};function Rf(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return g2(n)}function Lf(t,e,n){n={slice:!0,parseOptions:{},...n};const i=typeof t=="object"&&t!==null,r=typeof t=="string";if(i)try{if(Array.isArray(t)&&t.length>0)return Ve.fromArray(t.map(l=>e.nodeFromJSON(l)));const u=e.nodeFromJSON(t);return n.errorOnInvalidContent&&u.check(),u}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",a),Lf("",e,n)}if(r){if(n.errorOnInvalidContent){let u=!1,l="";const g=new cw({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:b=>(u=!0,l=typeof b=="string"?b:b.outerHTML,null)}]}})});if(n.slice?xh.fromSchema(g).parseSlice(Rf(t),n.parseOptions):xh.fromSchema(g).parse(Rf(t),n.parseOptions),n.errorOnInvalidContent&&u)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const a=xh.fromSchema(e);return n.slice?a.parseSlice(Rf(t),n.parseOptions).content:a.parse(Rf(t),n.parseOptions)}return Lf("",e,n)}function k4(t,e,n){const i=t.steps.length-1;if(i<e)return;const r=t.steps[i];if(!(r instanceof Ci||r instanceof Ti))return;const a=t.mapping.maps[i];let u=0;a.forEach((l,g,b,S)=>{u===0&&(u=S)}),t.setSelection(Gt.near(t.doc.resolve(u),n))}const S4=t=>!("type"in t),E4=(t,e,n)=>({tr:i,dispatch:r,editor:a})=>{var u;if(r){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=Lf(e,a.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(u=n.errorOnInvalidContent)!==null&&u!==void 0?u:a.options.enableContentCheck})}catch(D){return a.emit("contentError",{editor:a,error:D,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:g,to:b}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},S=!0,E=!0;if((S4(l)?l:[l]).forEach(D=>{D.check(),S=S?D.isText&&D.marks.length===0:!1,E=E?D.isBlock:!1}),g===b&&E){const{parent:D}=i.doc.resolve(g);D.isTextblock&&!D.type.spec.code&&!D.childCount&&(g-=1,b+=1)}let P;S?(Array.isArray(e)?P=e.map(D=>D.text||"").join(""):typeof e=="object"&&e&&e.text?P=e.text:P=e,i.insertText(P,g,b)):(P=l,i.replaceWith(g,b,P)),n.updateSelection&&k4(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:g,text:P}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:g,text:P})}return!0},C4=()=>({state:t,dispatch:e})=>EL(t,e),T4=()=>({state:t,dispatch:e})=>CL(t,e),M4=()=>({state:t,dispatch:e})=>bL(t,e),A4=()=>({state:t,dispatch:e})=>kL(t,e),I4=()=>({state:t,dispatch:e,tr:n})=>{try{const i=gf(t.doc,t.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},P4=()=>({state:t,dispatch:e,tr:n})=>{try{const i=gf(t.doc,t.selection.$from.pos,1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},D4=()=>({state:t,dispatch:e})=>xL(t,e),O4=()=>({state:t,dispatch:e})=>vL(t,e);function y2(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function z4(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let i,r,a,u;for(let l=0;l<e.length-1;l+=1){const g=e[l];if(/^(cmd|meta|m)$/i.test(g))u=!0;else if(/^a(lt)?$/i.test(g))i=!0;else if(/^(c|ctrl|control)$/i.test(g))r=!0;else if(/^s(hift)?$/i.test(g))a=!0;else if(/^mod$/i.test(g))x0()||y2()?u=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${g}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),u&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const N4=t=>({editor:e,view:n,tr:i,dispatch:r})=>{const a=z4(t).split(/-(?!$)/),u=a.find(b=>!["Alt","Ctrl","Meta","Shift"].includes(b)),l=new KeyboardEvent("keydown",{key:u==="Space"?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),g=e.captureTransaction(()=>{n.someProp("handleKeyDown",b=>b(n,l))});return g==null||g.steps.forEach(b=>{const S=b.map(i.mapping);S&&r&&i.maybeStep(S)}),!0};function Bh(t,e,n={}){const{from:i,to:r,empty:a}=t.selection,u=e?Mi(e,t.schema):null,l=[];t.doc.nodesBetween(i,r,(E,C)=>{if(E.isText)return;const P=Math.max(i,C),D=Math.min(r,C+E.nodeSize);l.push({node:E,from:P,to:D})});const g=r-i,b=l.filter(E=>u?u.name===E.node.type.name:!0).filter(E=>Bf(E.node.attrs,n,{strict:!1}));return a?!!b.length:b.reduce((E,C)=>E+C.to-C.from,0)>=g}const B4=(t,e={})=>({state:n,dispatch:i})=>{const r=Mi(t,n.schema);return Bh(n,r,e)?TL(n,i):!1},R4=()=>({state:t,dispatch:e})=>PL(t,e),L4=t=>({state:e,dispatch:n})=>{const i=Mi(t,e.schema);return VL(i)(e,n)},V4=()=>({state:t,dispatch:e})=>ML(t,e);function Vf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function _2(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((i,r)=>(n.includes(r)||(i[r]=t[r]),i),{})}const F4=(t,e)=>({tr:n,state:i,dispatch:r})=>{let a=null,u=null;const l=Vf(typeof t=="string"?t:t.name,i.schema);return l?(l==="node"&&(a=Mi(t,i.schema)),l==="mark"&&(u=Ea(t,i.schema)),r&&n.selection.ranges.forEach(g=>{i.doc.nodesBetween(g.$from.pos,g.$to.pos,(b,S)=>{a&&a===b.type&&n.setNodeMarkup(S,void 0,_2(b.attrs,e)),u&&b.marks.length&&b.marks.forEach(E=>{u===E.type&&n.addMark(S,S+b.nodeSize,u.create(_2(E.attrs,e)))})})}),!0):!1},$4=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),j4=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),U4=()=>({state:t,dispatch:e})=>wL(t,e),H4=()=>({state:t,dispatch:e})=>SL(t,e),q4=()=>({state:t,dispatch:e})=>DL(t,e),W4=()=>({state:t,dispatch:e})=>NL(t,e),G4=()=>({state:t,dispatch:e})=>zL(t,e);function v0(t,e,n={},i={}){return Lf(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const Z4=(t,e=!1,n={},i={})=>({editor:r,tr:a,dispatch:u,commands:l})=>{var g,b;const{doc:S}=a;if(n.preserveWhitespace!=="full"){const E=v0(t,r.schema,n,{errorOnInvalidContent:(g=i.errorOnInvalidContent)!==null&&g!==void 0?g:r.options.enableContentCheck});return u&&a.replaceWith(0,S.content.size,E).setMeta("preventUpdate",!e),!0}return u&&a.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:S.content.size},t,{parseOptions:n,errorOnInvalidContent:(b=i.errorOnInvalidContent)!==null&&b!==void 0?b:r.options.enableContentCheck})};function w0(t,e){const n=Ea(e,t.schema),{from:i,to:r,empty:a}=t.selection,u=[];a?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,r,g=>{u.push(...g.marks)});const l=u.find(g=>g.type.name===n.name);return l?{...l.attrs}:{}}function Y4(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function X4(t,e){for(let n=t.depth;n>0;n-=1){const i=t.node(n);if(e(i))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}}function k0(t){return e=>X4(e.$from,t)}function K4(t,e){const n=Sl.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function J4(t,e){const n={from:0,to:t.content.size};return p2(t,n,e)}function Q4(t,e){const n=Mi(e,t.schema),{from:i,to:r}=t.selection,a=[];t.doc.nodesBetween(i,r,l=>{a.push(l)});const u=a.reverse().find(l=>l.type.name===n.name);return u?{...u.attrs}:{}}function e3(t,e){const n=Vf(typeof e=="string"?e:e.name,t.schema);return n==="node"?Q4(t,e):n==="mark"?w0(t,e):{}}function b2(t,e,n){const i=[];return t===e?n.resolve(t).marks().forEach(r=>{const a=n.resolve(t),u=_0(a,r.type);u&&i.push({mark:r,...u})}):n.nodesBetween(t,e,(r,a)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(u=>({from:a,to:a+r.nodeSize,mark:u})))}),i}function Ff(t,e,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=t.find(a=>a.type===e&&a.name===i);return r?r.attribute.keepOnSplit:!1}))}function S0(t,e,n={}){const{empty:i,ranges:r}=t.selection,a=e?Ea(e,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(E=>a?a.name===E.type.name:!0).find(E=>Bf(E.attrs,n,{strict:!1}));let u=0;const l=[];if(r.forEach(({$from:E,$to:C})=>{const P=E.pos,D=C.pos;t.doc.nodesBetween(P,D,(R,j)=>{if(!R.isText&&!R.marks.length)return;const W=Math.max(P,j),ee=Math.min(D,j+R.nodeSize),le=ee-W;u+=le,l.push(...R.marks.map(J=>({mark:J,from:W,to:ee})))})}),u===0)return!1;const g=l.filter(E=>a?a.name===E.mark.type.name:!0).filter(E=>Bf(E.mark.attrs,n,{strict:!1})).reduce((E,C)=>E+C.to-C.from,0),b=l.filter(E=>a?E.mark.type!==a&&E.mark.type.excludes(a):!0).reduce((E,C)=>E+C.to-C.from,0);return(g>0?g+b:g)>=u}function t3(t,e,n={}){if(!e)return Bh(t,null,n)||S0(t,null,n);const i=Vf(e,t.schema);return i==="node"?Bh(t,e,n):i==="mark"?S0(t,e,n):!1}function x2(t,e){const{nodeExtensions:n}=Pf(e),i=n.find(u=>u.name===t);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},a=nn(kt(i,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function E0(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((i=t.text)!==null&&i!==void 0?i:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let r=!0;return t.content.forEach(a=>{r!==!1&&(E0(a,{ignoreWhitespace:n,checkChildren:e})||(r=!1))}),r}return!1}function v2(t){return t instanceof zt}function w2(t,e,n){const r=t.state.doc.content.size,a=Ro(e,0,r),u=Ro(n,0,r),l=t.coordsAtPos(a),g=t.coordsAtPos(u,-1),b=Math.min(l.top,g.top),S=Math.max(l.bottom,g.bottom),E=Math.min(l.left,g.left),C=Math.max(l.right,g.right),P=C-E,D=S-b,W={top:b,bottom:S,left:E,right:C,width:P,height:D,x:E,y:b};return{...W,toJSON:()=>W}}function n3(t,e,n){var i;const{selection:r}=e;let a=null;if(b0(r)&&(a=r.$cursor),a){const l=(i=t.storedMarks)!==null&&i!==void 0?i:a.marks();return!!n.isInSet(l)||!l.some(g=>g.type.excludes(n))}const{ranges:u}=r;return u.some(({$from:l,$to:g})=>{let b=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,g.pos,(S,E,C)=>{if(b)return!1;if(S.isInline){const P=!C||C.type.allowsMarkType(n),D=!!n.isInSet(S.marks)||!S.marks.some(R=>R.type.excludes(n));b=P&&D}return!b}),b})}const i3=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const{selection:a}=n,{empty:u,ranges:l}=a,g=Ea(t,i.schema);if(r)if(u){const b=w0(i,g);n.addStoredMark(g.create({...b,...e}))}else l.forEach(b=>{const S=b.$from.pos,E=b.$to.pos;i.doc.nodesBetween(S,E,(C,P)=>{const D=Math.max(P,S),R=Math.min(P+C.nodeSize,E);C.marks.find(W=>W.type===g)?C.marks.forEach(W=>{g===W.type&&n.addMark(D,R,g.create({...W.attrs,...e}))}):n.addMark(D,R,g.create(e))})});return n3(i,n,g)},r3=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),s3=(t,e={})=>({state:n,dispatch:i,chain:r})=>{const a=Mi(t,n.schema);return a.isTextblock?r().command(({commands:u})=>a2(a,e)(n)?!0:u.clearNodes()).command(({state:u})=>a2(a,e)(u,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},o3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,r=Ro(t,0,i.content.size),a=zt.create(i,r);e.setSelection(a)}return!0},a3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,{from:r,to:a}=typeof t=="number"?{from:t,to:t}:t,u=Ft.atStart(i).from,l=Ft.atEnd(i).to,g=Ro(r,u,l),b=Ro(a,u,l),S=Ft.create(i,g,b);e.setSelection(S)}return!0},l3=t=>({state:e,dispatch:n})=>{const i=Mi(t,e.schema);return jL(i)(e,n)};function k2(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const i=n.filter(r=>e==null?void 0:e.includes(r.type.name));t.tr.ensureMarks(i)}}const c3=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:i,editor:r})=>{const{selection:a,doc:u}=e,{$from:l,$to:g}=a,b=r.extensionManager.attributes,S=Ff(b,l.node().type.name,l.node().attrs);if(a instanceof zt&&a.node.isBlock)return!l.parentOffset||!Oc(u,l.pos)?!1:(i&&(t&&k2(n,r.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const E=g.parentOffset===g.parent.content.size,C=l.depth===0?void 0:Y4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let P=E&&C?[{type:C,attrs:S}]:void 0,D=Oc(e.doc,e.mapping.map(l.pos),1,P);if(!P&&!D&&Oc(e.doc,e.mapping.map(l.pos),1,C?[{type:C}]:void 0)&&(D=!0,P=C?[{type:C,attrs:S}]:void 0),i){if(D&&(a instanceof Ft&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,P),C&&!E&&!l.parentOffset&&l.parent.type!==C)){const R=e.mapping.map(l.before()),j=e.doc.resolve(R);l.node(-1).canReplaceWith(j.index(),j.index()+1,C)&&e.setNodeMarkup(e.mapping.map(l.before()),C)}t&&k2(n,r.extensionManager.splittableMarks),e.scrollIntoView()}return D},u3=(t,e={})=>({tr:n,state:i,dispatch:r,editor:a})=>{var u;const l=Mi(t,i.schema),{$from:g,$to:b}=i.selection,S=i.selection.node;if(S&&S.isBlock||g.depth<2||!g.sameParent(b))return!1;const E=g.node(-1);if(E.type!==l)return!1;const C=a.extensionManager.attributes;if(g.parent.content.size===0&&g.node(-1).childCount===g.indexAfter(-1)){if(g.depth===2||g.node(-3).type!==l||g.index(-2)!==g.node(-2).childCount-1)return!1;if(r){let W=Ve.empty;const ee=g.index(-1)?1:g.index(-2)?2:3;for(let $e=g.depth-ee;$e>=g.depth-3;$e-=1)W=Ve.from(g.node($e).copy(W));const le=g.indexAfter(-1)<g.node(-2).childCount?1:g.indexAfter(-2)<g.node(-3).childCount?2:3,J={...Ff(C,g.node().type.name,g.node().attrs),...e},Te=((u=l.contentMatch.defaultType)===null||u===void 0?void 0:u.createAndFill(J))||void 0;W=W.append(Ve.from(l.createAndFill(null,Te)||void 0));const xe=g.before(g.depth-(ee-1));n.replace(xe,g.after(-le),new dt(W,4-ee,0));let Ae=-1;n.doc.nodesBetween(xe,n.doc.content.size,($e,Pe)=>{if(Ae>-1)return!1;$e.isTextblock&&$e.content.size===0&&(Ae=Pe+1)}),Ae>-1&&n.setSelection(Ft.near(n.doc.resolve(Ae))),n.scrollIntoView()}return!0}const P=b.pos===g.end()?E.contentMatchAt(0).defaultType:null,D={...Ff(C,E.type.name,E.attrs),...e},R={...Ff(C,g.node().type.name,g.node().attrs),...e};n.delete(g.pos,b.pos);const j=P?[{type:l,attrs:D},{type:P,attrs:R}]:[{type:l,attrs:D}];if(!Oc(n.doc,g.pos,2))return!1;if(r){const{selection:W,storedMarks:ee}=i,{splittableMarks:le}=a.extensionManager,J=ee||W.$to.parentOffset&&W.$from.marks();if(n.split(g.pos,2,j).scrollIntoView(),!J||!r)return!0;const Te=J.filter(xe=>le.includes(xe.type.name));n.ensureMarks(Te)}return!0},C0=(t,e)=>{const n=k0(u=>u.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&ma(t.doc,n.pos)&&t.join(n.pos),!0},T0=(t,e)=>{const n=k0(u=>u.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&ma(t.doc,i)&&t.join(i),!0};var h3=Object.freeze({__proto__:null,blur:s4,clearContent:o4,clearNodes:a4,command:l4,createParagraphNear:c4,cut:u4,deleteCurrentNode:h4,deleteNode:d4,deleteRange:p4,deleteSelection:f4,enter:m4,exitCode:g4,extendMarkRange:_4,first:b4,focus:x4,forEach:v4,insertContent:w4,insertContentAt:E4,joinBackward:M4,joinDown:T4,joinForward:A4,joinItemBackward:I4,joinItemForward:P4,joinTextblockBackward:D4,joinTextblockForward:O4,joinUp:C4,keyboardShortcut:N4,lift:B4,liftEmptyBlock:R4,liftListItem:L4,newlineInCode:V4,resetAttributes:F4,scrollIntoView:$4,selectAll:j4,selectNodeBackward:U4,selectNodeForward:H4,selectParentNode:q4,selectTextblockEnd:W4,selectTextblockStart:G4,setContent:Z4,setMark:i3,setMeta:r3,setNode:s3,setNodeSelection:o3,setTextSelection:a3,sinkListItem:l3,splitBlock:c3,splitListItem:u3,toggleList:(t,e,n,i={})=>({editor:r,tr:a,state:u,dispatch:l,chain:g,commands:b,can:S})=>{const{extensions:E,splittableMarks:C}=r.extensionManager,P=Mi(t,u.schema),D=Mi(e,u.schema),{selection:R,storedMarks:j}=u,{$from:W,$to:ee}=R,le=W.blockRange(ee),J=j||R.$to.parentOffset&&R.$from.marks();if(!le)return!1;const Te=k0(xe=>x2(xe.type.name,E))(R);if(le.depth>=1&&Te&&le.depth-Te.depth<=1){if(Te.node.type===P)return b.liftListItem(D);if(x2(Te.node.type.name,E)&&P.validContent(Te.node.content)&&l)return g().command(()=>(a.setNodeMarkup(Te.pos,P),!0)).command(()=>C0(a,P)).command(()=>T0(a,P)).run()}return!n||!J||!l?g().command(()=>S().wrapInList(P,i)?!0:b.clearNodes()).wrapInList(P,i).command(()=>C0(a,P)).command(()=>T0(a,P)).run():g().command(()=>{const xe=S().wrapInList(P,i),Ae=J.filter($e=>C.includes($e.type.name));return a.ensureMarks(Ae),xe?!0:b.clearNodes()}).wrapInList(P,i).command(()=>C0(a,P)).command(()=>T0(a,P)).run()},toggleMark:(t,e={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,u=Ea(t,i.schema);return S0(i,u,e)?r.unsetMark(u,{extendEmptyMarkRange:a}):r.setMark(u,e)},toggleNode:(t,e,n={})=>({state:i,commands:r})=>{const a=Mi(t,i.schema),u=Mi(e,i.schema),l=Bh(i,a,n);let g;return i.selection.$anchor.sameParent(i.selection.$head)&&(g=i.selection.$anchor.parent.attrs),l?r.setNode(u,g):r.setNode(a,{...g,...n})},toggleWrap:(t,e={})=>({state:n,commands:i})=>{const r=Mi(t,n.schema);return Bh(n,r,e)?i.lift(r):i.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let a;if(r.spec.isInputRules&&(a=r.getState(t))){if(e){const u=t.tr,l=a.transform;for(let g=l.steps.length-1;g>=0;g-=1)u.step(l.steps[g].invert(l.docs[g]));if(a.text){const g=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,g))}else u.delete(a.from,a.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:i,ranges:r}=n;return i||e&&r.forEach(a=>{t.removeMark(a.$from.pos,a.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:i,dispatch:r})=>{var a;const{extendEmptyMarkRange:u=!1}=e,{selection:l}=n,g=Ea(t,i.schema),{$from:b,empty:S,ranges:E}=l;if(!r)return!0;if(S&&u){let{from:C,to:P}=l;const D=(a=b.marks().find(j=>j.type===g))===null||a===void 0?void 0:a.attrs,R=_0(b,g,D);R&&(C=R.from,P=R.to),n.removeMark(C,P,g)}else E.forEach(C=>{n.removeMark(C.$from.pos,C.$to.pos,g)});return n.removeStoredMark(g),!0},updateAttributes:(t,e={})=>({tr:n,state:i,dispatch:r})=>{let a=null,u=null;const l=Vf(typeof t=="string"?t:t.name,i.schema);return l?(l==="node"&&(a=Mi(t,i.schema)),l==="mark"&&(u=Ea(t,i.schema)),r&&n.selection.ranges.forEach(g=>{const b=g.$from.pos,S=g.$to.pos;i.doc.nodesBetween(b,S,(E,C)=>{a&&a===E.type&&n.setNodeMarkup(C,void 0,{...E.attrs,...e}),u&&E.marks.length&&E.marks.forEach(P=>{if(u===P.type){const D=Math.max(C,b),R=Math.min(C+E.nodeSize,S);n.addMark(D,R,u.create({...P.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:i})=>{const r=Mi(t,n.schema);return BL(r,e)(n,i)},wrapInList:(t,e={})=>({state:n,dispatch:i})=>{const r=Mi(t,n.schema);return RL(r,e)(n,i)}});const d3=Ai.create({name:"commands",addCommands(){return{...h3}}}),p3=Ai.create({name:"drop",addProseMirrorPlugins(){return[new Fi({key:new Mr("tiptapDrop"),props:{handleDrop:(t,e,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:i})}}})]}}),f3=Ai.create({name:"editable",addProseMirrorPlugins(){return[new Fi({key:new Mr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),m3=Ai.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Fi({key:new Mr("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const i=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1},blur:(e,n)=>{t.isFocused=!1;const i=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1}}}})]}}),g3=Ai.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:u})=>[()=>u.undoInputRule(),()=>u.command(({tr:l})=>{const{selection:g,doc:b}=l,{empty:S,$anchor:E}=g,{pos:C,parent:P}=E,D=E.parent.isTextblock&&C>0?l.doc.resolve(C-1):E,R=D.parent.type.spec.isolating,j=E.pos-E.parentOffset,W=R&&D.parent.childCount===1?j===E.pos:Gt.atStart(b).from===C;return!S||!P.type.isTextblock||P.textContent.length||!W||W&&E.parent.type.name==="paragraph"?!1:u.clearNodes()}),()=>u.deleteSelection(),()=>u.joinBackward(),()=>u.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:u})=>[()=>u.deleteSelection(),()=>u.deleteCurrentNode(),()=>u.joinForward(),()=>u.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:u})=>[()=>u.newlineInCode(),()=>u.createParagraphNear(),()=>u.liftEmptyBlock(),()=>u.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},a={...i,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return x0()||y2()?a:r},addProseMirrorPlugins(){return[new Fi({key:new Mr("clearDocument"),appendTransaction:(t,e,n)=>{const i=t.some(R=>R.docChanged)&&!e.doc.eq(n.doc),r=t.some(R=>R.getMeta("preventClearDocument"));if(!i||r)return;const{empty:a,from:u,to:l}=e.selection,g=Gt.atStart(e.doc).from,b=Gt.atEnd(e.doc).to;if(a||!(u===g&&l===b)||!E0(n.doc))return;const C=n.tr,P=Af({state:n,transaction:C}),{commands:D}=new If({editor:this.editor,state:P});if(D.clearNodes(),!!C.steps.length)return C}})]}}),y3=Ai.create({name:"paste",addProseMirrorPlugins(){return[new Fi({key:new Mr("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_3=Ai.create({name:"tabindex",addProseMirrorPlugins(){return[new Fi({key:new Mr("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Dl{get name(){return this.node.type.name}constructor(e,n,i=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=e,this.editor=n,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,i=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,i=this.to-1}this.editor.commands.insertContentAt({from:n,to:i},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Dl(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Dl(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Dl(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,i)=>{const r=n.isBlock&&!n.isTextblock,a=this.pos+i+1,u=this.resolvedPos.doc.resolve(a);if(!r&&u.depth<=this.depth)return;const l=new Dl(u,this.editor,r,r?n:null);r&&(l.actualDepth=this.depth+1),e.push(new Dl(u,this.editor,r,r?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let i=null,r=this.parent;for(;r&&!i;){if(r.node.type.name===e)if(Object.keys(n).length>0){const a=r.node.attrs,u=Object.keys(n);for(let l=0;l<u.length;l+=1){const g=u[l];if(a[g]!==n[g])break}}else i=r;r=r.parent}return i}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},i=!1){let r=[];if(!this.children||this.children.length===0)return r;const a=Object.keys(n);return this.children.forEach(u=>{i&&r.length>0||(u.node.type.name===e&&a.every(g=>n[g]===u.node.attrs[g])&&r.push(u),!(i&&r.length>0)&&(r=r.concat(u.querySelectorAll(e,n,i))))}),r}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const b3=`.ProseMirror {
|
641
|
+
`,textSerializers:u={}}=n||{};let l="";return t.nodesBetween(i,r,(g,b,S,E)=>{var C;g.isBlock&&b>i&&(l+=a);const P=u==null?void 0:u[g.type.name];if(P)return S&&(l+=P({node:g,pos:b,parent:S,index:E,range:e})),!1;g.isText&&(l+=(C=g==null?void 0:g.text)===null||C===void 0?void 0:C.slice(Math.max(i,b)-b,r-b))}),l}function f2(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const r3=Ai.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Fi({key:new Mr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:i,selection:r}=e,{ranges:a}=r,u=Math.min(...a.map(S=>S.$from.pos)),l=Math.max(...a.map(S=>S.$to.pos)),g=f2(n);return p2(i,{from:u,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:g})}}})]}}),s3=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),o3=(t=!1)=>({commands:e})=>e.setContent("",t),a3=()=>({state:t,tr:e,dispatch:n})=>{const{selection:i}=e,{ranges:r}=i;return n&&r.forEach(({$from:a,$to:u})=>{t.doc.nodesBetween(a.pos,u.pos,(l,g)=>{if(l.type.isText)return;const{doc:b,mapping:S}=e,E=b.resolve(S.map(g)),C=b.resolve(S.map(g+l.nodeSize)),P=E.blockRange(C);if(!P)return;const D=Dc(P);if(l.type.isTextblock){const{defaultType:R}=E.parent.contentMatchAt(E.index());e.setNodeMarkup(P.start,R)}(D||D===0)&&e.lift(P,D)})}),!0},l3=t=>e=>t(e),c3=()=>({state:t,dispatch:e})=>IL(t,e),u3=(t,e)=>({editor:n,tr:i})=>{const{state:r}=n,a=r.doc.slice(t.from,t.to);i.deleteRange(t.from,t.to);const u=i.mapping.map(e);return i.insert(u,a.content),i.setSelection(new Ft(i.doc.resolve(u-1))),!0},h3=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,i=n.$anchor.node();if(i.content.size>0)return!1;const r=t.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===i.type){if(e){const l=r.before(a),g=r.after(a);t.delete(l,g).scrollIntoView()}return!0}return!1},d3=t=>({tr:e,state:n,dispatch:i})=>{const r=Mi(t,n.schema),a=e.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===r){if(i){const g=a.before(u),b=a.after(u);e.delete(g,b).scrollIntoView()}return!0}return!1},p3=t=>({tr:e,dispatch:n})=>{const{from:i,to:r}=t;return n&&e.delete(i,r),!0},f3=()=>({state:t,dispatch:e})=>_L(t,e),m3=()=>({commands:t})=>t.keyboardShortcut("Enter"),g3=()=>({state:t,dispatch:e})=>AL(t,e);function Bf(t,e,n={strict:!0}){const i=Object.keys(e);return i.length?i.every(r=>n.strict?e[r]===t[r]:g0(e[r])?e[r].test(t[r]):e[r]===t[r]):!0}function y0(t,e,n={}){return t.find(i=>i.type===e&&Bf(i.attrs,n))}function y3(t,e,n={}){return!!y0(t,e,n)}function _0(t,e,n={}){if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if(t.parentOffset===i.offset&&i.offset!==0&&(i=t.parent.childBefore(t.parentOffset)),!i.node)return;const r=y0([...i.node.marks],e,n);if(!r)return;let a=i.index,u=t.start()+i.offset,l=a+1,g=u+i.node.nodeSize;for(y0([...i.node.marks],e,n);a>0&&r.isInSet(t.parent.child(a-1).marks);)a-=1,u-=t.parent.child(a).nodeSize;for(;l<t.parent.childCount&&y3([...t.parent.child(l).marks],e,n);)g+=t.parent.child(l).nodeSize,l+=1;return{from:u,to:g}}function Ea(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const _3=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const a=Ea(t,i.schema),{doc:u,selection:l}=n,{$from:g,from:b,to:S}=l;if(r){const E=_0(g,a,e);if(E&&E.from<=b&&E.to>=S){const C=Ft.create(u,E.from,E.to);n.setSelection(C)}}return!0},b3=t=>e=>{const n=typeof t=="function"?t(e):t;for(let i=0;i<n.length;i+=1)if(n[i](e))return!0;return!1};function b0(t){return t instanceof Ft}function Ro(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function m2(t,e=null){if(!e)return null;const n=Gt.atStart(t),i=Gt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return i;const r=n.from,a=i.to;return e==="all"?Ft.create(t,Ro(0,r,a),Ro(t.content.size,r,a)):Ft.create(t,Ro(e,r,a),Ro(e,r,a))}function x0(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const x3=(t=null,e={})=>({editor:n,view:i,tr:r,dispatch:a})=>{e={scrollIntoView:!0,...e};const u=()=>{x0()&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(i.hasFocus()&&t===null||t===!1)return!0;if(a&&t===null&&!b0(n.state.selection))return u(),!0;const l=m2(r.doc,t)||n.state.selection,g=n.state.selection.eq(l);return a&&(g||r.setSelection(l),g&&r.storedMarks&&r.setStoredMarks(r.storedMarks),u()),!0},v3=(t,e)=>n=>t.every((i,r)=>e(i,{...n,index:r})),w3=(t,e)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),g2=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const i=e[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?t.removeChild(i):i.nodeType===1&&g2(i)}return t};function Rf(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return g2(n)}function Lf(t,e,n){n={slice:!0,parseOptions:{},...n};const i=typeof t=="object"&&t!==null,r=typeof t=="string";if(i)try{if(Array.isArray(t)&&t.length>0)return Ve.fromArray(t.map(l=>e.nodeFromJSON(l)));const u=e.nodeFromJSON(t);return n.errorOnInvalidContent&&u.check(),u}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",a),Lf("",e,n)}if(r){if(n.errorOnInvalidContent){let u=!1,l="";const g=new cw({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:b=>(u=!0,l=typeof b=="string"?b:b.outerHTML,null)}]}})});if(n.slice?xh.fromSchema(g).parseSlice(Rf(t),n.parseOptions):xh.fromSchema(g).parse(Rf(t),n.parseOptions),n.errorOnInvalidContent&&u)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const a=xh.fromSchema(e);return n.slice?a.parseSlice(Rf(t),n.parseOptions).content:a.parse(Rf(t),n.parseOptions)}return Lf("",e,n)}function k3(t,e,n){const i=t.steps.length-1;if(i<e)return;const r=t.steps[i];if(!(r instanceof Ci||r instanceof Ti))return;const a=t.mapping.maps[i];let u=0;a.forEach((l,g,b,S)=>{u===0&&(u=S)}),t.setSelection(Gt.near(t.doc.resolve(u),n))}const S3=t=>!("type"in t),E3=(t,e,n)=>({tr:i,dispatch:r,editor:a})=>{var u;if(r){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=Lf(e,a.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(u=n.errorOnInvalidContent)!==null&&u!==void 0?u:a.options.enableContentCheck})}catch(D){return a.emit("contentError",{editor:a,error:D,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:g,to:b}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},S=!0,E=!0;if((S3(l)?l:[l]).forEach(D=>{D.check(),S=S?D.isText&&D.marks.length===0:!1,E=E?D.isBlock:!1}),g===b&&E){const{parent:D}=i.doc.resolve(g);D.isTextblock&&!D.type.spec.code&&!D.childCount&&(g-=1,b+=1)}let P;S?(Array.isArray(e)?P=e.map(D=>D.text||"").join(""):typeof e=="object"&&e&&e.text?P=e.text:P=e,i.insertText(P,g,b)):(P=l,i.replaceWith(g,b,P)),n.updateSelection&&k3(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:g,text:P}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:g,text:P})}return!0},C3=()=>({state:t,dispatch:e})=>EL(t,e),T3=()=>({state:t,dispatch:e})=>CL(t,e),M3=()=>({state:t,dispatch:e})=>bL(t,e),A3=()=>({state:t,dispatch:e})=>kL(t,e),I3=()=>({state:t,dispatch:e,tr:n})=>{try{const i=gf(t.doc,t.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},P3=()=>({state:t,dispatch:e,tr:n})=>{try{const i=gf(t.doc,t.selection.$from.pos,1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},D3=()=>({state:t,dispatch:e})=>xL(t,e),O3=()=>({state:t,dispatch:e})=>vL(t,e);function y2(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function z3(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let i,r,a,u;for(let l=0;l<e.length-1;l+=1){const g=e[l];if(/^(cmd|meta|m)$/i.test(g))u=!0;else if(/^a(lt)?$/i.test(g))i=!0;else if(/^(c|ctrl|control)$/i.test(g))r=!0;else if(/^s(hift)?$/i.test(g))a=!0;else if(/^mod$/i.test(g))x0()||y2()?u=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${g}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),u&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const N3=t=>({editor:e,view:n,tr:i,dispatch:r})=>{const a=z3(t).split(/-(?!$)/),u=a.find(b=>!["Alt","Ctrl","Meta","Shift"].includes(b)),l=new KeyboardEvent("keydown",{key:u==="Space"?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),g=e.captureTransaction(()=>{n.someProp("handleKeyDown",b=>b(n,l))});return g==null||g.steps.forEach(b=>{const S=b.map(i.mapping);S&&r&&i.maybeStep(S)}),!0};function Bh(t,e,n={}){const{from:i,to:r,empty:a}=t.selection,u=e?Mi(e,t.schema):null,l=[];t.doc.nodesBetween(i,r,(E,C)=>{if(E.isText)return;const P=Math.max(i,C),D=Math.min(r,C+E.nodeSize);l.push({node:E,from:P,to:D})});const g=r-i,b=l.filter(E=>u?u.name===E.node.type.name:!0).filter(E=>Bf(E.node.attrs,n,{strict:!1}));return a?!!b.length:b.reduce((E,C)=>E+C.to-C.from,0)>=g}const B3=(t,e={})=>({state:n,dispatch:i})=>{const r=Mi(t,n.schema);return Bh(n,r,e)?TL(n,i):!1},R3=()=>({state:t,dispatch:e})=>PL(t,e),L3=t=>({state:e,dispatch:n})=>{const i=Mi(t,e.schema);return VL(i)(e,n)},V3=()=>({state:t,dispatch:e})=>ML(t,e);function Vf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function _2(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((i,r)=>(n.includes(r)||(i[r]=t[r]),i),{})}const F3=(t,e)=>({tr:n,state:i,dispatch:r})=>{let a=null,u=null;const l=Vf(typeof t=="string"?t:t.name,i.schema);return l?(l==="node"&&(a=Mi(t,i.schema)),l==="mark"&&(u=Ea(t,i.schema)),r&&n.selection.ranges.forEach(g=>{i.doc.nodesBetween(g.$from.pos,g.$to.pos,(b,S)=>{a&&a===b.type&&n.setNodeMarkup(S,void 0,_2(b.attrs,e)),u&&b.marks.length&&b.marks.forEach(E=>{u===E.type&&n.addMark(S,S+b.nodeSize,u.create(_2(E.attrs,e)))})})}),!0):!1},$3=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),j3=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),U3=()=>({state:t,dispatch:e})=>wL(t,e),H3=()=>({state:t,dispatch:e})=>SL(t,e),q3=()=>({state:t,dispatch:e})=>DL(t,e),W3=()=>({state:t,dispatch:e})=>NL(t,e),G3=()=>({state:t,dispatch:e})=>zL(t,e);function v0(t,e,n={},i={}){return Lf(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const Z3=(t,e=!1,n={},i={})=>({editor:r,tr:a,dispatch:u,commands:l})=>{var g,b;const{doc:S}=a;if(n.preserveWhitespace!=="full"){const E=v0(t,r.schema,n,{errorOnInvalidContent:(g=i.errorOnInvalidContent)!==null&&g!==void 0?g:r.options.enableContentCheck});return u&&a.replaceWith(0,S.content.size,E).setMeta("preventUpdate",!e),!0}return u&&a.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:S.content.size},t,{parseOptions:n,errorOnInvalidContent:(b=i.errorOnInvalidContent)!==null&&b!==void 0?b:r.options.enableContentCheck})};function w0(t,e){const n=Ea(e,t.schema),{from:i,to:r,empty:a}=t.selection,u=[];a?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,r,g=>{u.push(...g.marks)});const l=u.find(g=>g.type.name===n.name);return l?{...l.attrs}:{}}function Y3(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function X3(t,e){for(let n=t.depth;n>0;n-=1){const i=t.node(n);if(e(i))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}}function k0(t){return e=>X3(e.$from,t)}function K3(t,e){const n=Sl.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function J3(t,e){const n={from:0,to:t.content.size};return p2(t,n,e)}function Q3(t,e){const n=Mi(e,t.schema),{from:i,to:r}=t.selection,a=[];t.doc.nodesBetween(i,r,l=>{a.push(l)});const u=a.reverse().find(l=>l.type.name===n.name);return u?{...u.attrs}:{}}function e4(t,e){const n=Vf(typeof e=="string"?e:e.name,t.schema);return n==="node"?Q3(t,e):n==="mark"?w0(t,e):{}}function b2(t,e,n){const i=[];return t===e?n.resolve(t).marks().forEach(r=>{const a=n.resolve(t),u=_0(a,r.type);u&&i.push({mark:r,...u})}):n.nodesBetween(t,e,(r,a)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(u=>({from:a,to:a+r.nodeSize,mark:u})))}),i}function Ff(t,e,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=t.find(a=>a.type===e&&a.name===i);return r?r.attribute.keepOnSplit:!1}))}function S0(t,e,n={}){const{empty:i,ranges:r}=t.selection,a=e?Ea(e,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(E=>a?a.name===E.type.name:!0).find(E=>Bf(E.attrs,n,{strict:!1}));let u=0;const l=[];if(r.forEach(({$from:E,$to:C})=>{const P=E.pos,D=C.pos;t.doc.nodesBetween(P,D,(R,j)=>{if(!R.isText&&!R.marks.length)return;const W=Math.max(P,j),ee=Math.min(D,j+R.nodeSize),le=ee-W;u+=le,l.push(...R.marks.map(J=>({mark:J,from:W,to:ee})))})}),u===0)return!1;const g=l.filter(E=>a?a.name===E.mark.type.name:!0).filter(E=>Bf(E.mark.attrs,n,{strict:!1})).reduce((E,C)=>E+C.to-C.from,0),b=l.filter(E=>a?E.mark.type!==a&&E.mark.type.excludes(a):!0).reduce((E,C)=>E+C.to-C.from,0);return(g>0?g+b:g)>=u}function t4(t,e,n={}){if(!e)return Bh(t,null,n)||S0(t,null,n);const i=Vf(e,t.schema);return i==="node"?Bh(t,e,n):i==="mark"?S0(t,e,n):!1}function x2(t,e){const{nodeExtensions:n}=Pf(e),i=n.find(u=>u.name===t);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},a=nn(kt(i,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function E0(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((i=t.text)!==null&&i!==void 0?i:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let r=!0;return t.content.forEach(a=>{r!==!1&&(E0(a,{ignoreWhitespace:n,checkChildren:e})||(r=!1))}),r}return!1}function v2(t){return t instanceof zt}function w2(t,e,n){const r=t.state.doc.content.size,a=Ro(e,0,r),u=Ro(n,0,r),l=t.coordsAtPos(a),g=t.coordsAtPos(u,-1),b=Math.min(l.top,g.top),S=Math.max(l.bottom,g.bottom),E=Math.min(l.left,g.left),C=Math.max(l.right,g.right),P=C-E,D=S-b,W={top:b,bottom:S,left:E,right:C,width:P,height:D,x:E,y:b};return{...W,toJSON:()=>W}}function n4(t,e,n){var i;const{selection:r}=e;let a=null;if(b0(r)&&(a=r.$cursor),a){const l=(i=t.storedMarks)!==null&&i!==void 0?i:a.marks();return!!n.isInSet(l)||!l.some(g=>g.type.excludes(n))}const{ranges:u}=r;return u.some(({$from:l,$to:g})=>{let b=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,g.pos,(S,E,C)=>{if(b)return!1;if(S.isInline){const P=!C||C.type.allowsMarkType(n),D=!!n.isInSet(S.marks)||!S.marks.some(R=>R.type.excludes(n));b=P&&D}return!b}),b})}const i4=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const{selection:a}=n,{empty:u,ranges:l}=a,g=Ea(t,i.schema);if(r)if(u){const b=w0(i,g);n.addStoredMark(g.create({...b,...e}))}else l.forEach(b=>{const S=b.$from.pos,E=b.$to.pos;i.doc.nodesBetween(S,E,(C,P)=>{const D=Math.max(P,S),R=Math.min(P+C.nodeSize,E);C.marks.find(W=>W.type===g)?C.marks.forEach(W=>{g===W.type&&n.addMark(D,R,g.create({...W.attrs,...e}))}):n.addMark(D,R,g.create(e))})});return n4(i,n,g)},r4=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),s4=(t,e={})=>({state:n,dispatch:i,chain:r})=>{const a=Mi(t,n.schema);return a.isTextblock?r().command(({commands:u})=>a2(a,e)(n)?!0:u.clearNodes()).command(({state:u})=>a2(a,e)(u,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},o4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,r=Ro(t,0,i.content.size),a=zt.create(i,r);e.setSelection(a)}return!0},a4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,{from:r,to:a}=typeof t=="number"?{from:t,to:t}:t,u=Ft.atStart(i).from,l=Ft.atEnd(i).to,g=Ro(r,u,l),b=Ro(a,u,l),S=Ft.create(i,g,b);e.setSelection(S)}return!0},l4=t=>({state:e,dispatch:n})=>{const i=Mi(t,e.schema);return jL(i)(e,n)};function k2(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const i=n.filter(r=>e==null?void 0:e.includes(r.type.name));t.tr.ensureMarks(i)}}const c4=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:i,editor:r})=>{const{selection:a,doc:u}=e,{$from:l,$to:g}=a,b=r.extensionManager.attributes,S=Ff(b,l.node().type.name,l.node().attrs);if(a instanceof zt&&a.node.isBlock)return!l.parentOffset||!Oc(u,l.pos)?!1:(i&&(t&&k2(n,r.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const E=g.parentOffset===g.parent.content.size,C=l.depth===0?void 0:Y3(l.node(-1).contentMatchAt(l.indexAfter(-1)));let P=E&&C?[{type:C,attrs:S}]:void 0,D=Oc(e.doc,e.mapping.map(l.pos),1,P);if(!P&&!D&&Oc(e.doc,e.mapping.map(l.pos),1,C?[{type:C}]:void 0)&&(D=!0,P=C?[{type:C,attrs:S}]:void 0),i){if(D&&(a instanceof Ft&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,P),C&&!E&&!l.parentOffset&&l.parent.type!==C)){const R=e.mapping.map(l.before()),j=e.doc.resolve(R);l.node(-1).canReplaceWith(j.index(),j.index()+1,C)&&e.setNodeMarkup(e.mapping.map(l.before()),C)}t&&k2(n,r.extensionManager.splittableMarks),e.scrollIntoView()}return D},u4=(t,e={})=>({tr:n,state:i,dispatch:r,editor:a})=>{var u;const l=Mi(t,i.schema),{$from:g,$to:b}=i.selection,S=i.selection.node;if(S&&S.isBlock||g.depth<2||!g.sameParent(b))return!1;const E=g.node(-1);if(E.type!==l)return!1;const C=a.extensionManager.attributes;if(g.parent.content.size===0&&g.node(-1).childCount===g.indexAfter(-1)){if(g.depth===2||g.node(-3).type!==l||g.index(-2)!==g.node(-2).childCount-1)return!1;if(r){let W=Ve.empty;const ee=g.index(-1)?1:g.index(-2)?2:3;for(let $e=g.depth-ee;$e>=g.depth-3;$e-=1)W=Ve.from(g.node($e).copy(W));const le=g.indexAfter(-1)<g.node(-2).childCount?1:g.indexAfter(-2)<g.node(-3).childCount?2:3,J={...Ff(C,g.node().type.name,g.node().attrs),...e},Te=((u=l.contentMatch.defaultType)===null||u===void 0?void 0:u.createAndFill(J))||void 0;W=W.append(Ve.from(l.createAndFill(null,Te)||void 0));const xe=g.before(g.depth-(ee-1));n.replace(xe,g.after(-le),new dt(W,4-ee,0));let Ae=-1;n.doc.nodesBetween(xe,n.doc.content.size,($e,Pe)=>{if(Ae>-1)return!1;$e.isTextblock&&$e.content.size===0&&(Ae=Pe+1)}),Ae>-1&&n.setSelection(Ft.near(n.doc.resolve(Ae))),n.scrollIntoView()}return!0}const P=b.pos===g.end()?E.contentMatchAt(0).defaultType:null,D={...Ff(C,E.type.name,E.attrs),...e},R={...Ff(C,g.node().type.name,g.node().attrs),...e};n.delete(g.pos,b.pos);const j=P?[{type:l,attrs:D},{type:P,attrs:R}]:[{type:l,attrs:D}];if(!Oc(n.doc,g.pos,2))return!1;if(r){const{selection:W,storedMarks:ee}=i,{splittableMarks:le}=a.extensionManager,J=ee||W.$to.parentOffset&&W.$from.marks();if(n.split(g.pos,2,j).scrollIntoView(),!J||!r)return!0;const Te=J.filter(xe=>le.includes(xe.type.name));n.ensureMarks(Te)}return!0},C0=(t,e)=>{const n=k0(u=>u.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&ma(t.doc,n.pos)&&t.join(n.pos),!0},T0=(t,e)=>{const n=k0(u=>u.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&ma(t.doc,i)&&t.join(i),!0};var h4=Object.freeze({__proto__:null,blur:s3,clearContent:o3,clearNodes:a3,command:l3,createParagraphNear:c3,cut:u3,deleteCurrentNode:h3,deleteNode:d3,deleteRange:p3,deleteSelection:f3,enter:m3,exitCode:g3,extendMarkRange:_3,first:b3,focus:x3,forEach:v3,insertContent:w3,insertContentAt:E3,joinBackward:M3,joinDown:T3,joinForward:A3,joinItemBackward:I3,joinItemForward:P3,joinTextblockBackward:D3,joinTextblockForward:O3,joinUp:C3,keyboardShortcut:N3,lift:B3,liftEmptyBlock:R3,liftListItem:L3,newlineInCode:V3,resetAttributes:F3,scrollIntoView:$3,selectAll:j3,selectNodeBackward:U3,selectNodeForward:H3,selectParentNode:q3,selectTextblockEnd:W3,selectTextblockStart:G3,setContent:Z3,setMark:i4,setMeta:r4,setNode:s4,setNodeSelection:o4,setTextSelection:a4,sinkListItem:l4,splitBlock:c4,splitListItem:u4,toggleList:(t,e,n,i={})=>({editor:r,tr:a,state:u,dispatch:l,chain:g,commands:b,can:S})=>{const{extensions:E,splittableMarks:C}=r.extensionManager,P=Mi(t,u.schema),D=Mi(e,u.schema),{selection:R,storedMarks:j}=u,{$from:W,$to:ee}=R,le=W.blockRange(ee),J=j||R.$to.parentOffset&&R.$from.marks();if(!le)return!1;const Te=k0(xe=>x2(xe.type.name,E))(R);if(le.depth>=1&&Te&&le.depth-Te.depth<=1){if(Te.node.type===P)return b.liftListItem(D);if(x2(Te.node.type.name,E)&&P.validContent(Te.node.content)&&l)return g().command(()=>(a.setNodeMarkup(Te.pos,P),!0)).command(()=>C0(a,P)).command(()=>T0(a,P)).run()}return!n||!J||!l?g().command(()=>S().wrapInList(P,i)?!0:b.clearNodes()).wrapInList(P,i).command(()=>C0(a,P)).command(()=>T0(a,P)).run():g().command(()=>{const xe=S().wrapInList(P,i),Ae=J.filter($e=>C.includes($e.type.name));return a.ensureMarks(Ae),xe?!0:b.clearNodes()}).wrapInList(P,i).command(()=>C0(a,P)).command(()=>T0(a,P)).run()},toggleMark:(t,e={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,u=Ea(t,i.schema);return S0(i,u,e)?r.unsetMark(u,{extendEmptyMarkRange:a}):r.setMark(u,e)},toggleNode:(t,e,n={})=>({state:i,commands:r})=>{const a=Mi(t,i.schema),u=Mi(e,i.schema),l=Bh(i,a,n);let g;return i.selection.$anchor.sameParent(i.selection.$head)&&(g=i.selection.$anchor.parent.attrs),l?r.setNode(u,g):r.setNode(a,{...g,...n})},toggleWrap:(t,e={})=>({state:n,commands:i})=>{const r=Mi(t,n.schema);return Bh(n,r,e)?i.lift(r):i.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let a;if(r.spec.isInputRules&&(a=r.getState(t))){if(e){const u=t.tr,l=a.transform;for(let g=l.steps.length-1;g>=0;g-=1)u.step(l.steps[g].invert(l.docs[g]));if(a.text){const g=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,g))}else u.delete(a.from,a.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:i,ranges:r}=n;return i||e&&r.forEach(a=>{t.removeMark(a.$from.pos,a.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:i,dispatch:r})=>{var a;const{extendEmptyMarkRange:u=!1}=e,{selection:l}=n,g=Ea(t,i.schema),{$from:b,empty:S,ranges:E}=l;if(!r)return!0;if(S&&u){let{from:C,to:P}=l;const D=(a=b.marks().find(j=>j.type===g))===null||a===void 0?void 0:a.attrs,R=_0(b,g,D);R&&(C=R.from,P=R.to),n.removeMark(C,P,g)}else E.forEach(C=>{n.removeMark(C.$from.pos,C.$to.pos,g)});return n.removeStoredMark(g),!0},updateAttributes:(t,e={})=>({tr:n,state:i,dispatch:r})=>{let a=null,u=null;const l=Vf(typeof t=="string"?t:t.name,i.schema);return l?(l==="node"&&(a=Mi(t,i.schema)),l==="mark"&&(u=Ea(t,i.schema)),r&&n.selection.ranges.forEach(g=>{const b=g.$from.pos,S=g.$to.pos;i.doc.nodesBetween(b,S,(E,C)=>{a&&a===E.type&&n.setNodeMarkup(C,void 0,{...E.attrs,...e}),u&&E.marks.length&&E.marks.forEach(P=>{if(u===P.type){const D=Math.max(C,b),R=Math.min(C+E.nodeSize,S);n.addMark(D,R,u.create({...P.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:i})=>{const r=Mi(t,n.schema);return BL(r,e)(n,i)},wrapInList:(t,e={})=>({state:n,dispatch:i})=>{const r=Mi(t,n.schema);return RL(r,e)(n,i)}});const d4=Ai.create({name:"commands",addCommands(){return{...h4}}}),p4=Ai.create({name:"drop",addProseMirrorPlugins(){return[new Fi({key:new Mr("tiptapDrop"),props:{handleDrop:(t,e,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:i})}}})]}}),f4=Ai.create({name:"editable",addProseMirrorPlugins(){return[new Fi({key:new Mr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),m4=Ai.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Fi({key:new Mr("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const i=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1},blur:(e,n)=>{t.isFocused=!1;const i=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1}}}})]}}),g4=Ai.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:u})=>[()=>u.undoInputRule(),()=>u.command(({tr:l})=>{const{selection:g,doc:b}=l,{empty:S,$anchor:E}=g,{pos:C,parent:P}=E,D=E.parent.isTextblock&&C>0?l.doc.resolve(C-1):E,R=D.parent.type.spec.isolating,j=E.pos-E.parentOffset,W=R&&D.parent.childCount===1?j===E.pos:Gt.atStart(b).from===C;return!S||!P.type.isTextblock||P.textContent.length||!W||W&&E.parent.type.name==="paragraph"?!1:u.clearNodes()}),()=>u.deleteSelection(),()=>u.joinBackward(),()=>u.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:u})=>[()=>u.deleteSelection(),()=>u.deleteCurrentNode(),()=>u.joinForward(),()=>u.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:u})=>[()=>u.newlineInCode(),()=>u.createParagraphNear(),()=>u.liftEmptyBlock(),()=>u.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},a={...i,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return x0()||y2()?a:r},addProseMirrorPlugins(){return[new Fi({key:new Mr("clearDocument"),appendTransaction:(t,e,n)=>{const i=t.some(R=>R.docChanged)&&!e.doc.eq(n.doc),r=t.some(R=>R.getMeta("preventClearDocument"));if(!i||r)return;const{empty:a,from:u,to:l}=e.selection,g=Gt.atStart(e.doc).from,b=Gt.atEnd(e.doc).to;if(a||!(u===g&&l===b)||!E0(n.doc))return;const C=n.tr,P=Af({state:n,transaction:C}),{commands:D}=new If({editor:this.editor,state:P});if(D.clearNodes(),!!C.steps.length)return C}})]}}),y4=Ai.create({name:"paste",addProseMirrorPlugins(){return[new Fi({key:new Mr("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_4=Ai.create({name:"tabindex",addProseMirrorPlugins(){return[new Fi({key:new Mr("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Dl{get name(){return this.node.type.name}constructor(e,n,i=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=e,this.editor=n,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,i=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,i=this.to-1}this.editor.commands.insertContentAt({from:n,to:i},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Dl(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Dl(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Dl(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,i)=>{const r=n.isBlock&&!n.isTextblock,a=this.pos+i+1,u=this.resolvedPos.doc.resolve(a);if(!r&&u.depth<=this.depth)return;const l=new Dl(u,this.editor,r,r?n:null);r&&(l.actualDepth=this.depth+1),e.push(new Dl(u,this.editor,r,r?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let i=null,r=this.parent;for(;r&&!i;){if(r.node.type.name===e)if(Object.keys(n).length>0){const a=r.node.attrs,u=Object.keys(n);for(let l=0;l<u.length;l+=1){const g=u[l];if(a[g]!==n[g])break}}else i=r;r=r.parent}return i}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},i=!1){let r=[];if(!this.children||this.children.length===0)return r;const a=Object.keys(n);return this.children.forEach(u=>{i&&r.length>0||(u.node.type.name===e&&a.every(g=>n[g]===u.node.attrs[g])&&r.push(u),!(i&&r.length>0)&&(r=r.concat(u.querySelectorAll(e,n,i))))}),r}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const b4=`.ProseMirror {
|
642
642
|
position: relative;
|
643
643
|
}
|
644
644
|
|
@@ -712,9 +712,9 @@ img.ProseMirror-separator {
|
|
712
712
|
|
713
713
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
714
714
|
opacity: 0
|
715
|
-
}`;function
|
715
|
+
}`;function x4(t,e,n){const i=document.querySelector("style[data-tiptap-style]");if(i!==null)return i;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}let v4=class extends UL{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:i,moved:r})=>this.options.onDrop(n,i,r)),this.on("paste",({event:n,slice:i})=>this.options.onPaste(n,i)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=x4(b4,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const i=c2(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:i});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,i=this.state.reconfigure({plugins:this.state.plugins.filter(r=>!r.key.startsWith(n))});return this.view.updateState(i),i}createExtensionManager(){var e,n;const r=[...this.options.enableCoreExtensions?[f4,r3.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),d4,m4,g4,_4,p4,y4].filter(a=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[a.name]!==!1:!0):[],...this.options.extensions].filter(a=>["extension","node","mark"].includes(a==null?void 0:a.type));this.extensionManager=new Hc(r,this)}createCommandManager(){this.commandManager=new If({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=v0(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(a){if(!(a instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(a.message))throw a;this.emit("contentError",{editor:this,error:a,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(u=>u.name!=="collaboration"),this.createExtensionManager()}}),e=v0(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=m2(e,this.options.autofocus);this.view=new lL(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Rc.create({doc:e,selection:n||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(u)});return}const n=this.state.apply(e),i=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),a=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),a&&this.emit("blur",{editor:this,event:a.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return e4(this.state,e)}isActive(e,n){const i=typeof e=="string"?e:null,r=typeof e=="string"?n:e;return t4(this.state,i,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return K3(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
716
716
|
|
717
|
-
`,textSerializers:i={}}=e||{};return J4(this.state.doc,{blockSeparator:n,textSerializers:{...f2(this.schema),...i}})}get isEmpty(){return E0(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelector(e,n))||null}$nodes(e,n){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Dl(n,this)}get $doc(){return this.$pos(0)}};function qc(t){return new Df({find:t.find,handler:({state:e,range:n,match:i})=>{const r=nn(t.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:a}=e,u=i[i.length-1],l=i[0];if(u){const g=l.search(/\S/),b=n.from+l.indexOf(u),S=b+u.length;if(b2(n.from,n.to,e.doc).filter(P=>P.mark.type.excluded.find(R=>R===t.type&&R!==P.mark.type)).filter(P=>P.to>b).length)return null;S<n.to&&a.delete(S,n.to),b>n.from&&a.delete(n.from+g,b);const C=n.from+g+u.length;a.addMark(n.from+g,C,t.type.create(r||{})),a.removeStoredMark(t.type)}}})}function w3(t){return new Df({find:t.find,handler:({state:e,range:n,match:i})=>{const r=nn(t.getAttributes,void 0,i)||{},{tr:a}=e,u=n.from;let l=n.to;const g=t.type.create(r);if(i[1]){const b=i[0].lastIndexOf(i[1]);let S=u+b;S>l?S=l:l=S+i[1].length;const E=i[0][i[0].length-1];a.insertText(E,u+i[0].length-1),a.replaceWith(S,l,g)}else if(i[0]){const b=t.type.isInline?u:u-1;a.insert(b,t.type.create(r)).delete(a.mapping.map(u),a.mapping.map(l))}a.scrollIntoView()}})}function M0(t){return new Df({find:t.find,handler:({state:e,range:n,match:i})=>{const r=e.doc.resolve(n.from),a=nn(t.getAttributes,void 0,i)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,a)}})}function Rh(t){return new Df({find:t.find,handler:({state:e,range:n,match:i,chain:r})=>{const a=nn(t.getAttributes,void 0,i)||{},u=e.tr.delete(n.from,n.to),g=u.doc.resolve(n.from).blockRange(),b=g&&Ny(g,t.type,a);if(!b)return null;if(u.wrap(g,b),t.keepMarks&&t.editor){const{selection:E,storedMarks:C}=e,{splittableMarks:P}=t.editor.extensionManager,D=C||E.$to.parentOffset&&E.$from.marks();if(D){const R=D.filter(j=>P.includes(j.type.name));u.ensureMarks(R)}}if(t.keepAttributes){const E=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(E,a).run()}const S=u.doc.resolve(n.from-1).nodeBefore;S&&S.type===t.type&&ma(u.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(i,S))&&u.join(n.from-1)}})}let bs=class yb{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nn(kt(this,"addOptions",{name:this.name}))),this.storage=nn(kt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yb(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nf(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new yb(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nn(kt(n,"addOptions",{name:n.name})),n.storage=nn(kt(n,"addStorage",{name:n.name,options:n.options})),n}};function Wc(t){return new JL({find:t.find,handler:({state:e,range:n,match:i,pasteEvent:r})=>{const a=nn(t.getAttributes,void 0,i,r);if(a===!1||a===null)return null;const{tr:u}=e,l=i[i.length-1],g=i[0];let b=n.to;if(l){const S=g.search(/\S/),E=n.from+g.indexOf(l),C=E+l.length;if(b2(n.from,n.to,e.doc).filter(D=>D.mark.type.excluded.find(j=>j===t.type&&j!==D.mark.type)).filter(D=>D.to>E).length)return null;C<n.to&&u.delete(C,n.to),E>n.from&&u.delete(n.from+S,E),b=n.from+S+l.length,u.addMark(n.from+S,b,t.type.create(a||{})),u.removeStoredMark(t.type)}}})}function k3(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ir="top",xs="bottom",vs="right",Pr="left",A0="auto",Lh=[Ir,xs,vs,Pr],Gc="start",Vh="end",S3="clippingParents",S2="viewport",Fh="popper",E3="reference",E2=Lh.reduce(function(t,e){return t.concat([e+"-"+Gc,e+"-"+Vh])},[]),C2=[].concat(Lh,[A0]).reduce(function(t,e){return t.concat([e,e+"-"+Gc,e+"-"+Vh])},[]),C3="beforeRead",T3="read",M3="afterRead",A3="beforeMain",I3="main",P3="afterMain",D3="beforeWrite",O3="write",z3="afterWrite",N3=[C3,T3,M3,A3,I3,P3,D3,O3,z3];function ao(t){return t?(t.nodeName||"").toLowerCase():null}function Zr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ol(t){var e=Zr(t).Element;return t instanceof e||t instanceof Element}function ws(t){var e=Zr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function I0(t){if(typeof ShadowRoot>"u")return!1;var e=Zr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function B3(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},r=e.attributes[n]||{},a=e.elements[n];!ws(a)||!ao(a)||(Object.assign(a.style,i),Object.keys(r).forEach(function(u){var l=r[u];l===!1?a.removeAttribute(u):a.setAttribute(u,l===!0?"":l)}))})}function R3(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],a=e.attributes[i]||{},u=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),l=u.reduce(function(g,b){return g[b]="",g},{});!ws(r)||!ao(r)||(Object.assign(r.style,l),Object.keys(a).forEach(function(g){r.removeAttribute(g)}))})}}const T2={name:"applyStyles",enabled:!0,phase:"write",fn:B3,effect:R3,requires:["computeStyles"]};function lo(t){return t.split("-")[0]}var zl=Math.max,$f=Math.min,Zc=Math.round;function P0(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function M2(){return!/^((?!chrome|android).)*safari/i.test(P0())}function Yc(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),r=1,a=1;e&&ws(t)&&(r=t.offsetWidth>0&&Zc(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&Zc(i.height)/t.offsetHeight||1);var u=Ol(t)?Zr(t):window,l=u.visualViewport,g=!M2()&&n,b=(i.left+(g&&l?l.offsetLeft:0))/r,S=(i.top+(g&&l?l.offsetTop:0))/a,E=i.width/r,C=i.height/a;return{width:E,height:C,top:S,right:b+E,bottom:S+C,left:b,x:b,y:S}}function D0(t){var e=Yc(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function A2(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&I0(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Lo(t){return Zr(t).getComputedStyle(t)}function L3(t){return["table","td","th"].indexOf(ao(t))>=0}function Ca(t){return((Ol(t)?t.ownerDocument:t.document)||window.document).documentElement}function jf(t){return ao(t)==="html"?t:t.assignedSlot||t.parentNode||(I0(t)?t.host:null)||Ca(t)}function I2(t){return!ws(t)||Lo(t).position==="fixed"?null:t.offsetParent}function V3(t){var e=/firefox/i.test(P0()),n=/Trident/i.test(P0());if(n&&ws(t)){var i=Lo(t);if(i.position==="fixed")return null}var r=jf(t);for(I0(r)&&(r=r.host);ws(r)&&["html","body"].indexOf(ao(r))<0;){var a=Lo(r);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return r;r=r.parentNode}return null}function $h(t){for(var e=Zr(t),n=I2(t);n&&L3(n)&&Lo(n).position==="static";)n=I2(n);return n&&(ao(n)==="html"||ao(n)==="body"&&Lo(n).position==="static")?e:n||V3(t)||e}function O0(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function jh(t,e,n){return zl(t,$f(e,n))}function F3(t,e,n){var i=jh(t,e,n);return i>n?n:i}function P2(){return{top:0,right:0,bottom:0,left:0}}function D2(t){return Object.assign({},P2(),t)}function O2(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var $3=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,D2(typeof e!="number"?e:O2(e,Lh))};function j3(t){var e,n=t.state,i=t.name,r=t.options,a=n.elements.arrow,u=n.modifiersData.popperOffsets,l=lo(n.placement),g=O0(l),b=[Pr,vs].indexOf(l)>=0,S=b?"height":"width";if(!(!a||!u)){var E=$3(r.padding,n),C=D0(a),P=g==="y"?Ir:Pr,D=g==="y"?xs:vs,R=n.rects.reference[S]+n.rects.reference[g]-u[g]-n.rects.popper[S],j=u[g]-n.rects.reference[g],W=$h(a),ee=W?g==="y"?W.clientHeight||0:W.clientWidth||0:0,le=R/2-j/2,J=E[P],Te=ee-C[S]-E[D],xe=ee/2-C[S]/2+le,Ae=jh(J,xe,Te),$e=g;n.modifiersData[i]=(e={},e[$e]=Ae,e.centerOffset=Ae-xe,e)}}function U3(t){var e=t.state,n=t.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||A2(e.elements.popper,r)&&(e.elements.arrow=r))}const H3={name:"arrow",enabled:!0,phase:"main",fn:j3,effect:U3,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xc(t){return t.split("-")[1]}var q3={top:"auto",right:"auto",bottom:"auto",left:"auto"};function W3(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:Zc(n*r)/r||0,y:Zc(i*r)/r||0}}function z2(t){var e,n=t.popper,i=t.popperRect,r=t.placement,a=t.variation,u=t.offsets,l=t.position,g=t.gpuAcceleration,b=t.adaptive,S=t.roundOffsets,E=t.isFixed,C=u.x,P=C===void 0?0:C,D=u.y,R=D===void 0?0:D,j=typeof S=="function"?S({x:P,y:R}):{x:P,y:R};P=j.x,R=j.y;var W=u.hasOwnProperty("x"),ee=u.hasOwnProperty("y"),le=Pr,J=Ir,Te=window;if(b){var xe=$h(n),Ae="clientHeight",$e="clientWidth";if(xe===Zr(n)&&(xe=Ca(n),Lo(xe).position!=="static"&&l==="absolute"&&(Ae="scrollHeight",$e="scrollWidth")),xe=xe,r===Ir||(r===Pr||r===vs)&&a===Vh){J=xs;var Pe=E&&xe===Te&&Te.visualViewport?Te.visualViewport.height:xe[Ae];R-=Pe-i.height,R*=g?1:-1}if(r===Pr||(r===Ir||r===xs)&&a===Vh){le=vs;var Xe=E&&xe===Te&&Te.visualViewport?Te.visualViewport.width:xe[$e];P-=Xe-i.width,P*=g?1:-1}}var rt=Object.assign({position:l},b&&q3),Rt=S===!0?W3({x:P,y:R},Zr(n)):{x:P,y:R};if(P=Rt.x,R=Rt.y,g){var pt;return Object.assign({},rt,(pt={},pt[J]=ee?"0":"",pt[le]=W?"0":"",pt.transform=(Te.devicePixelRatio||1)<=1?"translate("+P+"px, "+R+"px)":"translate3d("+P+"px, "+R+"px, 0)",pt))}return Object.assign({},rt,(e={},e[J]=ee?R+"px":"",e[le]=W?P+"px":"",e.transform="",e))}function G3(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=i===void 0?!0:i,a=n.adaptive,u=a===void 0?!0:a,l=n.roundOffsets,g=l===void 0?!0:l,b={placement:lo(e.placement),variation:Xc(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,z2(Object.assign({},b,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:u,roundOffsets:g})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,z2(Object.assign({},b,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:g})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Z3={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:G3,data:{}};var Uf={passive:!0};function Y3(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,a=r===void 0?!0:r,u=i.resize,l=u===void 0?!0:u,g=Zr(e.elements.popper),b=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&b.forEach(function(S){S.addEventListener("scroll",n.update,Uf)}),l&&g.addEventListener("resize",n.update,Uf),function(){a&&b.forEach(function(S){S.removeEventListener("scroll",n.update,Uf)}),l&&g.removeEventListener("resize",n.update,Uf)}}const X3={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Y3,data:{}};var K3={left:"right",right:"left",bottom:"top",top:"bottom"};function Hf(t){return t.replace(/left|right|bottom|top/g,function(e){return K3[e]})}var J3={start:"end",end:"start"};function N2(t){return t.replace(/start|end/g,function(e){return J3[e]})}function z0(t){var e=Zr(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function N0(t){return Yc(Ca(t)).left+z0(t).scrollLeft}function Q3(t,e){var n=Zr(t),i=Ca(t),r=n.visualViewport,a=i.clientWidth,u=i.clientHeight,l=0,g=0;if(r){a=r.width,u=r.height;var b=M2();(b||!b&&e==="fixed")&&(l=r.offsetLeft,g=r.offsetTop)}return{width:a,height:u,x:l+N0(t),y:g}}function eV(t){var e,n=Ca(t),i=z0(t),r=(e=t.ownerDocument)==null?void 0:e.body,a=zl(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),u=zl(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+N0(t),g=-i.scrollTop;return Lo(r||n).direction==="rtl"&&(l+=zl(n.clientWidth,r?r.clientWidth:0)-a),{width:a,height:u,x:l,y:g}}function B0(t){var e=Lo(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function B2(t){return["html","body","#document"].indexOf(ao(t))>=0?t.ownerDocument.body:ws(t)&&B0(t)?t:B2(jf(t))}function Uh(t,e){var n;e===void 0&&(e=[]);var i=B2(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),a=Zr(i),u=r?[a].concat(a.visualViewport||[],B0(i)?i:[]):i,l=e.concat(u);return r?l:l.concat(Uh(jf(u)))}function R0(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tV(t,e){var n=Yc(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function R2(t,e,n){return e===S2?R0(Q3(t,n)):Ol(e)?tV(e,n):R0(eV(Ca(t)))}function nV(t){var e=Uh(jf(t)),n=["absolute","fixed"].indexOf(Lo(t).position)>=0,i=n&&ws(t)?$h(t):t;return Ol(i)?e.filter(function(r){return Ol(r)&&A2(r,i)&&ao(r)!=="body"}):[]}function iV(t,e,n,i){var r=e==="clippingParents"?nV(t):[].concat(e),a=[].concat(r,[n]),u=a[0],l=a.reduce(function(g,b){var S=R2(t,b,i);return g.top=zl(S.top,g.top),g.right=$f(S.right,g.right),g.bottom=$f(S.bottom,g.bottom),g.left=zl(S.left,g.left),g},R2(t,u,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function L2(t){var e=t.reference,n=t.element,i=t.placement,r=i?lo(i):null,a=i?Xc(i):null,u=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,g;switch(r){case Ir:g={x:u,y:e.y-n.height};break;case xs:g={x:u,y:e.y+e.height};break;case vs:g={x:e.x+e.width,y:l};break;case Pr:g={x:e.x-n.width,y:l};break;default:g={x:e.x,y:e.y}}var b=r?O0(r):null;if(b!=null){var S=b==="y"?"height":"width";switch(a){case Gc:g[b]=g[b]-(e[S]/2-n[S]/2);break;case Vh:g[b]=g[b]+(e[S]/2-n[S]/2);break}}return g}function Hh(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=i===void 0?t.placement:i,a=n.strategy,u=a===void 0?t.strategy:a,l=n.boundary,g=l===void 0?S3:l,b=n.rootBoundary,S=b===void 0?S2:b,E=n.elementContext,C=E===void 0?Fh:E,P=n.altBoundary,D=P===void 0?!1:P,R=n.padding,j=R===void 0?0:R,W=D2(typeof j!="number"?j:O2(j,Lh)),ee=C===Fh?E3:Fh,le=t.rects.popper,J=t.elements[D?ee:C],Te=iV(Ol(J)?J:J.contextElement||Ca(t.elements.popper),g,S,u),xe=Yc(t.elements.reference),Ae=L2({reference:xe,element:le,strategy:"absolute",placement:r}),$e=R0(Object.assign({},le,Ae)),Pe=C===Fh?$e:xe,Xe={top:Te.top-Pe.top+W.top,bottom:Pe.bottom-Te.bottom+W.bottom,left:Te.left-Pe.left+W.left,right:Pe.right-Te.right+W.right},rt=t.modifiersData.offset;if(C===Fh&&rt){var Rt=rt[r];Object.keys(Xe).forEach(function(pt){var Nt=[vs,xs].indexOf(pt)>=0?1:-1,Xt=[Ir,xs].indexOf(pt)>=0?"y":"x";Xe[pt]+=Rt[Xt]*Nt})}return Xe}function rV(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=n.boundary,a=n.rootBoundary,u=n.padding,l=n.flipVariations,g=n.allowedAutoPlacements,b=g===void 0?C2:g,S=Xc(i),E=S?l?E2:E2.filter(function(D){return Xc(D)===S}):Lh,C=E.filter(function(D){return b.indexOf(D)>=0});C.length===0&&(C=E);var P=C.reduce(function(D,R){return D[R]=Hh(t,{placement:R,boundary:r,rootBoundary:a,padding:u})[lo(R)],D},{});return Object.keys(P).sort(function(D,R){return P[D]-P[R]})}function sV(t){if(lo(t)===A0)return[];var e=Hf(t);return[N2(t),e,N2(e)]}function oV(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,a=r===void 0?!0:r,u=n.altAxis,l=u===void 0?!0:u,g=n.fallbackPlacements,b=n.padding,S=n.boundary,E=n.rootBoundary,C=n.altBoundary,P=n.flipVariations,D=P===void 0?!0:P,R=n.allowedAutoPlacements,j=e.options.placement,W=lo(j),ee=W===j,le=g||(ee||!D?[Hf(j)]:sV(j)),J=[j].concat(le).reduce(function(Bn,Pn){return Bn.concat(lo(Pn)===A0?rV(e,{placement:Pn,boundary:S,rootBoundary:E,padding:b,flipVariations:D,allowedAutoPlacements:R}):Pn)},[]),Te=e.rects.reference,xe=e.rects.popper,Ae=new Map,$e=!0,Pe=J[0],Xe=0;Xe<J.length;Xe++){var rt=J[Xe],Rt=lo(rt),pt=Xc(rt)===Gc,Nt=[Ir,xs].indexOf(Rt)>=0,Xt=Nt?"width":"height",rn=Hh(e,{placement:rt,boundary:S,rootBoundary:E,altBoundary:C,padding:b}),jt=Nt?pt?vs:Pr:pt?xs:Ir;Te[Xt]>xe[Xt]&&(jt=Hf(jt));var Kt=Hf(jt),En=[];if(a&&En.push(rn[Rt]<=0),l&&En.push(rn[jt]<=0,rn[Kt]<=0),En.every(function(Bn){return Bn})){Pe=rt,$e=!1;break}Ae.set(rt,En)}if($e)for(var dn=D?3:1,xn=function(Pn){var Rn=J.find(function(Ee){var je=Ae.get(Ee);if(je)return je.slice(0,Pn).every(function(Ke){return Ke})});if(Rn)return Pe=Rn,"break"},vt=dn;vt>0;vt--){var ri=xn(vt);if(ri==="break")break}e.placement!==Pe&&(e.modifiersData[i]._skip=!0,e.placement=Pe,e.reset=!0)}}const aV={name:"flip",enabled:!0,phase:"main",fn:oV,requiresIfExists:["offset"],data:{_skip:!1}};function V2(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function F2(t){return[Ir,vs,xs,Pr].some(function(e){return t[e]>=0})}function lV(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,a=e.modifiersData.preventOverflow,u=Hh(e,{elementContext:"reference"}),l=Hh(e,{altBoundary:!0}),g=V2(u,i),b=V2(l,r,a),S=F2(g),E=F2(b);e.modifiersData[n]={referenceClippingOffsets:g,popperEscapeOffsets:b,isReferenceHidden:S,hasPopperEscaped:E},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":S,"data-popper-escaped":E})}const cV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:lV};function uV(t,e,n){var i=lo(t),r=[Pr,Ir].indexOf(i)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,u=a[0],l=a[1];return u=u||0,l=(l||0)*r,[Pr,vs].indexOf(i)>=0?{x:l,y:u}:{x:u,y:l}}function hV(t){var e=t.state,n=t.options,i=t.name,r=n.offset,a=r===void 0?[0,0]:r,u=C2.reduce(function(S,E){return S[E]=uV(E,e.rects,a),S},{}),l=u[e.placement],g=l.x,b=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=g,e.modifiersData.popperOffsets.y+=b),e.modifiersData[i]=u}const dV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:hV};function pV(t){var e=t.state,n=t.name;e.modifiersData[n]=L2({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const fV={name:"popperOffsets",enabled:!0,phase:"read",fn:pV,data:{}};function mV(t){return t==="x"?"y":"x"}function gV(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,a=r===void 0?!0:r,u=n.altAxis,l=u===void 0?!1:u,g=n.boundary,b=n.rootBoundary,S=n.altBoundary,E=n.padding,C=n.tether,P=C===void 0?!0:C,D=n.tetherOffset,R=D===void 0?0:D,j=Hh(e,{boundary:g,rootBoundary:b,padding:E,altBoundary:S}),W=lo(e.placement),ee=Xc(e.placement),le=!ee,J=O0(W),Te=mV(J),xe=e.modifiersData.popperOffsets,Ae=e.rects.reference,$e=e.rects.popper,Pe=typeof R=="function"?R(Object.assign({},e.rects,{placement:e.placement})):R,Xe=typeof Pe=="number"?{mainAxis:Pe,altAxis:Pe}:Object.assign({mainAxis:0,altAxis:0},Pe),rt=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Rt={x:0,y:0};if(xe){if(a){var pt,Nt=J==="y"?Ir:Pr,Xt=J==="y"?xs:vs,rn=J==="y"?"height":"width",jt=xe[J],Kt=jt+j[Nt],En=jt-j[Xt],dn=P?-$e[rn]/2:0,xn=ee===Gc?Ae[rn]:$e[rn],vt=ee===Gc?-$e[rn]:-Ae[rn],ri=e.elements.arrow,Bn=P&&ri?D0(ri):{width:0,height:0},Pn=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:P2(),Rn=Pn[Nt],Ee=Pn[Xt],je=jh(0,Ae[rn],Bn[rn]),Ke=le?Ae[rn]/2-dn-je-Rn-Xe.mainAxis:xn-je-Rn-Xe.mainAxis,ut=le?-Ae[rn]/2+dn+je+Ee+Xe.mainAxis:vt+je+Ee+Xe.mainAxis,Lt=e.elements.arrow&&$h(e.elements.arrow),sn=Lt?J==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Dt=(pt=rt==null?void 0:rt[J])!=null?pt:0,At=jt+Ke-Dt-sn,cn=jt+ut-Dt,ke=jh(P?$f(Kt,At):Kt,jt,P?zl(En,cn):En);xe[J]=ke,Rt[J]=ke-jt}if(l){var Cn,Ss=J==="x"?Ir:Pr,Jt=J==="x"?xs:vs,pn=xe[Te],er=Te==="y"?"height":"width",tr=pn+j[Ss],bi=pn-j[Jt],Dr=[Ir,Pr].indexOf(W)!==-1,xi=(Cn=rt==null?void 0:rt[Te])!=null?Cn:0,Es=Dr?tr:pn-Ae[er]-$e[er]-xi+Xe.altAxis,Cs=Dr?pn+Ae[er]+$e[er]-xi-Xe.altAxis:bi,Re=P&&Dr?F3(Es,pn,Cs):jh(P?Es:tr,pn,P?Cs:bi);xe[Te]=Re,Rt[Te]=Re-pn}e.modifiersData[i]=Rt}}const yV={name:"preventOverflow",enabled:!0,phase:"main",fn:gV,requiresIfExists:["offset"]};function _V(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function bV(t){return t===Zr(t)||!ws(t)?z0(t):_V(t)}function xV(t){var e=t.getBoundingClientRect(),n=Zc(e.width)/t.offsetWidth||1,i=Zc(e.height)/t.offsetHeight||1;return n!==1||i!==1}function vV(t,e,n){n===void 0&&(n=!1);var i=ws(e),r=ws(e)&&xV(e),a=Ca(e),u=Yc(t,r,n),l={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(i||!i&&!n)&&((ao(e)!=="body"||B0(a))&&(l=bV(e)),ws(e)?(g=Yc(e,!0),g.x+=e.clientLeft,g.y+=e.clientTop):a&&(g.x=N0(a))),{x:u.left+l.scrollLeft-g.x,y:u.top+l.scrollTop-g.y,width:u.width,height:u.height}}function wV(t){var e=new Map,n=new Set,i=[];t.forEach(function(a){e.set(a.name,a)});function r(a){n.add(a.name);var u=[].concat(a.requires||[],a.requiresIfExists||[]);u.forEach(function(l){if(!n.has(l)){var g=e.get(l);g&&r(g)}}),i.push(a)}return t.forEach(function(a){n.has(a.name)||r(a)}),i}function kV(t){var e=wV(t);return N3.reduce(function(n,i){return n.concat(e.filter(function(r){return r.phase===i}))},[])}function SV(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function EV(t){var e=t.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var $2={placement:"bottom",modifiers:[],strategy:"absolute"};function j2(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function CV(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,i=n===void 0?[]:n,r=e.defaultOptions,a=r===void 0?$2:r;return function(l,g,b){b===void 0&&(b=a);var S={placement:"bottom",orderedModifiers:[],options:Object.assign({},$2,a),modifiersData:{},elements:{reference:l,popper:g},attributes:{},styles:{}},E=[],C=!1,P={state:S,setOptions:function(W){var ee=typeof W=="function"?W(S.options):W;R(),S.options=Object.assign({},a,S.options,ee),S.scrollParents={reference:Ol(l)?Uh(l):l.contextElement?Uh(l.contextElement):[],popper:Uh(g)};var le=kV(EV([].concat(i,S.options.modifiers)));return S.orderedModifiers=le.filter(function(J){return J.enabled}),D(),P.update()},forceUpdate:function(){if(!C){var W=S.elements,ee=W.reference,le=W.popper;if(j2(ee,le)){S.rects={reference:vV(ee,$h(le),S.options.strategy==="fixed"),popper:D0(le)},S.reset=!1,S.placement=S.options.placement,S.orderedModifiers.forEach(function(Xe){return S.modifiersData[Xe.name]=Object.assign({},Xe.data)});for(var J=0;J<S.orderedModifiers.length;J++){if(S.reset===!0){S.reset=!1,J=-1;continue}var Te=S.orderedModifiers[J],xe=Te.fn,Ae=Te.options,$e=Ae===void 0?{}:Ae,Pe=Te.name;typeof xe=="function"&&(S=xe({state:S,options:$e,name:Pe,instance:P})||S)}}}},update:SV(function(){return new Promise(function(j){P.forceUpdate(),j(S)})}),destroy:function(){R(),C=!0}};if(!j2(l,g))return P;P.setOptions(b).then(function(j){!C&&b.onFirstUpdate&&b.onFirstUpdate(j)});function D(){S.orderedModifiers.forEach(function(j){var W=j.name,ee=j.options,le=ee===void 0?{}:ee,J=j.effect;if(typeof J=="function"){var Te=J({state:S,name:W,instance:P,options:le}),xe=function(){};E.push(Te||xe)}})}function R(){E.forEach(function(j){return j()}),E=[]}return P}}var TV=[X3,fV,Z3,T2,dV,aV,yV,H3,cV],MV=CV({defaultModifiers:TV}),AV="tippy-box",U2="tippy-content",IV="tippy-backdrop",H2="tippy-arrow",q2="tippy-svg-arrow",Nl={passive:!0,capture:!0},W2=function(){return document.body};function PV(t,e){return{}.hasOwnProperty.call(t,e)}function L0(t,e,n){if(Array.isArray(t)){var i=t[e];return i??(Array.isArray(n)?n[e]:n)}return t}function V0(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function G2(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Z2(t,e){if(e===0)return t;var n;return function(i){clearTimeout(n),n=setTimeout(function(){t(i)},e)}}function DV(t,e){var n=Object.assign({},t);return e.forEach(function(i){delete n[i]}),n}function OV(t){return t.split(/\s+/).filter(Boolean)}function Kc(t){return[].concat(t)}function Y2(t,e){t.indexOf(e)===-1&&t.push(e)}function zV(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function NV(t){return t.split("-")[0]}function qf(t){return[].slice.call(t)}function X2(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function qh(){return document.createElement("div")}function Wh(t){return["Element","Fragment"].some(function(e){return V0(t,e)})}function BV(t){return V0(t,"NodeList")}function RV(t){return V0(t,"MouseEvent")}function LV(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function VV(t){return Wh(t)?[t]:BV(t)?qf(t):Array.isArray(t)?t:qf(document.querySelectorAll(t))}function F0(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function K2(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function FV(t){var e,n=Kc(t),i=n[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function $V(t,e){var n=e.clientX,i=e.clientY;return t.every(function(r){var a=r.popperRect,u=r.popperState,l=r.props,g=l.interactiveBorder,b=NV(u.placement),S=u.modifiersData.offset;if(!S)return!0;var E=b==="bottom"?S.top.y:0,C=b==="top"?S.bottom.y:0,P=b==="right"?S.left.x:0,D=b==="left"?S.right.x:0,R=a.top-i+E>g,j=i-a.bottom-C>g,W=a.left-n+P>g,ee=n-a.right-D>g;return R||j||W||ee})}function $0(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){t[i](r,n)})}function J2(t,e){for(var n=e;n;){var i;if(t.contains(n))return!0;n=n.getRootNode==null||(i=n.getRootNode())==null?void 0:i.host}return!1}var co={isTouch:!1},Q2=0;function jV(){co.isTouch||(co.isTouch=!0,window.performance&&document.addEventListener("mousemove",eS))}function eS(){var t=performance.now();t-Q2<20&&(co.isTouch=!1,document.removeEventListener("mousemove",eS)),Q2=t}function UV(){var t=document.activeElement;if(LV(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function HV(){document.addEventListener("touchstart",jV,Nl),window.addEventListener("blur",UV)}var qV=typeof window<"u"&&typeof document<"u",WV=qV?!!window.msCrypto:!1;function Jc(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function tS(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function GV(t){return tS(`
|
717
|
+
`,textSerializers:i={}}=e||{};return J3(this.state.doc,{blockSeparator:n,textSerializers:{...f2(this.schema),...i}})}get isEmpty(){return E0(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelector(e,n))||null}$nodes(e,n){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Dl(n,this)}get $doc(){return this.$pos(0)}};function qc(t){return new Df({find:t.find,handler:({state:e,range:n,match:i})=>{const r=nn(t.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:a}=e,u=i[i.length-1],l=i[0];if(u){const g=l.search(/\S/),b=n.from+l.indexOf(u),S=b+u.length;if(b2(n.from,n.to,e.doc).filter(P=>P.mark.type.excluded.find(R=>R===t.type&&R!==P.mark.type)).filter(P=>P.to>b).length)return null;S<n.to&&a.delete(S,n.to),b>n.from&&a.delete(n.from+g,b);const C=n.from+g+u.length;a.addMark(n.from+g,C,t.type.create(r||{})),a.removeStoredMark(t.type)}}})}function w4(t){return new Df({find:t.find,handler:({state:e,range:n,match:i})=>{const r=nn(t.getAttributes,void 0,i)||{},{tr:a}=e,u=n.from;let l=n.to;const g=t.type.create(r);if(i[1]){const b=i[0].lastIndexOf(i[1]);let S=u+b;S>l?S=l:l=S+i[1].length;const E=i[0][i[0].length-1];a.insertText(E,u+i[0].length-1),a.replaceWith(S,l,g)}else if(i[0]){const b=t.type.isInline?u:u-1;a.insert(b,t.type.create(r)).delete(a.mapping.map(u),a.mapping.map(l))}a.scrollIntoView()}})}function M0(t){return new Df({find:t.find,handler:({state:e,range:n,match:i})=>{const r=e.doc.resolve(n.from),a=nn(t.getAttributes,void 0,i)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,a)}})}function Rh(t){return new Df({find:t.find,handler:({state:e,range:n,match:i,chain:r})=>{const a=nn(t.getAttributes,void 0,i)||{},u=e.tr.delete(n.from,n.to),g=u.doc.resolve(n.from).blockRange(),b=g&&Ny(g,t.type,a);if(!b)return null;if(u.wrap(g,b),t.keepMarks&&t.editor){const{selection:E,storedMarks:C}=e,{splittableMarks:P}=t.editor.extensionManager,D=C||E.$to.parentOffset&&E.$from.marks();if(D){const R=D.filter(j=>P.includes(j.type.name));u.ensureMarks(R)}}if(t.keepAttributes){const E=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(E,a).run()}const S=u.doc.resolve(n.from-1).nodeBefore;S&&S.type===t.type&&ma(u.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(i,S))&&u.join(n.from-1)}})}let bs=class yb{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nn(kt(this,"addOptions",{name:this.name}))),this.storage=nn(kt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yb(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nf(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new yb(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nn(kt(n,"addOptions",{name:n.name})),n.storage=nn(kt(n,"addStorage",{name:n.name,options:n.options})),n}};function Wc(t){return new JL({find:t.find,handler:({state:e,range:n,match:i,pasteEvent:r})=>{const a=nn(t.getAttributes,void 0,i,r);if(a===!1||a===null)return null;const{tr:u}=e,l=i[i.length-1],g=i[0];let b=n.to;if(l){const S=g.search(/\S/),E=n.from+g.indexOf(l),C=E+l.length;if(b2(n.from,n.to,e.doc).filter(D=>D.mark.type.excluded.find(j=>j===t.type&&j!==D.mark.type)).filter(D=>D.to>E).length)return null;C<n.to&&u.delete(C,n.to),E>n.from&&u.delete(n.from+S,E),b=n.from+S+l.length,u.addMark(n.from+S,b,t.type.create(a||{})),u.removeStoredMark(t.type)}}})}function k4(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ir="top",xs="bottom",vs="right",Pr="left",A0="auto",Lh=[Ir,xs,vs,Pr],Gc="start",Vh="end",S4="clippingParents",S2="viewport",Fh="popper",E4="reference",E2=Lh.reduce(function(t,e){return t.concat([e+"-"+Gc,e+"-"+Vh])},[]),C2=[].concat(Lh,[A0]).reduce(function(t,e){return t.concat([e,e+"-"+Gc,e+"-"+Vh])},[]),C4="beforeRead",T4="read",M4="afterRead",A4="beforeMain",I4="main",P4="afterMain",D4="beforeWrite",O4="write",z4="afterWrite",N4=[C4,T4,M4,A4,I4,P4,D4,O4,z4];function ao(t){return t?(t.nodeName||"").toLowerCase():null}function Zr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ol(t){var e=Zr(t).Element;return t instanceof e||t instanceof Element}function ws(t){var e=Zr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function I0(t){if(typeof ShadowRoot>"u")return!1;var e=Zr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function B4(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},r=e.attributes[n]||{},a=e.elements[n];!ws(a)||!ao(a)||(Object.assign(a.style,i),Object.keys(r).forEach(function(u){var l=r[u];l===!1?a.removeAttribute(u):a.setAttribute(u,l===!0?"":l)}))})}function R4(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],a=e.attributes[i]||{},u=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),l=u.reduce(function(g,b){return g[b]="",g},{});!ws(r)||!ao(r)||(Object.assign(r.style,l),Object.keys(a).forEach(function(g){r.removeAttribute(g)}))})}}const T2={name:"applyStyles",enabled:!0,phase:"write",fn:B4,effect:R4,requires:["computeStyles"]};function lo(t){return t.split("-")[0]}var zl=Math.max,$f=Math.min,Zc=Math.round;function P0(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function M2(){return!/^((?!chrome|android).)*safari/i.test(P0())}function Yc(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),r=1,a=1;e&&ws(t)&&(r=t.offsetWidth>0&&Zc(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&Zc(i.height)/t.offsetHeight||1);var u=Ol(t)?Zr(t):window,l=u.visualViewport,g=!M2()&&n,b=(i.left+(g&&l?l.offsetLeft:0))/r,S=(i.top+(g&&l?l.offsetTop:0))/a,E=i.width/r,C=i.height/a;return{width:E,height:C,top:S,right:b+E,bottom:S+C,left:b,x:b,y:S}}function D0(t){var e=Yc(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function A2(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&I0(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Lo(t){return Zr(t).getComputedStyle(t)}function L4(t){return["table","td","th"].indexOf(ao(t))>=0}function Ca(t){return((Ol(t)?t.ownerDocument:t.document)||window.document).documentElement}function jf(t){return ao(t)==="html"?t:t.assignedSlot||t.parentNode||(I0(t)?t.host:null)||Ca(t)}function I2(t){return!ws(t)||Lo(t).position==="fixed"?null:t.offsetParent}function V4(t){var e=/firefox/i.test(P0()),n=/Trident/i.test(P0());if(n&&ws(t)){var i=Lo(t);if(i.position==="fixed")return null}var r=jf(t);for(I0(r)&&(r=r.host);ws(r)&&["html","body"].indexOf(ao(r))<0;){var a=Lo(r);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return r;r=r.parentNode}return null}function $h(t){for(var e=Zr(t),n=I2(t);n&&L4(n)&&Lo(n).position==="static";)n=I2(n);return n&&(ao(n)==="html"||ao(n)==="body"&&Lo(n).position==="static")?e:n||V4(t)||e}function O0(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function jh(t,e,n){return zl(t,$f(e,n))}function F4(t,e,n){var i=jh(t,e,n);return i>n?n:i}function P2(){return{top:0,right:0,bottom:0,left:0}}function D2(t){return Object.assign({},P2(),t)}function O2(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var $4=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,D2(typeof e!="number"?e:O2(e,Lh))};function j4(t){var e,n=t.state,i=t.name,r=t.options,a=n.elements.arrow,u=n.modifiersData.popperOffsets,l=lo(n.placement),g=O0(l),b=[Pr,vs].indexOf(l)>=0,S=b?"height":"width";if(!(!a||!u)){var E=$4(r.padding,n),C=D0(a),P=g==="y"?Ir:Pr,D=g==="y"?xs:vs,R=n.rects.reference[S]+n.rects.reference[g]-u[g]-n.rects.popper[S],j=u[g]-n.rects.reference[g],W=$h(a),ee=W?g==="y"?W.clientHeight||0:W.clientWidth||0:0,le=R/2-j/2,J=E[P],Te=ee-C[S]-E[D],xe=ee/2-C[S]/2+le,Ae=jh(J,xe,Te),$e=g;n.modifiersData[i]=(e={},e[$e]=Ae,e.centerOffset=Ae-xe,e)}}function U4(t){var e=t.state,n=t.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||A2(e.elements.popper,r)&&(e.elements.arrow=r))}const H4={name:"arrow",enabled:!0,phase:"main",fn:j4,effect:U4,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xc(t){return t.split("-")[1]}var q4={top:"auto",right:"auto",bottom:"auto",left:"auto"};function W4(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:Zc(n*r)/r||0,y:Zc(i*r)/r||0}}function z2(t){var e,n=t.popper,i=t.popperRect,r=t.placement,a=t.variation,u=t.offsets,l=t.position,g=t.gpuAcceleration,b=t.adaptive,S=t.roundOffsets,E=t.isFixed,C=u.x,P=C===void 0?0:C,D=u.y,R=D===void 0?0:D,j=typeof S=="function"?S({x:P,y:R}):{x:P,y:R};P=j.x,R=j.y;var W=u.hasOwnProperty("x"),ee=u.hasOwnProperty("y"),le=Pr,J=Ir,Te=window;if(b){var xe=$h(n),Ae="clientHeight",$e="clientWidth";if(xe===Zr(n)&&(xe=Ca(n),Lo(xe).position!=="static"&&l==="absolute"&&(Ae="scrollHeight",$e="scrollWidth")),xe=xe,r===Ir||(r===Pr||r===vs)&&a===Vh){J=xs;var Pe=E&&xe===Te&&Te.visualViewport?Te.visualViewport.height:xe[Ae];R-=Pe-i.height,R*=g?1:-1}if(r===Pr||(r===Ir||r===xs)&&a===Vh){le=vs;var Xe=E&&xe===Te&&Te.visualViewport?Te.visualViewport.width:xe[$e];P-=Xe-i.width,P*=g?1:-1}}var rt=Object.assign({position:l},b&&q4),Rt=S===!0?W4({x:P,y:R},Zr(n)):{x:P,y:R};if(P=Rt.x,R=Rt.y,g){var pt;return Object.assign({},rt,(pt={},pt[J]=ee?"0":"",pt[le]=W?"0":"",pt.transform=(Te.devicePixelRatio||1)<=1?"translate("+P+"px, "+R+"px)":"translate3d("+P+"px, "+R+"px, 0)",pt))}return Object.assign({},rt,(e={},e[J]=ee?R+"px":"",e[le]=W?P+"px":"",e.transform="",e))}function G4(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=i===void 0?!0:i,a=n.adaptive,u=a===void 0?!0:a,l=n.roundOffsets,g=l===void 0?!0:l,b={placement:lo(e.placement),variation:Xc(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,z2(Object.assign({},b,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:u,roundOffsets:g})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,z2(Object.assign({},b,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:g})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Z4={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:G4,data:{}};var Uf={passive:!0};function Y4(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,a=r===void 0?!0:r,u=i.resize,l=u===void 0?!0:u,g=Zr(e.elements.popper),b=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&b.forEach(function(S){S.addEventListener("scroll",n.update,Uf)}),l&&g.addEventListener("resize",n.update,Uf),function(){a&&b.forEach(function(S){S.removeEventListener("scroll",n.update,Uf)}),l&&g.removeEventListener("resize",n.update,Uf)}}const X4={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Y4,data:{}};var K4={left:"right",right:"left",bottom:"top",top:"bottom"};function Hf(t){return t.replace(/left|right|bottom|top/g,function(e){return K4[e]})}var J4={start:"end",end:"start"};function N2(t){return t.replace(/start|end/g,function(e){return J4[e]})}function z0(t){var e=Zr(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function N0(t){return Yc(Ca(t)).left+z0(t).scrollLeft}function Q4(t,e){var n=Zr(t),i=Ca(t),r=n.visualViewport,a=i.clientWidth,u=i.clientHeight,l=0,g=0;if(r){a=r.width,u=r.height;var b=M2();(b||!b&&e==="fixed")&&(l=r.offsetLeft,g=r.offsetTop)}return{width:a,height:u,x:l+N0(t),y:g}}function eV(t){var e,n=Ca(t),i=z0(t),r=(e=t.ownerDocument)==null?void 0:e.body,a=zl(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),u=zl(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+N0(t),g=-i.scrollTop;return Lo(r||n).direction==="rtl"&&(l+=zl(n.clientWidth,r?r.clientWidth:0)-a),{width:a,height:u,x:l,y:g}}function B0(t){var e=Lo(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function B2(t){return["html","body","#document"].indexOf(ao(t))>=0?t.ownerDocument.body:ws(t)&&B0(t)?t:B2(jf(t))}function Uh(t,e){var n;e===void 0&&(e=[]);var i=B2(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),a=Zr(i),u=r?[a].concat(a.visualViewport||[],B0(i)?i:[]):i,l=e.concat(u);return r?l:l.concat(Uh(jf(u)))}function R0(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tV(t,e){var n=Yc(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function R2(t,e,n){return e===S2?R0(Q4(t,n)):Ol(e)?tV(e,n):R0(eV(Ca(t)))}function nV(t){var e=Uh(jf(t)),n=["absolute","fixed"].indexOf(Lo(t).position)>=0,i=n&&ws(t)?$h(t):t;return Ol(i)?e.filter(function(r){return Ol(r)&&A2(r,i)&&ao(r)!=="body"}):[]}function iV(t,e,n,i){var r=e==="clippingParents"?nV(t):[].concat(e),a=[].concat(r,[n]),u=a[0],l=a.reduce(function(g,b){var S=R2(t,b,i);return g.top=zl(S.top,g.top),g.right=$f(S.right,g.right),g.bottom=$f(S.bottom,g.bottom),g.left=zl(S.left,g.left),g},R2(t,u,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function L2(t){var e=t.reference,n=t.element,i=t.placement,r=i?lo(i):null,a=i?Xc(i):null,u=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,g;switch(r){case Ir:g={x:u,y:e.y-n.height};break;case xs:g={x:u,y:e.y+e.height};break;case vs:g={x:e.x+e.width,y:l};break;case Pr:g={x:e.x-n.width,y:l};break;default:g={x:e.x,y:e.y}}var b=r?O0(r):null;if(b!=null){var S=b==="y"?"height":"width";switch(a){case Gc:g[b]=g[b]-(e[S]/2-n[S]/2);break;case Vh:g[b]=g[b]+(e[S]/2-n[S]/2);break}}return g}function Hh(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=i===void 0?t.placement:i,a=n.strategy,u=a===void 0?t.strategy:a,l=n.boundary,g=l===void 0?S4:l,b=n.rootBoundary,S=b===void 0?S2:b,E=n.elementContext,C=E===void 0?Fh:E,P=n.altBoundary,D=P===void 0?!1:P,R=n.padding,j=R===void 0?0:R,W=D2(typeof j!="number"?j:O2(j,Lh)),ee=C===Fh?E4:Fh,le=t.rects.popper,J=t.elements[D?ee:C],Te=iV(Ol(J)?J:J.contextElement||Ca(t.elements.popper),g,S,u),xe=Yc(t.elements.reference),Ae=L2({reference:xe,element:le,strategy:"absolute",placement:r}),$e=R0(Object.assign({},le,Ae)),Pe=C===Fh?$e:xe,Xe={top:Te.top-Pe.top+W.top,bottom:Pe.bottom-Te.bottom+W.bottom,left:Te.left-Pe.left+W.left,right:Pe.right-Te.right+W.right},rt=t.modifiersData.offset;if(C===Fh&&rt){var Rt=rt[r];Object.keys(Xe).forEach(function(pt){var Nt=[vs,xs].indexOf(pt)>=0?1:-1,Xt=[Ir,xs].indexOf(pt)>=0?"y":"x";Xe[pt]+=Rt[Xt]*Nt})}return Xe}function rV(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=n.boundary,a=n.rootBoundary,u=n.padding,l=n.flipVariations,g=n.allowedAutoPlacements,b=g===void 0?C2:g,S=Xc(i),E=S?l?E2:E2.filter(function(D){return Xc(D)===S}):Lh,C=E.filter(function(D){return b.indexOf(D)>=0});C.length===0&&(C=E);var P=C.reduce(function(D,R){return D[R]=Hh(t,{placement:R,boundary:r,rootBoundary:a,padding:u})[lo(R)],D},{});return Object.keys(P).sort(function(D,R){return P[D]-P[R]})}function sV(t){if(lo(t)===A0)return[];var e=Hf(t);return[N2(t),e,N2(e)]}function oV(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,a=r===void 0?!0:r,u=n.altAxis,l=u===void 0?!0:u,g=n.fallbackPlacements,b=n.padding,S=n.boundary,E=n.rootBoundary,C=n.altBoundary,P=n.flipVariations,D=P===void 0?!0:P,R=n.allowedAutoPlacements,j=e.options.placement,W=lo(j),ee=W===j,le=g||(ee||!D?[Hf(j)]:sV(j)),J=[j].concat(le).reduce(function(Bn,Pn){return Bn.concat(lo(Pn)===A0?rV(e,{placement:Pn,boundary:S,rootBoundary:E,padding:b,flipVariations:D,allowedAutoPlacements:R}):Pn)},[]),Te=e.rects.reference,xe=e.rects.popper,Ae=new Map,$e=!0,Pe=J[0],Xe=0;Xe<J.length;Xe++){var rt=J[Xe],Rt=lo(rt),pt=Xc(rt)===Gc,Nt=[Ir,xs].indexOf(Rt)>=0,Xt=Nt?"width":"height",rn=Hh(e,{placement:rt,boundary:S,rootBoundary:E,altBoundary:C,padding:b}),jt=Nt?pt?vs:Pr:pt?xs:Ir;Te[Xt]>xe[Xt]&&(jt=Hf(jt));var Kt=Hf(jt),En=[];if(a&&En.push(rn[Rt]<=0),l&&En.push(rn[jt]<=0,rn[Kt]<=0),En.every(function(Bn){return Bn})){Pe=rt,$e=!1;break}Ae.set(rt,En)}if($e)for(var dn=D?3:1,xn=function(Pn){var Rn=J.find(function(Ee){var je=Ae.get(Ee);if(je)return je.slice(0,Pn).every(function(Ke){return Ke})});if(Rn)return Pe=Rn,"break"},vt=dn;vt>0;vt--){var ri=xn(vt);if(ri==="break")break}e.placement!==Pe&&(e.modifiersData[i]._skip=!0,e.placement=Pe,e.reset=!0)}}const aV={name:"flip",enabled:!0,phase:"main",fn:oV,requiresIfExists:["offset"],data:{_skip:!1}};function V2(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function F2(t){return[Ir,vs,xs,Pr].some(function(e){return t[e]>=0})}function lV(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,a=e.modifiersData.preventOverflow,u=Hh(e,{elementContext:"reference"}),l=Hh(e,{altBoundary:!0}),g=V2(u,i),b=V2(l,r,a),S=F2(g),E=F2(b);e.modifiersData[n]={referenceClippingOffsets:g,popperEscapeOffsets:b,isReferenceHidden:S,hasPopperEscaped:E},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":S,"data-popper-escaped":E})}const cV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:lV};function uV(t,e,n){var i=lo(t),r=[Pr,Ir].indexOf(i)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,u=a[0],l=a[1];return u=u||0,l=(l||0)*r,[Pr,vs].indexOf(i)>=0?{x:l,y:u}:{x:u,y:l}}function hV(t){var e=t.state,n=t.options,i=t.name,r=n.offset,a=r===void 0?[0,0]:r,u=C2.reduce(function(S,E){return S[E]=uV(E,e.rects,a),S},{}),l=u[e.placement],g=l.x,b=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=g,e.modifiersData.popperOffsets.y+=b),e.modifiersData[i]=u}const dV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:hV};function pV(t){var e=t.state,n=t.name;e.modifiersData[n]=L2({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const fV={name:"popperOffsets",enabled:!0,phase:"read",fn:pV,data:{}};function mV(t){return t==="x"?"y":"x"}function gV(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,a=r===void 0?!0:r,u=n.altAxis,l=u===void 0?!1:u,g=n.boundary,b=n.rootBoundary,S=n.altBoundary,E=n.padding,C=n.tether,P=C===void 0?!0:C,D=n.tetherOffset,R=D===void 0?0:D,j=Hh(e,{boundary:g,rootBoundary:b,padding:E,altBoundary:S}),W=lo(e.placement),ee=Xc(e.placement),le=!ee,J=O0(W),Te=mV(J),xe=e.modifiersData.popperOffsets,Ae=e.rects.reference,$e=e.rects.popper,Pe=typeof R=="function"?R(Object.assign({},e.rects,{placement:e.placement})):R,Xe=typeof Pe=="number"?{mainAxis:Pe,altAxis:Pe}:Object.assign({mainAxis:0,altAxis:0},Pe),rt=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Rt={x:0,y:0};if(xe){if(a){var pt,Nt=J==="y"?Ir:Pr,Xt=J==="y"?xs:vs,rn=J==="y"?"height":"width",jt=xe[J],Kt=jt+j[Nt],En=jt-j[Xt],dn=P?-$e[rn]/2:0,xn=ee===Gc?Ae[rn]:$e[rn],vt=ee===Gc?-$e[rn]:-Ae[rn],ri=e.elements.arrow,Bn=P&&ri?D0(ri):{width:0,height:0},Pn=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:P2(),Rn=Pn[Nt],Ee=Pn[Xt],je=jh(0,Ae[rn],Bn[rn]),Ke=le?Ae[rn]/2-dn-je-Rn-Xe.mainAxis:xn-je-Rn-Xe.mainAxis,ut=le?-Ae[rn]/2+dn+je+Ee+Xe.mainAxis:vt+je+Ee+Xe.mainAxis,Lt=e.elements.arrow&&$h(e.elements.arrow),sn=Lt?J==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Dt=(pt=rt==null?void 0:rt[J])!=null?pt:0,At=jt+Ke-Dt-sn,cn=jt+ut-Dt,ke=jh(P?$f(Kt,At):Kt,jt,P?zl(En,cn):En);xe[J]=ke,Rt[J]=ke-jt}if(l){var Cn,Ss=J==="x"?Ir:Pr,Jt=J==="x"?xs:vs,pn=xe[Te],er=Te==="y"?"height":"width",tr=pn+j[Ss],bi=pn-j[Jt],Dr=[Ir,Pr].indexOf(W)!==-1,xi=(Cn=rt==null?void 0:rt[Te])!=null?Cn:0,Es=Dr?tr:pn-Ae[er]-$e[er]-xi+Xe.altAxis,Cs=Dr?pn+Ae[er]+$e[er]-xi-Xe.altAxis:bi,Re=P&&Dr?F4(Es,pn,Cs):jh(P?Es:tr,pn,P?Cs:bi);xe[Te]=Re,Rt[Te]=Re-pn}e.modifiersData[i]=Rt}}const yV={name:"preventOverflow",enabled:!0,phase:"main",fn:gV,requiresIfExists:["offset"]};function _V(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function bV(t){return t===Zr(t)||!ws(t)?z0(t):_V(t)}function xV(t){var e=t.getBoundingClientRect(),n=Zc(e.width)/t.offsetWidth||1,i=Zc(e.height)/t.offsetHeight||1;return n!==1||i!==1}function vV(t,e,n){n===void 0&&(n=!1);var i=ws(e),r=ws(e)&&xV(e),a=Ca(e),u=Yc(t,r,n),l={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(i||!i&&!n)&&((ao(e)!=="body"||B0(a))&&(l=bV(e)),ws(e)?(g=Yc(e,!0),g.x+=e.clientLeft,g.y+=e.clientTop):a&&(g.x=N0(a))),{x:u.left+l.scrollLeft-g.x,y:u.top+l.scrollTop-g.y,width:u.width,height:u.height}}function wV(t){var e=new Map,n=new Set,i=[];t.forEach(function(a){e.set(a.name,a)});function r(a){n.add(a.name);var u=[].concat(a.requires||[],a.requiresIfExists||[]);u.forEach(function(l){if(!n.has(l)){var g=e.get(l);g&&r(g)}}),i.push(a)}return t.forEach(function(a){n.has(a.name)||r(a)}),i}function kV(t){var e=wV(t);return N4.reduce(function(n,i){return n.concat(e.filter(function(r){return r.phase===i}))},[])}function SV(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function EV(t){var e=t.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var $2={placement:"bottom",modifiers:[],strategy:"absolute"};function j2(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function CV(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,i=n===void 0?[]:n,r=e.defaultOptions,a=r===void 0?$2:r;return function(l,g,b){b===void 0&&(b=a);var S={placement:"bottom",orderedModifiers:[],options:Object.assign({},$2,a),modifiersData:{},elements:{reference:l,popper:g},attributes:{},styles:{}},E=[],C=!1,P={state:S,setOptions:function(W){var ee=typeof W=="function"?W(S.options):W;R(),S.options=Object.assign({},a,S.options,ee),S.scrollParents={reference:Ol(l)?Uh(l):l.contextElement?Uh(l.contextElement):[],popper:Uh(g)};var le=kV(EV([].concat(i,S.options.modifiers)));return S.orderedModifiers=le.filter(function(J){return J.enabled}),D(),P.update()},forceUpdate:function(){if(!C){var W=S.elements,ee=W.reference,le=W.popper;if(j2(ee,le)){S.rects={reference:vV(ee,$h(le),S.options.strategy==="fixed"),popper:D0(le)},S.reset=!1,S.placement=S.options.placement,S.orderedModifiers.forEach(function(Xe){return S.modifiersData[Xe.name]=Object.assign({},Xe.data)});for(var J=0;J<S.orderedModifiers.length;J++){if(S.reset===!0){S.reset=!1,J=-1;continue}var Te=S.orderedModifiers[J],xe=Te.fn,Ae=Te.options,$e=Ae===void 0?{}:Ae,Pe=Te.name;typeof xe=="function"&&(S=xe({state:S,options:$e,name:Pe,instance:P})||S)}}}},update:SV(function(){return new Promise(function(j){P.forceUpdate(),j(S)})}),destroy:function(){R(),C=!0}};if(!j2(l,g))return P;P.setOptions(b).then(function(j){!C&&b.onFirstUpdate&&b.onFirstUpdate(j)});function D(){S.orderedModifiers.forEach(function(j){var W=j.name,ee=j.options,le=ee===void 0?{}:ee,J=j.effect;if(typeof J=="function"){var Te=J({state:S,name:W,instance:P,options:le}),xe=function(){};E.push(Te||xe)}})}function R(){E.forEach(function(j){return j()}),E=[]}return P}}var TV=[X4,fV,Z4,T2,dV,aV,yV,H4,cV],MV=CV({defaultModifiers:TV}),AV="tippy-box",U2="tippy-content",IV="tippy-backdrop",H2="tippy-arrow",q2="tippy-svg-arrow",Nl={passive:!0,capture:!0},W2=function(){return document.body};function PV(t,e){return{}.hasOwnProperty.call(t,e)}function L0(t,e,n){if(Array.isArray(t)){var i=t[e];return i??(Array.isArray(n)?n[e]:n)}return t}function V0(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function G2(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Z2(t,e){if(e===0)return t;var n;return function(i){clearTimeout(n),n=setTimeout(function(){t(i)},e)}}function DV(t,e){var n=Object.assign({},t);return e.forEach(function(i){delete n[i]}),n}function OV(t){return t.split(/\s+/).filter(Boolean)}function Kc(t){return[].concat(t)}function Y2(t,e){t.indexOf(e)===-1&&t.push(e)}function zV(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function NV(t){return t.split("-")[0]}function qf(t){return[].slice.call(t)}function X2(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function qh(){return document.createElement("div")}function Wh(t){return["Element","Fragment"].some(function(e){return V0(t,e)})}function BV(t){return V0(t,"NodeList")}function RV(t){return V0(t,"MouseEvent")}function LV(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function VV(t){return Wh(t)?[t]:BV(t)?qf(t):Array.isArray(t)?t:qf(document.querySelectorAll(t))}function F0(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function K2(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function FV(t){var e,n=Kc(t),i=n[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function $V(t,e){var n=e.clientX,i=e.clientY;return t.every(function(r){var a=r.popperRect,u=r.popperState,l=r.props,g=l.interactiveBorder,b=NV(u.placement),S=u.modifiersData.offset;if(!S)return!0;var E=b==="bottom"?S.top.y:0,C=b==="top"?S.bottom.y:0,P=b==="right"?S.left.x:0,D=b==="left"?S.right.x:0,R=a.top-i+E>g,j=i-a.bottom-C>g,W=a.left-n+P>g,ee=n-a.right-D>g;return R||j||W||ee})}function $0(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){t[i](r,n)})}function J2(t,e){for(var n=e;n;){var i;if(t.contains(n))return!0;n=n.getRootNode==null||(i=n.getRootNode())==null?void 0:i.host}return!1}var co={isTouch:!1},Q2=0;function jV(){co.isTouch||(co.isTouch=!0,window.performance&&document.addEventListener("mousemove",eS))}function eS(){var t=performance.now();t-Q2<20&&(co.isTouch=!1,document.removeEventListener("mousemove",eS)),Q2=t}function UV(){var t=document.activeElement;if(LV(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function HV(){document.addEventListener("touchstart",jV,Nl),window.addEventListener("blur",UV)}var qV=typeof window<"u"&&typeof document<"u",WV=qV?!!window.msCrypto:!1;function Jc(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function tS(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function GV(t){return tS(`
|
718
718
|
%ctippy.js
|
719
719
|
|
720
720
|
%c`+tS(t)+`
|
@@ -734,8 +734,8 @@ img.ProseMirror-separator {
|
|
734
734
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
735
735
|
|
736
736
|
`,`1) content: element.innerHTML
|
737
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=r.reduce(function(g,b){var S=b&&nF(b,i);return S&&g.push(S),g},[]);return Wh(t)?l[0]:l}Qc.defaultProps=Yr,Qc.setDefaultProps=JV,Qc.currentInput=co,Object.assign({},T2,{effect:function(e){var n=e.state,i={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,i.popper),n.styles=i,n.elements.arrow&&Object.assign(n.elements.arrow.style,i.arrow)}}),Qc.setDefaultProps({render:cS});class iF{constructor({editor:e,element:n,view:i,tippyOptions:r={},updateDelay:a=250,shouldShow:u}){this.preventHide=!1,this.shouldShow=({view:l,state:g,from:b,to:S})=>{const{doc:E,selection:C}=g,{empty:P}=C,D=!E.textBetween(b,S).length&&b0(g.selection),R=this.element.contains(document.activeElement);return!(!(l.hasFocus()||R)||P||D||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var g;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((g=this.element.parentNode)===null||g===void 0)&&g.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,g)=>{const b=!(g!=null&&g.selection.eq(l.state.selection)),S=!(g!=null&&g.doc.eq(l.state.doc));!b&&!S||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,b,S,g)},this.updateDelay))},this.updateHandler=(l,g,b,S)=>{var E,C,P;const{state:D,composing:R}=l,{selection:j}=D;if(R||!g&&!b)return;this.createTooltip();const{ranges:ee}=j,le=Math.min(...ee.map(xe=>xe.$from.pos)),J=Math.max(...ee.map(xe=>xe.$to.pos));if(!((E=this.shouldShow)===null||E===void 0?void 0:E.call(this,{editor:this.editor,view:l,state:D,oldState:S,from:le,to:J}))){this.hide();return}(C=this.tippy)===null||C===void 0||C.setProps({getReferenceClientRect:((P=this.tippyOptions)===null||P===void 0?void 0:P.getReferenceClientRect)||(()=>{if(v2(D.selection)){let xe=l.nodeDOM(le);const Ae=xe.dataset.nodeViewWrapper?xe:xe.querySelector("[data-node-view-wrapper]");if(Ae&&(xe=Ae.firstChild),xe)return xe.getBoundingClientRect()}return w2(l,le,J)})}),this.show()},this.editor=e,this.element=n,this.view=i,this.updateDelay=a,u&&(this.shouldShow=u),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Qc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:i}=e,r=i.selection.from!==i.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,n);return}const a=!(n!=null&&n.selection.eq(e.state.selection)),u=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,a,u,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const uS=t=>new Fi({key:typeof t.pluginKey=="string"?new Mr(t.pluginKey):t.pluginKey,view:e=>new iF({view:e,...t})});Ai.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[uS({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class rF{constructor({editor:e,element:n,view:i,tippyOptions:r={},shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:l})=>{const{selection:g}=l,{$anchor:b,empty:S}=g,E=b.depth===1,C=b.parent.isTextblock&&!b.parent.type.spec.code&&!b.parent.textContent;return!(!u.hasFocus()||!S||!E||!C||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var l;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.editor=e,this.element=n,this.view=i,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Qc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var i,r,a;const{state:u}=e,{doc:l,selection:g}=u,{from:b,to:S}=g;if(n&&n.doc.eq(l)&&n.selection.eq(g))return;if(this.createTooltip(),!((i=this.shouldShow)===null||i===void 0?void 0:i.call(this,{editor:this.editor,view:e,state:u,oldState:n}))){this.hide();return}(r=this.tippy)===null||r===void 0||r.setProps({getReferenceClientRect:((a=this.tippyOptions)===null||a===void 0?void 0:a.getReferenceClientRect)||(()=>w2(e,b,S))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const hS=t=>new Fi({key:typeof t.pluginKey=="string"?new Mr(t.pluginKey):t.pluginKey,view:e=>new rF({view:e,...t})});Ai.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hS({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),f.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=f.ref(null);return f.onMounted(()=>{const{updateDelay:i,editor:r,pluginKey:a,shouldShow:u,tippyOptions:l}=t;r.registerPlugin(uS({updateDelay:i,editor:r,element:n.value,pluginKey:a,shouldShow:u,tippyOptions:l}))}),f.onBeforeUnmount(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return f.h("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}});function dS(t){return f.customRef((e,n)=>({get(){return e(),t},set(i){t=i,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class sF extends v3{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=dS(this.view.state),this.reactiveExtensionStorage=dS(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),f.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const i=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=i),i}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const oF=f.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=f.ref(),n=f.getCurrentInstance();return f.watchEffect(()=>{const i=t.editor;i&&i.options.element&&e.value&&f.nextTick(()=>{if(!e.value||!i.options.element.firstChild)return;const r=f.unref(e.value);e.value.append(...i.options.element.childNodes),i.contentComponent=n.ctx._,n&&(i.appContext={...n.appContext,provides:n.provides}),i.setOptions({element:r}),i.createNodeViews()})}),f.onBeforeUnmount(()=>{const i=t.editor;if(!i||(i.isDestroyed||i.view.setProps({nodeViews:{}}),i.contentComponent=null,i.appContext=null,!i.options.element.firstChild))return;const r=document.createElement("div");r.append(...i.options.element.childNodes),i.setOptions({element:r})}),{rootEl:e}},render(){return f.h("div",{ref:t=>{this.rootEl=t}})}});f.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=f.ref(null);return f.onMounted(()=>{const{pluginKey:i,editor:r,tippyOptions:a,shouldShow:u}=t;r.registerPlugin(hS({pluginKey:i,editor:r,element:n.value,tippyOptions:a,shouldShow:u}))}),f.onBeforeUnmount(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return f.h("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}}),f.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return f.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),f.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return f.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const aF=/^\s*>\s$/,lF=bs.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Rh({find:aF,type:this.type})]}}),cF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,uF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,hF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,dF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,pF=oo.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[qc({find:cF,type:this.type}),qc({find:hF,type:this.type})]},addPasteRules(){return[Wc({find:uF,type:this.type}),Wc({find:dF,type:this.type})]}}),W0=bs.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ci(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Zh=oo.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=w0(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),pS=/^\s*([-+*])\s$/,fF=bs.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(W0.name,this.editor.getAttributes(Zh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Rh({find:pS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Rh({find:pS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Zh.name),editor:this.editor})),[t]}}),mF=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,gF=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,yF=oo.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[qc({find:mF,type:this.type})]},addPasteRules(){return[Wc({find:gF,type:this.type})]}}),_F=/^```([a-z]+)?[\s\n]$/,bF=/^~~~([a-z]+)?[\s\n]$/,fS=bs.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,a=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(u=>u.startsWith(n)).map(u=>u.replace(n,""))[0];return a||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ci(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:i,empty:r}=n;if(!r||i.parent.type!==this.type)return!1;const a=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`
|
737
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=r.reduce(function(g,b){var S=b&&nF(b,i);return S&&g.push(S),g},[]);return Wh(t)?l[0]:l}Qc.defaultProps=Yr,Qc.setDefaultProps=JV,Qc.currentInput=co,Object.assign({},T2,{effect:function(e){var n=e.state,i={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,i.popper),n.styles=i,n.elements.arrow&&Object.assign(n.elements.arrow.style,i.arrow)}}),Qc.setDefaultProps({render:cS});class iF{constructor({editor:e,element:n,view:i,tippyOptions:r={},updateDelay:a=250,shouldShow:u}){this.preventHide=!1,this.shouldShow=({view:l,state:g,from:b,to:S})=>{const{doc:E,selection:C}=g,{empty:P}=C,D=!E.textBetween(b,S).length&&b0(g.selection),R=this.element.contains(document.activeElement);return!(!(l.hasFocus()||R)||P||D||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var g;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((g=this.element.parentNode)===null||g===void 0)&&g.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,g)=>{const b=!(g!=null&&g.selection.eq(l.state.selection)),S=!(g!=null&&g.doc.eq(l.state.doc));!b&&!S||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,b,S,g)},this.updateDelay))},this.updateHandler=(l,g,b,S)=>{var E,C,P;const{state:D,composing:R}=l,{selection:j}=D;if(R||!g&&!b)return;this.createTooltip();const{ranges:ee}=j,le=Math.min(...ee.map(xe=>xe.$from.pos)),J=Math.max(...ee.map(xe=>xe.$to.pos));if(!((E=this.shouldShow)===null||E===void 0?void 0:E.call(this,{editor:this.editor,view:l,state:D,oldState:S,from:le,to:J}))){this.hide();return}(C=this.tippy)===null||C===void 0||C.setProps({getReferenceClientRect:((P=this.tippyOptions)===null||P===void 0?void 0:P.getReferenceClientRect)||(()=>{if(v2(D.selection)){let xe=l.nodeDOM(le);const Ae=xe.dataset.nodeViewWrapper?xe:xe.querySelector("[data-node-view-wrapper]");if(Ae&&(xe=Ae.firstChild),xe)return xe.getBoundingClientRect()}return w2(l,le,J)})}),this.show()},this.editor=e,this.element=n,this.view=i,this.updateDelay=a,u&&(this.shouldShow=u),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Qc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:i}=e,r=i.selection.from!==i.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,n);return}const a=!(n!=null&&n.selection.eq(e.state.selection)),u=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,a,u,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const uS=t=>new Fi({key:typeof t.pluginKey=="string"?new Mr(t.pluginKey):t.pluginKey,view:e=>new iF({view:e,...t})});Ai.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[uS({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class rF{constructor({editor:e,element:n,view:i,tippyOptions:r={},shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:l})=>{const{selection:g}=l,{$anchor:b,empty:S}=g,E=b.depth===1,C=b.parent.isTextblock&&!b.parent.type.spec.code&&!b.parent.textContent;return!(!u.hasFocus()||!S||!E||!C||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var l;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.editor=e,this.element=n,this.view=i,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Qc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var i,r,a;const{state:u}=e,{doc:l,selection:g}=u,{from:b,to:S}=g;if(n&&n.doc.eq(l)&&n.selection.eq(g))return;if(this.createTooltip(),!((i=this.shouldShow)===null||i===void 0?void 0:i.call(this,{editor:this.editor,view:e,state:u,oldState:n}))){this.hide();return}(r=this.tippy)===null||r===void 0||r.setProps({getReferenceClientRect:((a=this.tippyOptions)===null||a===void 0?void 0:a.getReferenceClientRect)||(()=>w2(e,b,S))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const hS=t=>new Fi({key:typeof t.pluginKey=="string"?new Mr(t.pluginKey):t.pluginKey,view:e=>new rF({view:e,...t})});Ai.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hS({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),f.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=f.ref(null);return f.onMounted(()=>{const{updateDelay:i,editor:r,pluginKey:a,shouldShow:u,tippyOptions:l}=t;r.registerPlugin(uS({updateDelay:i,editor:r,element:n.value,pluginKey:a,shouldShow:u,tippyOptions:l}))}),f.onBeforeUnmount(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return f.h("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}});function dS(t){return f.customRef((e,n)=>({get(){return e(),t},set(i){t=i,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class sF extends v4{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=dS(this.view.state),this.reactiveExtensionStorage=dS(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),f.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const i=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=i),i}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const oF=f.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=f.ref(),n=f.getCurrentInstance();return f.watchEffect(()=>{const i=t.editor;i&&i.options.element&&e.value&&f.nextTick(()=>{if(!e.value||!i.options.element.firstChild)return;const r=f.unref(e.value);e.value.append(...i.options.element.childNodes),i.contentComponent=n.ctx._,n&&(i.appContext={...n.appContext,provides:n.provides}),i.setOptions({element:r}),i.createNodeViews()})}),f.onBeforeUnmount(()=>{const i=t.editor;if(!i||(i.isDestroyed||i.view.setProps({nodeViews:{}}),i.contentComponent=null,i.appContext=null,!i.options.element.firstChild))return;const r=document.createElement("div");r.append(...i.options.element.childNodes),i.setOptions({element:r})}),{rootEl:e}},render(){return f.h("div",{ref:t=>{this.rootEl=t}})}});f.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=f.ref(null);return f.onMounted(()=>{const{pluginKey:i,editor:r,tippyOptions:a,shouldShow:u}=t;r.registerPlugin(hS({pluginKey:i,editor:r,element:n.value,tippyOptions:a,shouldShow:u}))}),f.onBeforeUnmount(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return f.h("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}}),f.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return f.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),f.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return f.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const aF=/^\s*>\s$/,lF=bs.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Rh({find:aF,type:this.type})]}}),cF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,uF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,hF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,dF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,pF=oo.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[qc({find:cF,type:this.type}),qc({find:hF,type:this.type})]},addPasteRules(){return[Wc({find:uF,type:this.type}),Wc({find:dF,type:this.type})]}}),W0=bs.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ci(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Zh=oo.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=w0(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),pS=/^\s*([-+*])\s$/,fF=bs.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(W0.name,this.editor.getAttributes(Zh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Rh({find:pS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Rh({find:pS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Zh.name),editor:this.editor})),[t]}}),mF=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,gF=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,yF=oo.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[qc({find:mF,type:this.type})]},addPasteRules(){return[Wc({find:gF,type:this.type})]}}),_F=/^```([a-z]+)?[\s\n]$/,bF=/^~~~([a-z]+)?[\s\n]$/,fS=bs.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,a=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(u=>u.startsWith(n)).map(u=>u.replace(n,""))[0];return a||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ci(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:i,empty:r}=n;if(!r||i.parent.type!==this.type)return!1;const a=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`
|
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[M0({find:_F,type:this.type,getAttributes:t=>({language:t[1]})}),M0({find:bF,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Fi({key:new Mr("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(Ft.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),xF=bs.create({name:"doc",topNode:!0,content:"block+"});function vF(t={}){return new Fi({view(e){return new wF(e,t)}})}class wF{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 S=b.getBoundingClientRect(),E=l?S.bottom:S.top;l&&g&&(E=(E+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),i={left:S.left,right:S.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=Mw(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 kF=Ai.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[vF(this.options)]}});class ii extends Gt{constructor(e){super(e,e)}map(e,n){let i=e.resolve(n.map(this.head));return ii.valid(i)?new ii(i):Gt.near(i)}content(){return dt.empty}eq(e){return e instanceof ii&&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 ii(e.resolve(n.pos))}getBookmark(){return new G0(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!SF(e)||!EF(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&&ii.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(ii.valid(g))return g}for(;;){let u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!zt.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(ii.valid(l))return l}return null}}}ii.prototype.visible=!1,ii.findFrom=ii.findGapCursorFrom,Gt.jsonID("gapcursor",ii);class G0{constructor(e){this.pos=e}map(e){return new G0(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ii.valid(n)?new ii(n):Gt.near(n)}}function SF(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 EF(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 CF(){return new Fi({props:{decorations:IF,createSelectionBetween(t,e,n){return e.pos==n.pos&&ii.valid(n)?new ii(n):null},handleClick:MF,handleKeyDown:TF,handleDOMEvents:{beforeinput:AF}}})}const TF=e2({ArrowLeft:Gf("horiz",-1),ArrowRight:Gf("horiz",1),ArrowUp:Gf("vert",-1),ArrowDown:Gf("vert",1)});function Gf(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 Ft){if(!a.endOfTextblock(n)||l.depth==0)return!1;g=!1,l=i.doc.resolve(e>0?l.after():l.before())}let b=ii.findGapCursorFrom(l,e,g);return b?(r&&r(i.tr.setSelection(new ii(b))),!0):!1}}function MF(t,e,n){if(!t||!t.editable)return!1;let i=t.state.doc.resolve(e);if(!ii.valid(i))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&zt.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ii(i))),!0)}function AF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ii))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=Ve.empty;for(let u=i.length-1;u>=0;u--)r=Ve.from(i[u].createAndFill(null,r));let a=t.state.tr.replace(n.pos,n.pos,new dt(r,0,0));return a.setSelection(Ft.near(a.doc.resolve(n.pos+1))),t.dispatch(a),!1}function IF(t){if(!(t.selection instanceof ii))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",pi.create(t.doc,[Gr.widget(t.selection.head,e,{key:"gapcursor"})])}const PF=Ai.create({name:"gapCursor",addProseMirrorPlugins(){return[CF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=nn(kt(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),DF=bs.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:S})=>{if(S&&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()}}}),OF=bs.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=>M0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Zf=200,Ii=function(){};Ii.prototype.append=function(e){return e.length?(e=Ii.from(e),!this.length&&e||e.length<Zf&&this.leafAppend(e)||this.length<Zf&&e.leafPrepend(this)||this.appendInner(e)):this},Ii.prototype.prepend=function(e){return e.length?Ii.from(e).append(this):this},Ii.prototype.appendInner=function(e){return new zF(this,e)},Ii.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ii.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ii.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ii.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)},Ii.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},Ii.from=function(e){return e instanceof Ii?e:e&&e.length?new mS(e):Ii.empty};var mS=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<=Zf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Zf)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}(Ii);Ii.empty=new mS([]);var zF=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}(Ii);const NF=500;class Us{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=[],S=[];return this.items.forEach((E,C)=>{if(!E.step){r||(r=this.remapping(i,C+1),a=r.maps.length),a--,S.push(E);return}if(r){S.push(new uo(E.map));let P=E.step.map(r.slice(a)),D;P&&u.maybeStep(P).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new uo(D,void 0,void 0,b.length+S.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 Us(this.items.slice(0,i).append(S.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 S=0;S<e.steps.length;S++){let E=e.steps[S].invert(e.docs[S]),C=new uo(e.mapping.maps[S],E,n),P;(P=g&&g.merge(C))&&(C=P,S?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>RF&&(l=BF(l,b),u-=b),new Us(l.append(a),u)}remapping(e,n){let i=new Ic;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 Us(this.items.append(e.map(n=>new uo(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 P=a.getMirror(--g);if(P==null)return;u=Math.min(u,P);let D=a.maps[P];if(C.step){let R=e.steps[P].invert(e.docs[P]),j=C.selection&&C.selection.map(a.slice(g+1,P));j&&l++,i.push(new uo(D,R,j))}else i.push(new uo(D))},r);let b=[];for(let C=n;C<u;C++)b.push(new uo(a.maps[C]));let S=this.items.slice(0,r).append(b).append(i),E=new Us(S,l);return E.emptyItemCount()>NF&&(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 S=u.selection&&u.selection.map(n.slice(i));S&&a++;let E=new uo(b.invert(),g,S),C,P=r.length-1;(C=r.length&&r[P].merge(E))?r[P]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Us(Ii.from(r.reverse()),a)}}Us.empty=new Us(Ii.empty,0);function BF(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class uo{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 uo(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 RF=20;function LF(t,e,n,i){let r=n.getMeta(Bl),a;if(r)return r.historyState;n.getMeta($F)&&(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(Bl))return u.getMeta(Bl).redo?new Ta(t.done.addTransform(n,void 0,i,Yf(e)),t.undone,gS(n.mapping.maps),t.prevTime,t.prevComposition):new Ta(t.done,t.undone.addTransform(n,void 0,i,Yf(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||!VF(n,t.prevRanges)),b=u?Z0(t.prevRanges,n.mapping):gS(n.mapping.maps);return new Ta(t.done.addTransform(n,g?e.selection.getBookmark():void 0,i,Yf(e)),Us.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),Z0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ta(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Z0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function VF(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 gS(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 Z0(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 FF(t,e,n){let i=Yf(e),r=Bl.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(Bl,{redo:n,historyState:g})}let Y0=!1,yS=null;function Yf(t){let e=t.plugins;if(yS!=e){Y0=!1,yS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Y0=!0;break}}return Y0}const Bl=new Mr("history"),$F=new Mr("closeHistory");function jF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Fi({key:Bl,state:{init(){return new Ta(Us.empty,Us.empty,null,0,-1)},apply(e,n,i){return LF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?bS:i=="historyRedo"?xS:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function _S(t,e){return(n,i)=>{let r=Bl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=FF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const bS=_S(!1,!0),xS=_S(!0,!0),UF=Ai.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>bS(t,e),redo:()=>({state:t,dispatch:e})=>xS(t,e)}},addProseMirrorPlugins(){return[jF(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()}}}),HF=bs.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}):v2(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,S=b.end();if(b.nodeAfter)b.nodeAfter.isTextblock?u.setSelection(Ft.create(u.doc,b.pos+1)):b.nodeAfter.isBlock?u.setSelection(zt.create(u.doc,b.pos)):u.setSelection(Ft.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(S,E),u.setSelection(Ft.create(u.doc,S+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[w3({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),qF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,WF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,GF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ZF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,YF=oo.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[qc({find:qF,type:this.type}),qc({find:GF,type:this.type})]},addPasteRules(){return[Wc({find:WF,type:this.type}),Wc({find:ZF,type:this.type})]}}),vS=/^(\d+)\.\s$/,XF=bs.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(W0.name,this.editor.getAttributes(Zh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Rh({find:vS,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=Rh({find:vS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Zh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),KF=bs.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()}}}),JF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,QF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,e6=oo.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[qc({find:JF,type:this.type})]},addPasteRules(){return[Wc({find:QF,type:this.type})]}}),wS=bs.create({name:"text",group:"inline"}),t6=Ai.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,g,b,S,E,C,P,D,R,j,W;const ee=[];return this.options.bold!==!1&&ee.push(pF.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&ee.push(lF.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&ee.push(fF.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&ee.push(yF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&ee.push(fS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&ee.push(xF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&ee.push(kF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&ee.push(PF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&ee.push(DF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&ee.push(OF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&ee.push(UF.configure((S=this.options)===null||S===void 0?void 0:S.history)),this.options.horizontalRule!==!1&&ee.push(HF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&ee.push(YF.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&ee.push(W0.configure((P=this.options)===null||P===void 0?void 0:P.listItem)),this.options.orderedList!==!1&&ee.push(XF.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&ee.push(KF.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&ee.push(e6.configure((j=this.options)===null||j===void 0?void 0:j.strike)),this.options.text!==!1&&ee.push(wS.configure((W=this.options)===null||W===void 0?void 0:W.text)),ee}}),n6=Ai.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 i6(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=k3(n),g=new RegExp(`\\s${l}$`),b=a?"^":"",S=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,P=Array.from(E.matchAll(S)).pop();if(!P||P.input===void 0||P.index===void 0)return null;const D=P.input.slice(Math.max(0,P.index-1),P.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const j=C+P.index;let W=j+P[0].length;return i&&g.test(E.slice(W-1,W+1))&&(P[0]+=" ",W+=1),j<u.pos&&W>=u.pos?{range:{from:j,to:W},query:P[0].slice(n.length),text:P[0]}:null}const r6=new Mr("suggestion");function s6({pluginKey:t=r6,editor:e,char:n="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:g=()=>null,items:b=()=>[],render:S=()=>({}),allow:E=()=>!0,findSuggestionMatch:C=i6}){let P;const D=S==null?void 0:S(),R=new Fi({key:t,view(){return{update:async(j,W)=>{var ee,le,J,Te,xe,Ae,$e;const Pe=(ee=this.key)===null||ee===void 0?void 0:ee.getState(W),Xe=(le=this.key)===null||le===void 0?void 0:le.getState(j.state),rt=Pe.active&&Xe.active&&Pe.range.from!==Xe.range.from,Rt=!Pe.active&&Xe.active,pt=Pe.active&&!Xe.active,Nt=!Rt&&!pt&&Pe.query!==Xe.query,Xt=Rt||rt&&Nt,rn=Nt||rt,jt=pt||rt&&Nt;if(!Xt&&!rn&&!jt)return;const Kt=jt&&!Xt?Pe:Xe,En=j.dom.querySelector(`[data-decoration-id="${Kt.decorationId}"]`);P={editor:e,range:Kt.range,query:Kt.query,text:Kt.text,items:[],command:dn=>g({editor:e,range:Kt.range,props:dn}),decorationNode:En,clientRect:En?()=>{var dn;const{decorationId:xn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),vt=j.dom.querySelector(`[data-decoration-id="${xn}"]`);return(vt==null?void 0:vt.getBoundingClientRect())||null}:null},Xt&&((J=D==null?void 0:D.onBeforeStart)===null||J===void 0||J.call(D,P)),rn&&((Te=D==null?void 0:D.onBeforeUpdate)===null||Te===void 0||Te.call(D,P)),(rn||Xt)&&(P.items=await b({editor:e,query:Kt.query})),jt&&((xe=D==null?void 0:D.onExit)===null||xe===void 0||xe.call(D,P)),rn&&((Ae=D==null?void 0:D.onUpdate)===null||Ae===void 0||Ae.call(D,P)),Xt&&(($e=D==null?void 0:D.onStart)===null||$e===void 0||$e.call(D,P))},destroy:()=>{var j;P&&((j=D==null?void 0:D.onExit)===null||j===void 0||j.call(D,P))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(j,W,ee,le){const{isEditable:J}=e,{composing:Te}=e.view,{selection:xe}=j,{empty:Ae,from:$e}=xe,Pe={...W};if(Pe.composing=Te,J&&(Ae||e.view.composing)){($e<W.range.from||$e>W.range.to)&&!Te&&!W.composing&&(Pe.active=!1);const Xe=C({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:xe.$from}),rt=`id_${Math.floor(Math.random()*4294967295)}`;Xe&&E({editor:e,state:le,range:Xe.range,isActive:W.active})?(Pe.active=!0,Pe.decorationId=W.decorationId?W.decorationId:rt,Pe.range=Xe.range,Pe.query=Xe.query,Pe.text=Xe.text):Pe.active=!1}else Pe.active=!1;return Pe.active||(Pe.decorationId=null,Pe.range={from:0,to:0},Pe.query=null,Pe.text=null),Pe}},props:{handleKeyDown(j,W){var ee;const{active:le,range:J}=R.getState(j.state);return le&&((ee=D==null?void 0:D.onKeyDown)===null||ee===void 0?void 0:ee.call(D,{view:j,event:W,range:J}))||!1},decorations(j){const{active:W,range:ee,decorationId:le}=R.getState(j);return W?pi.create(j.doc,[Gr.inline(ee.from,ee.to,{nodeName:u,class:l,"data-decoration-id":le})]):null}}});return R}const o6=new Mr("mention"),a6=bs.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:o6,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[s6({editor:this.editor,...this.options.suggestion})]}}),l6=oo.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()}}}),c6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function u6(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 h6=Fe(c6,[["render",u6]]),d6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function p6(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 f6=Fe(d6,[["render",p6]]),m6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function g6(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 y6=Fe(m6,[["render",g6]]),_6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function b6(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 x6=Fe(_6,[["render",b6]]),v6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function w6(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 k6=Fe(v6,[["render",w6]]),S6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function E6(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 C6=Fe(S6,[["render",E6]]),T6={},M6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function A6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",M6,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 I6={components:{IconA:Fe(T6,[["render",A6]])},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)}}},P6={class:"relative flex"},D6={class:"flex w-[160px] flex-wrap gap-[4px]"},O6=["onClick"];function z6(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",P6,[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",D6,[(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,O6))),128))])])]),_:1},512)}const N6=Fe(I6,[["render",z6]]),B6={},R6={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 L6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",R6,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 kS=Fe(B6,[["render",L6]]),V6={components:{IconMore:kS},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 F6(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 $6={bold:k6,italic:C6,text_more:Fe(V6,[["render",F6]]),color:N6,bullet_list:f6,ordered_list:y6,blockquote:h6,codeblock:x6},j6={components:{EditorContent:oF},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($6).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 sF({content:this.modelValue,extensions:[t6,fS,Zh,n6,l6,wS,a6.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()}}},U6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},H6={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 q6(t,e,n,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",U6,[r.editor?(f.openBlock(),f.createElementBlock("div",H6,[(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 SS=Fe(j6,[["render",q6]]),W6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},G6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return W6(this.name)}}},Z6={class:"mr-2"},Y6=["src"],X6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},K6={key:0},J6={key:1,class:"text-sm"};function Q6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",Z6,[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,Y6)):n.name?(f.openBlock(),f.createElementBlock("div",X6,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",K6,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",J6,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const e$={components:{VsWidgetCommentsAvatar:Fe(G6,[["render",Q6]]),VsTextEditor:SS},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=ct(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 lt.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 lt.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}}},t$={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},n$={class:"flex justify-between items-center mb-2"},i$={class:"flex items-center"},r$={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},s$={class:"text-sm text-gray-600 dark:text-gray-400"},o$={class:"flex flex-col items-center gap-[4px]"},a$=["innerHTML"],l$={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},c$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function u$(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",t$,[f.createElementVNode("div",n$,[f.createElementVNode("div",i$,[f.createElementVNode("p",r$,[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",s$,[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",o$,[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]=(...S)=>a.openEditModal&&a.openEditModal(...S))}," Редагувати "),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]=S=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),f.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:n.comment.body},null,8,a$)]),f.createVNode(b,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=S=>r.isOpen=S),title:"Редагувати",size:"small"},{footer:f.withCtx(()=>[f.createElementVNode("div",c$,[f.createElementVNode("button",{onClick:e[3]||(e[3]=S=>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]=(...S)=>a.updateComment&&a.updateComment(...S)),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",l$,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=S=>r.textareaValue=S),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const h$={components:{VsWidgetCommentsItem:Fe(e$,[["render",u$]])},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 lt.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}}},d$={class:"flex flex-col"},p$={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"},f$={key:1},m$={class:"p-4"},g$={class:"mt-1 text-gray-500 dark:text-neutral-500"},y$={class:"mt-4 flex justify-end gap-x-3"};function _$(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",d$,[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",p$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.comments,(S,E)=>(f.openBlock(),f.createBlock(l,{key:E,comment:S,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",f$,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]=S=>r.isModalVisible=S)},{default:f.withCtx(()=>[f.createElementVNode("div",m$,[f.createElementVNode("p",g$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",y$,[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]=(...S)=>r.modal.cancel&&r.modal.cancel(...S))},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]=(...S)=>r.modal.confirm&&r.modal.confirm(...S))},f.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const b$=Fe(h$,[["render",_$]]),x$={components:{VsTextEditor:SS},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 lt.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}}},v$={class:"flex flex-col items-start w-full widget-comment-form"},w$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},k$={class:"flex"};function S$(t,e,n,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",v$,[f.createElementVNode("div",w$,[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",k$,[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 E$={components:{VsWidgetCommentsList:b$,VsWidgetCommentsAddForm:Fe(x$,[["render",S$]])},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 lt.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"}}},C$={class:"w-full bg-white-200"};function T$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",C$,[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 ES=Fe(E$,[["render",T$]]),CS=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),M$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),A$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},I$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return A$(this.username)}}}),P$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function D$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",P$,f.toDisplayString(t.inItials),1)}const O$=Fe(I$,[["render",D$]]),X0={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)=>{X0.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)})}},z$={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 X0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await X0.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)}}},N$={id:"map",style:{height:"9rem",width:"24rem"}};function B$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",N$)}const R$=Fe(z$,[["render",B$]]),L$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:O$,VsWidgetHistoryItemMap:R$},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 M$(t.cdate)}}}),V$={class:"relative [&_p]:m-0"},F$={class:"flex items-center gap-3"},$$={class:"w-full flex justify-between"},j$={class:"text-gray-500"},U$={class:"text-gray-800 font-medium"},H$={class:"text-gray-500 text-sm"},q$={class:"mt-2 pl-10"},W$={key:0},G$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},Z$={class:"font-medium"},Y$={class:"font-medium"};function X$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",V$,[f.createElementVNode("div",F$,[f.createVNode(u,{username:t.item.username},null,8,["username"]),f.createElementVNode("div",$$,[f.createElementVNode("p",j$,[f.createElementVNode("span",U$,f.toDisplayString(t.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",H$,f.toDisplayString(t.getDate(t.item)),1)])]),f.createElementVNode("div",q$,[(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",W$,[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",G$,[f.createElementVNode("p",null,f.toDisplayString(`- ${t.getTitle(g)}:`),1),f.createElementVNode("p",Z$,f.toDisplayString(t.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",Y$,f.toDisplayString(t.getNewValue(g)),1)]))]))),128))])])}const K$=Fe(L$,[["render",X$]]),J$=f.defineComponent({components:{VsWidgetHistoryItem:K$,VsEmptyWidget:jv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?CS(this.history.data.cdate):""},lastEditDate(){return this.history.data?CS(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 lt.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)}}}),Q$={class:"bg-white"},e8={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"},t8={key:1,class:"w-full h-[330px] flex items-center justify-center"};function n8(t,e,n,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",Q$,[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",e8,[(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",t8," Історія відсутні "))])}const i8={"vs-widget-map":q1,"vs-widget-gallery":OB,"vs-widget-comments":ES,"vs-widget-file":Hv,"vs-widget-history":Fe(J$,[["render",n8]])},r8={"table-format-text":gp,"table-format-select":Fx,"table-format-badge":Lx,"table-format-swetch":yp,"table-format-check":yp,"table-format-html":gp,"table-format-tags":$x,"table-format-date":sy,"table-format-number":V1,"table-format-slot":F1},s8={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},o8={__name:"vs-dashboard",setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",s8,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)])))}},a8={},l8={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 c8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",l8,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 K0=Fe(a8,[["render",c8]]),u8={components:{IconSearch:K0},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 lt.get("/api/user-cls");this.data=t}catch{}}}},h8={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},d8={class:"relative"},p8={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)"}},f8={class:"w-[99%] overflow-hidden overflow-ellipsis"},m8={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function g8(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",h8,[f.createElementVNode("div",d8,[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",p8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.rows,b=>{var S,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=(S=t.$route)==null?void 0:S.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",f8,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",m8,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const y8=Fe(u8,[["render",g8]]),_8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},b8={class:"w-full"},x8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},v8={class:"max-w-sm mx-auto mt-6"},w8={class:"font-medium text-gray-800 dark:text-neutral-200"},k8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function S8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",b8,[f.createElementVNode("div",x8,[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",v8,[f.createElementVNode("p",w8,f.toDisplayString(n.title),1),f.createElementVNode("p",k8,f.toDisplayString(n.text),1)])])])}const TS=Fe(_8,[["render",S8]]),E8={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()}}},C8={class:"flex w-[160px] flex-wrap gap-[4px]"},T8=["onClick"];function M8(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",C8,[(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,T8))),128))])])]),_:1},512)}const MS=Fe(E8,[["render",M8]]),A8={components:{VsChoceColor:MS},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)}}},I8={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},P8={class:"flex flex-col"},D8={class:"flex gap-[30px]"},O8={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},z8={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},N8={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function B8(t,e,n,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",I8,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",P8,[f.createElementVNode("div",D8,[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",O8,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",z8,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",N8,f.toDisplayString((g=n.item)==null?void 0:g.parent),1)])])}const R8={components:{VsReesterUsersItem:Fe(A8,[["render",B8]])},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)}}},L8={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)"}},V8=["onDragstart","onDrop"];function F8(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",L8,[(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,V8))),128))])}const $8={components:{VsNoData:TS,VsChoceColor:MS,IconCheck:Vx,VsReesterUsersList:Fe(R8,[["render",F8],["__scopeId","data-v-87c0b333"]])},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 lt.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 lt.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 lt.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)}}}},j8={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},U8={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},H8={class:"flex items-end w-full gap-[4px]"};function q8(t,e,n,i,r,a){var E,C,P,D,R;const u=f.resolveComponent("VsForm"),l=f.resolveComponent("VsChoceColor"),g=f.resolveComponent("IconCheck"),b=f.resolveComponent("VsReesterUsersList"),S=f.resolveComponent("VsNoData");return f.openBlock(),f.createElementBlock("div",j8,[(C=(E=t.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",U8,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",H8,[r.formVisible?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=j=>r.formValues=j),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]=j=>r.color=j)},null,8,["modelValue"]),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...j)=>a.addOneChild&&a.addOneChild(...j)),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=(P=r.data)==null?void 0:P.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(S,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const W8={components:{VsReesterNavList:y8,VsReesterContent:Fe($8,[["render",q8]])}},G8={class:"flex items-start gap-0"};function Z8(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",G8,[f.createVNode(u),f.createVNode(l)])}const J0={...i8,...r8,"vs-dashboard":o8,...{"user-cls-page":Fe(W8,[["render",Z8]])}},AS=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...AS(n.menu)):e.push(n)}),e},ks=f.ref(null),Y8=async()=>{try{const{data:t}=await lt.get("/api/user-menu");return ks.value=t,AS(t)}catch(t){return console.error(t),[]}},X8=(t,e)=>{Object.entries(e).forEach(([n,i])=>{t.component(n,i)})},K8={async install(t,{componentsApp:e={}}){try{const i=(await Y8()).filter(a=>a==null?void 0:a.component).map(a=>({...a,component:{...J0,...e}[a==null?void 0:a.component]}));X8(t,{...J0,...e}),t.component("admin",qT);const{router:r}=await TA(i);t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...xz,componentsApp:e},$router:r},t.use(r)}catch(n){console.error(n)}},components:J0},J8={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(ks.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 lt.get(`/api/template/table/${n}`),{data:u}=await lt.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 lt.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){try{await this.$refs.form.doValidation(),await lt.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 lt.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"})}}}},Q8={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},ej={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},tj={class:"flex items-center gap-[6px]"},nj={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},ij={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 rj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",Q8,[f.createElementVNode("div",ej,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",tj,[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",nj,[f.createElementVNode("div",ij,[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 sj=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(J8,[["render",rj]])},Symbol.toStringTag,{value:"Module"})),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(ks.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 lt.get(`/api/table-data/${n}`),{data:u}=await lt.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(){try{await this.$refs.form.doValidation(),await lt.post(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Заповніть обов'язкові поля",type:"error"})}}}},aj={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},lj={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},cj={class:"flex items-center gap-[6px]"},uj={style:{height:"calc(100vh - 165px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},hj={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 dj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",aj,[f.createElementVNode("div",lj,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",cj,[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",uj,[f.createElementVNode("div",hj,[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 pj=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(oj,[["render",dj]])},Symbol.toStringTag,{value:"Module"})),fj={};function mj(t,e,n,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const IS=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(fj,[["render",mj]])},Symbol.toStringTag,{value:"Module"})),gj={class:"h-[76px] bg-white border rounded-xl flex items-center justify-between px-[20px] mb-[16px]"},yj={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},_j={class:"flex items-center gap-[6px]"},bj={components:{AdminCardHeader:{__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0}},setup(t){const e=t,n=bA(),i=xA(),r=()=>{n.back()},a=f.computed(()=>{var u;return`/edit?table=${e.getRoute}&id=${(u=i==null?void 0:i.params)==null?void 0:u.id}`});return(u,l)=>{const g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",gj,[f.createElementVNode("div",null,[f.createElementVNode("button",{onClick:r,class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),f.createElementVNode("h2",yj,f.toDisplayString(t.title),1)]),f.createElementVNode("div",_j,[f.createVNode(g,{to:a.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(()=>l[0]||(l[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])])])}}}},data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(ks.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,S,E,C,P,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:((P=(C=(E=(S=this.objectData)==null?void 0:S.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:P.slice(0,35))+" ...";{const R=(D=this.flattenMenu(ks.value))==null?void 0:D.find(j=>{var W,ee;return(j==null?void 0:j.table)===((ee=(W=this.$route)==null?void 0:W.params)==null?void 0:ee.table)});return R==null?void 0:R.ua}}},async mounted(){await this.getObjectData(),await this.checkActiveComponent()},watch:{component(t){this.$router.replace({...this.$route,query:{tab:t}})}},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 lt.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(S=>(S==null?void 0:S.type)==="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}}},xj={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},vj={key:0,class:"bg-white border rounded-xl"},wj={class:"p-[10px] pl-[20px] text-md font-[500]"},kj=["innerHTML"],Sj={key:1},Ej={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},Cj={key:2,class:"p-[20px] border-t"},Tj=["innerHTML"],Mj={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]"},Aj=["onClick"],Ij={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},Pj={key:0,class:"p-[20px] border-t"},Dj={key:1,class:"p-[20px] border-t"},Oj=["innerHTML"],zj={key:3,class:"flex"},Nj={class:"flex flex-col space-y-2 w-[200px] border rounded-xl mr-4 h-auto items-start pl-[10px] bg-white py-[20px]"},Bj=["onClick"],Rj={class:"flex-grow"},Lj={key:0,class:"h-full bg-white border rounded-xl"},Vj={key:0,class:"p-[20px]"},Fj={key:1,class:"p-[20px] border-t"},$j=["innerHTML"];function jj(t,e,n,i,r,a){var l,g;const u=f.resolveComponent("AdminCardHeader");return f.openBlock(),f.createElementBlock("div",xj,[((l=r.objectData)==null?void 0:l.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute},null,8,["title","get-route"])):f.createCommentVNode("",!0),f.createElementVNode("div",{class:f.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((g=r.objectData)==null?void 0:g.panels,(b,S)=>{var E;return f.openBlock(),f.createElementBlock("div",{key:S,class:f.normalizeClass(a.getColClass(b.col))},[b!=null&&b.name?(f.openBlock(),f.createElementBlock("div",vj,[f.createElementVNode("h2",wj,f.toDisplayString((b==null?void 0:b.title)||"Панель"),1),f.createElementVNode("div",{class:"p-[20px] border-t",innerHTML:(E=r.objectData)==null?void 0:E.data[b==null?void 0:b.name]},null,8,kj)])):b.type==="container"?(f.openBlock(),f.createElementBlock("div",Sj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b.items,(C,P)=>{var D,R,j,W,ee;return f.openBlock(),f.createElementBlock("div",{key:P,class:f.normalizeClass([{"mb-[20px]":b.items.length>1},"bg-white border rounded-xl"])},[b!=null&&b.title?(f.openBlock(),f.createElementBlock("h2",Ej,f.toDisplayString((C==null?void 0:C.title)||"Панель"),1)):f.createCommentVNode("",!0),C!=null&&C.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":b==null?void 0:b.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(C.component),{geometry:(R=(D=r.objectData)==null?void 0:D.rows[0])==null?void 0:R.geom,zoom:16,id:(W=(j=t.$route)==null?void 0:j.params)==null?void 0:W.id},null,8,["geometry","id"]))],2)):f.createCommentVNode("",!0),C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Cj,[f.createElementVNode("div",{innerHTML:(ee=r.objectData)==null?void 0:ee.data[C==null?void 0:C.name]},null,8,Tj)])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(b==null?void 0:b.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",Mj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b==null?void 0:b.items,C=>(f.openBlock(),f.createElementBlock("button",{key:(C==null?void 0:C.name)||(C==null?void 0:C.component),onClick:P=>r.component=(C==null?void 0:C.component)||(C==null?void 0:C.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===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name),"":r.component!==(C==null?void 0:C.component)&&r.component!==(C==null?void 0:C.name)}])},f.toDisplayString(C==null?void 0:C.title),11,Aj))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b.items,(C,P)=>{var D,R,j,W,ee;return f.openBlock(),f.createElementBlock(f.Fragment,{key:P},[r.component===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name)?(f.openBlock(),f.createElementBlock("div",Ij,[C!=null&&C.component?(f.openBlock(),f.createElementBlock("div",Pj,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(C.component),{geometry:(R=(D=r.objectData)==null?void 0:D.rows[0])==null?void 0:R.geom,zoom:16,id:(W=(j=t.$route)==null?void 0:j.params)==null?void 0:W.id},null,8,["geometry","id"]))])):f.createCommentVNode("",!0),C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Dj,[f.createElementVNode("div",{innerHTML:(ee=r.objectData)==null?void 0:ee.data[C==null?void 0:C.name]},null,8,Oj)])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(b==null?void 0:b.type)==="vertical_tabs"?(f.openBlock(),f.createElementBlock("div",zj,[f.createElementVNode("nav",Nj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b==null?void 0:b.items,C=>(f.openBlock(),f.createElementBlock("button",{key:(C==null?void 0:C.name)||(C==null?void 0:C.component),onClick:P=>r.component=(C==null?void 0:C.component)||(C==null?void 0:C.name),class:f.normalizeClass(["relative inline-flex items-center w-full py-1 text-sm border-transparent pe-4 gap-x-2 border-e-2 whitespace-nowrap 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===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name),"text-gray-500":r.component!==(C==null?void 0:C.component)&&r.component!==(C==null?void 0:C.name)}])},f.toDisplayString(C==null?void 0:C.title),11,Bj))),128))]),f.createElementVNode("div",Rj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b.items,(C,P)=>{var D,R,j,W,ee;return f.openBlock(),f.createElementBlock(f.Fragment,{key:P},[r.component===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name)?(f.openBlock(),f.createElementBlock("div",Lj,[C!=null&&C.component?(f.openBlock(),f.createElementBlock("div",Vj,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(C.component),{geometry:(R=(D=r.objectData)==null?void 0:D.rows[0])==null?void 0:R.geom,zoom:16,id:(W=(j=t.$route)==null?void 0:j.params)==null?void 0:W.id},null,8,["geometry","id"]))])):f.createCommentVNode("",!0),C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Fj,[f.createElementVNode("div",{innerHTML:(ee=r.objectData)==null?void 0:ee.data[C==null?void 0:C.name]},null,8,$j)])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const Uj=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(bj,[["render",jj],["__scopeId","data-v-f25e4f87"]])},Symbol.toStringTag,{value:"Module"})),Hj={},qj={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 Wj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",qj,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 Gj=Fe(Hj,[["render",Wj]]),Zj={},Yj={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Xj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Yj,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 Kj=Fe(Zj,[["render",Xj]]),Jj={},Qj={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 e7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Qj,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 PS=Fe(Jj,[["render",e7]]),t7={components:{IconChevronDown:PS},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}}},n7={key:0,class:""},i7={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"},r7={key:1};function s7(t,e,n,i,r,a){var g,b,S,E,C,P,D,R,j,W,ee,le,J;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=n.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",n7,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Te=>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-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300",[((S=(b=n.route)==null?void 0:b.menu)==null?void 0:S.some(Te=>{var xe,Ae;return(Te==null?void 0:Te.path)===t.$route.path.replace("/","")||(Te==null?void 0:Te.table)===((Ae=(xe=t.$route)==null?void 0:xe.params)==null?void 0:Ae.table)&&(Te==null?void 0:Te.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 Te;return[f.withDirectives(f.createElementVNode("ul",i7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Te=n.route)==null?void 0:Te.menu,(xe,Ae)=>{var $e,Pe;return f.openBlock(),f.createElementBlock("li",{key:Ae,class:"w-full"},[f.createVNode(l,{to:"/"+(xe==null?void 0:xe.path),class:f.normalizeClass([[((xe==null?void 0:xe.path)===t.$route.path.replace("/","")||((Pe=($e=t.$route)==null?void 0:$e.params)==null?void 0:Pe.table)===(xe==null?void 0:xe.table)&&(xe==null?void 0:xe.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(xe==null?void 0:xe.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(f.openBlock(),f.createElementBlock("div",r7,[f.createVNode(l,{to:((P=(C=n.route)==null?void 0:C.path)==null?void 0:P[0])==="/"?(D=n.route)==null?void 0:D.path:"/"+((R=n.route)==null?void 0:R.path),class:f.normalizeClass([[(((j=n.route)==null?void 0:j.path.replace("/",""))===t.$route.path.replace("/","")||((ee=(W=t.$route)==null?void 0:W.params)==null?void 0:ee.table)===((le=n.route)==null?void 0:le.table)&&((J=n.route)==null?void 0:J.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 Te;return[f.createTextVNode(f.toDisplayString((Te=n.route)==null?void 0:Te.ua),1)]}),_:1},8,["to","class"])]))}const o7={components:{IconLogout:Gj,NavbarItem:Fe(t7,[["render",s7]]),IconLogo:Kj,IconSearch:K0},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t,e;return(t=this.searchValue)!=null&&t.trim()?(e=this.flattenMenu(ks.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())}):ks.value}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},a7={class:"flex flex-col h-[100vh] border-r w-[260px] shrink-0"},l7={class:"relative"},c7={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"},u7={class:"flex flex-col flex-wrap w-full pb-3"},h7={key:0,class:"flex flex-col gap-[6px]"},d7={key:1,class:"text-gray-800 text-lg mt-[20px]"};function p7(t,e,n,i,r,a){var S;const u=f.resolveComponent("IconLogo"),l=f.resolveComponent("IconSearch"),g=f.resolveComponent("VsText"),b=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",a7,[f.createVNode(u,{height:"40",width:"200",class:"my-[20px] ml-[20px]"}),f.createElementVNode("div",l7,[f.createVNode(l,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(g,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>r.searchValue=E),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",c7,[f.createElementVNode("nav",u7,[(S=a.data)!=null&&S.length?(f.openBlock(),f.createElementBlock("ul",h7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(E,C)=>(f.openBlock(),f.createElementBlock("li",{key:C,class:"flex flex-col gap-[6px]"},[f.createVNode(b,{route:E},null,8,["route"])]))),128))])):(f.openBlock(),f.createElementBlock("div",d7,"Не знайдено"))])])])}const f7=Fe(o7,[["render",p7]]),m7={},g7={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 y7(t,e){return f.openBlock(),f.createElementBlock("svg",g7,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 _7=Fe(m7,[["render",y7]]),b7={},x7={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 v7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",x7,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 DS=Fe(b7,[["render",v7]]),w7={},k7={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 S7(t,e){return f.openBlock(),f.createElementBlock("svg",k7,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 E7=Fe(w7,[["render",S7]]),C7={class:"relative shrink-0"},T7=["src"],M7={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},A7={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},I7={class:"grow"},P7={class:"text-xs text-gray-500 dark:text-neutral-500"},D7={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},O7={class:"text-sm text-gray-500 dark:text-neutral-500"},z7={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"},N7={__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 lt.get(`/api/notification-read/${(l=t.item)==null?void 0:l.id}`),await n("update-notification")}catch{}};return(l,g)=>{var S,E,C,P,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",[(S=t.item)!=null&&S.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",C7,[(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,T7)):(f.openBlock(),f.createElementBlock("div",M7,[f.createVNode(DS)])),(P=t.item)!=null&&P.read?(f.openBlock(),f.createElementBlock("span",A7)):f.createCommentVNode("",!0)]),f.createElementVNode("div",I7,[f.createElementVNode("p",P7,[f.createVNode(sy,{name:"cdate",data:t.item},null,8,["data"])]),f.createElementVNode("span",D7,f.toDisplayString((D=t.item)==null?void 0:D.author),1),f.createElementVNode("p",O7,f.toDisplayString((R=t.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",z7,[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(E7)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},B7={},R7={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 L7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",R7,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 V7=Fe(B7,[["render",L7]]),F7={},$7={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 j7(t,e){return f.openBlock(),f.createElementBlock("svg",$7,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 U7=Fe(F7,[["render",j7]]),H7={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},q7={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"},W7={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},G7={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)]"},Z7={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"},Y7={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"},X7={key:0},K7={__name:"admin-notification",setup(t){var b,S,E,C,P;const e=f.ref(0),n=f.ref([]),i=f.ref(!1),r=f.ref(null),a=(P=(C=(E=(S=(b=f.getCurrentInstance())==null?void 0:b.appContext)==null?void 0:S.app)==null?void 0:E.config)==null?void 0:C.globalProperties)==null?void 0:P.$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 lt.get("/api/notification");n.value=(D==null?void 0:D.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await lt.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]=j=>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(V7,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",H7,[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",q7,f.toDisplayString(e.value),1)])):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,null,{default:f.withCtx(()=>{var j;return[i.value?(f.openBlock(),f.createElementBlock("div",W7,[f.createElementVNode("div",G7,[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",Z7,[f.createVNode(U7)])]),f.createElementVNode("div",Y7,[(j=n.value)!=null&&j.length?(f.openBlock(),f.createElementBlock("ul",X7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.value,W=>(f.openBlock(),f.createBlock(N7,{key:W==null?void 0:W.id,item:W,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(_7,{height:"16",width:"16"}),R[3]||(R[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},J7={},Q7={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 e9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Q7,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 t9={components:{IconQuestion:Fe(J7,[["render",e9]]),IconUser:DS,AdminNotification:K7},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 lt.get("/user");this.userData=t}catch{}},async logout(){try{await lt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},n9={class:"h-[60px] border-b flex justify-end px-[20px]",style:{width:"calc(100vw - 260px)"}},i9={class:"flex items-center gap-[6px]"},r9={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"},s9={class:"relative"},o9=["src"],a9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},l9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},c9=["src"],u9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},h9={class:"text-[14px] mr-[10px] text-gray-500"},d9={class:"flex flex-col p-[4px]"};function p9(t,e,n,i,r,a){var S,E,C,P,D,R,j,W,ee,le;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",n9,[f.createElementVNode("div",i9,[f.createElementVNode("a",r9,[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",s9,[f.createElementVNode("div",{onClick:e[0]||(e[0]=J=>r.isVisible=!0),class:"cursor-pointer"},[(E=(S=r.userData)==null?void 0:S.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(P=(C=r.userData)==null?void 0:C.user)==null?void 0:P.avatar,alt:"Image Description"},null,8,o9)):(f.openBlock(),f.createElementBlock("div",a9,[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",l9,[(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:(W=(j=r.userData)==null?void 0:j.user)==null?void 0:W.avatar,alt:"Image Description"},null,8,c9)):(f.openBlock(),f.createElementBlock("div",u9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",h9,f.toDisplayString((le=(ee=r.userData)==null?void 0:ee.user)==null?void 0:le.username),1)])]),f.createElementVNode("div",d9,[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]=(...J)=>a.logout&&a.logout(...J)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const f9={components:{navbar:f7,AdminHeader:Fe(t9,[["render",p9]])},computed:{isMenu(){return ks.value||null}}},m9={class:"admin-wrapper"},g9={class:"flex flex-col"};function y9(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",m9,[f.createVNode(u),f.createElementVNode("div",g9,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createVNode(l),f.createVNode(g)],64)):f.createCommentVNode("",!0)])])}const _9=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(f9,[["render",y9],["__scopeId","data-v-a53a7af5"]])},Symbol.toStringTag,{value:"Module"})),b9={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}}},x9={scope:"col",class:"text-start px-2 py-1"},v9={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"},w9={key:0,d:"m7 15 5 5 5-5"},k9={key:1,d:"m7 9 5-5 5 5"},S9={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500"};function E9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("th",x9,[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",v9,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",w9)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",k9)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",S9,f.toDisplayString(a.label),1))])}const C9=Fe(b9,[["render",E9]]),T9={},M9={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 A9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",M9,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 I9=Fe(T9,[["render",A9]]),P9={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},D9={style:{display:"none"}},O9=["height","width","fill"];function z9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock("svg",D9,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,O9))],64)}const N9={components:{IconMore:kS,IconDelete:I9,IconEdit:Fe(P9,[["render",z9]])},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await lt.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 lt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await lt.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}}}},B9={class:"hs-dropdown [--placement:bottom-right] inline-flex"},R9={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"},L9={class:"flex flex-col items-start"},V9={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},F9={class:"p-4"},$9={class:"flex justify-end mt-4 gap-x-3"};function j9(t,e,n,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),S=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",B9,[f.createVNode(S,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",R9,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D,R,j;return[f.createElementVNode("div",L9,[(C=n.actions)!=null&&C.includes("edit")&&n.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(P=t.$route)==null?void 0:P.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),n.isForm?(f.openBlock(),f.createElementBlock("div",V9)):f.createCommentVNode("",!0),(j=n.actions)!=null&&j.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...W)=>a.openConfirm&&a.openConfirm(...W),["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",F9,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",$9,[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 U9=Fe(N9,[["render",j9]]),H9={},q9={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 W9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",q9,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 G9=Fe(H9,[["render",W9]]),Z9={},Y9={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 X9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Y9,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 K9={components:{IconExport:G9,IconChevronDown:PS,IconSuccess:Fe(Z9,[["render",X9]])},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 lt.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"}}},J9={key:0,class:"flex flex-col items-center"},Q9={key:1,class:"p-4"},eU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},tU={class:"flex items-center"},nU={class:"flex items-center gap-[10px] ml-auto"},iU=["onClick"],rU={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},sU={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},oU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},aU={class:"mt-2 space-y-2"},lU=["id","onChange"],cU=["for"],uU={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},hU={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function dU(t,e,n,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),S=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(S,{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",uU,[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",hU,[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",J9,[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",Q9,[f.createElementVNode("div",eU,[f.createElementVNode("div",tU,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",nU,[(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",rU)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,iU))),128))])]),f.createElementVNode("div",sU,[(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]=P=>r.cols=P),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",oU,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",aU,[(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:P=>a.selectFormat(E)},null,40,lU),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,cU)]))),128))])])]))]),_:1},8,["visible"])],64)}const pU=Fe(K9,[["render",dU]]),fU={},mU={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 gU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",mU,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 yU=Fe(fU,[["render",gU]]),_U={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)}},bU={class:"flex w-full gap-[8px] items-centr"};function xU(t,e,n,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",bU,[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 vU={components:{IconColumns:yU,AdminTableColumnsHiddenItem:Fe(_U,[["render",xU]])},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])}}},wU={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"},kU={class:"py-[10px] px-[10px] w-[260px]"},SU={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 EU(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",wU,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",kU,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",SU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,(b,S)=>(f.openBlock(),f.createElementBlock("li",{key:S},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const CU=Fe(vU,[["render",EU]]),TU={},MU={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function AU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",MU,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 OS=Fe(TU,[["render",AU]]),IU={},PU={class:"vs-table-interface__table-wrp w-full rounded h-fit overflow-hidden"};function DU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",PU,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 OU=Fe(IU,[["render",DU]]),zU={props:{row:Object,column:Object,table:String}};function NU(t,e,n,i,r,a){var u,l,g,b,S,E,C,P;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:(S=n.column)==null?void 0:S.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:(P=n.column)==null?void 0:P.edit},null,40,["name","data","value","table","column","edit"])}const zS=Fe(zU,[["render",NU]]),BU={},RU={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 LU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",RU,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 VU={components:{IconPlus:OS,IconMinus:Fe(BU,[["render",LU]])},props:{title:String},data(){return{expanded:!1}}},FU={class:"hs-accordion"},$U={class:"py-0.5 flex items-center gap-x-0.5 w-full"},jU={class:"text-sm font-medium"},UU={class:"w-full duration-150 before:block before:absolute relative inline-block b cursor-pointer"};function HU(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",FU,[f.createElementVNode("div",$U,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"grow rounded-md cursor-pointer"},[f.createElementVNode("span",jU,f.toDisplayString(n.title),1)]),f.createElementVNode("button",{class:"size-6 flex justify-center items-center hover:bg-gray-100 rounded-md",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",UU,[f.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const qU={components:{AdminComponentIs:zS,AdminTree:Fe(VU,[["render",HU],["__scopeId","data-v-4139bc00"]]),VsNoData:TS,VsWidgetComments:ES,VsWidgetMap:q1,VsWidgetFileList:Hv},props:{table:String,columns:Array,row:Object}},WU={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)"}},GU={class:"border-l",style:{height:"calc(100vh - 360px)"}},ZU={class:"flex items-center justify-between py-1 gap-x-4"},YU={class:"col-span-1"},XU={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},KU={class:"col-span-2"},JU={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},QU={class:"table-info-card"},eH={class:"table-info-card"};function tH(t,e,n,i,r,a){var C,P;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),S=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",WU,[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",GU,[(P=(C=t.$route)==null?void 0:C.query)!=null&&P.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[n.row?(f.openBlock(),f.createBlock(l,{key:0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,D=>(f.openBlock(),f.createElementBlock("dl",ZU,[f.createElementVNode("dt",YU,[f.createElementVNode("p",XU,f.toDisplayString((D==null?void 0:D.ua)||(D==null?void 0:D.title))+": ",1)]),f.createElementVNode("dd",KU,[f.createElementVNode("p",JU,[f.createVNode(u,{row:n.row,column:D,table:n.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var D,R;return[(D=n.row)!=null&&D.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:(R=n.row)==null?void 0:R.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.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var D;return[f.createElementVNode("div",QU,[f.createVNode(S,{id:(D=n.row)==null?void 0:D.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var D;return[f.createElementVNode("div",eH,[f.createVNode(E,{id:(D=n.row)==null?void 0:D.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const nH=Fe(qU,[["render",tH]]),iH={},rH={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 sH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",rH,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 oH=Fe(iH,[["render",sH]]),aH={},lH={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 cH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",lH,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 uH={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Fe(aH,[["render",cH]])},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},hH={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"},dH={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 pH(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",hH,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",dH,[(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 fH=Fe(uH,[["render",pH]]),mH={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},gH={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"},yH=["onClick"];function _H(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("nav",gH,[(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,yH))),256))])}const bH=Fe(mH,[["render",_H]]),xH={},vH={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 wH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",vH,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 kH={components:{IconFilter2:Fe(xH,[["render",wH]])},props:{filterCustom:String,customList:Array}},SH={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"},EH={class:"flex flex-col gap-[4px]"},CH=["onClick"];function TH(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",SH,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",EH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:S=>{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,CH))),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 MH={props:{table:String,title:String},components:{AdminTableControl:U9,AdminTableExport:pU,AdminTableColumnsHidden:CU,AdminTableColumn:C9,AdminNodata:OU,IconPlus:OS,IconSearch:K0,AdminTableCardInfo:nH,IconOpenCard:oH,AdminComponentIs:zS,AdminTableFilters:fH,AdminTableTabs:bH,AdminTableCustomFilters:Fe(kH,[["render",TH]])},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),immediate:!0},$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,filterCustom: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,S,E,C,P;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.filterState=((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filterState)||null,this.filterCustom=((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.filterCustom)||null,this.searchValue=((b=(g=this.$route)==null?void 0:g.query)==null?void 0:b.search)||null,this.visibleColumns=((C=(E=(S=this.$route)==null?void 0:S.query)==null?void 0:E.columns)==null?void 0:C.split(","))||[],(P=this.$route)!=null&&P.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,S;try{const{data:E}=await lt.get(`/api/template/table/${this.table}`),C=await lt.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(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:r.map(P=>P==null?void 0:P.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(P=>{var D;(D=this.visibleColumns)!=null&&D.includes(P==null?void 0:P.name)?P.hidden=!1:P.hidden=!0}):this.visibleColumns=(S=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:S.map(P=>P==null?void 0:P.name)}catch{}},async getFilters(){var t;try{const{data:e}=await lt.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}})}}},AH={class:"w-[calc(100vw - 320px)] bg-gray-50"},IH={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},PH={class:"text-xl font-medium"},DH={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex pt-[10px]"},OH={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},zH={class:"flex"},NH={class:"flex gap-[6px] ml-auto"},BH={class:"inline-block w-full align-middle"},RH={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"},LH={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},VH={class:"right-0 border-t border-stone-200"},FH={class:"divide-y divide-gray-200"},$H={class:"px-4 py-3 text-sm text-gray-600"},jH=["onClick"],UH=["onClick"],HH={key:0,class:"text-center sticky right-0 bg-white w-[80px] px-[10px]"},qH={class:"p-[20px] flex justify-start items-center w-full"},WH={class:"w-[200px]"},GH={class:"text-sm text-gray-600 dark:text-neutral-400"},ZH={class:"font-semibold text-gray-800 dark:text-neutral-200"},YH={class:"font-semibold text-gray-800 dark:text-neutral-200"};function XH(t,e,n,i,r,a){var xe,Ae,$e,Pe,Xe,rt,Rt,pt,Nt,Xt,rn,jt,Kt,En,dn,xn;const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("router-link"),g=f.resolveComponent("AdminTableTabs"),b=f.resolveComponent("IconSearch"),S=f.resolveComponent("VsText"),E=f.resolveComponent("AdminTableCustomFilters"),C=f.resolveComponent("AdminTableColumnsHidden"),P=f.resolveComponent("AdminTableExport"),D=f.resolveComponent("AdminTableFilters"),R=f.resolveComponent("IconOpenCard"),j=f.resolveComponent("AdminTableColumn"),W=f.resolveComponent("AdminComponentIs"),ee=f.resolveComponent("AdminTableControl"),le=f.resolveComponent("AdminNodata"),J=f.resolveComponent("VsPagination"),Te=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",AH,[f.createElementVNode("div",IH,[f.createElementVNode("h2",PH,f.toDisplayString(n.title),1),a.isForm?(f.openBlock(),f.createBlock(l,{key:0,to:`/add?table=${(Ae=(xe=t.$route)==null?void 0:xe.params)==null?void 0:Ae.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",DH,[f.createElementVNode("div",OH,[(Pe=($e=r.tableData)==null?void 0:$e.filterState)!=null&&Pe.length?(f.openBlock(),f.createBlock(g,{key:0,tabsList:(Xe=r.tableData)==null?void 0:Xe.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=vt=>r.filterState=vt)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",zH,[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(S,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=vt=>r.searchValue=vt),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",NH,[(Rt=(rt=r.tableData)==null?void 0:rt.filterCustom)!=null&&Rt.length?(f.openBlock(),f.createBlock(E,{key:0,customList:(pt=r.tableData)==null?void 0:pt.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=vt=>r.filterCustom=vt)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(C,{columns:(Nt=r.tableData)==null?void 0:Nt.columns,onUpdateColumns:e[3]||(e[3]=vt=>r.tableData.columns=vt)},null,8,["columns"]),f.createVNode(P,{table:n.table,columns:(Xt=r.tableData)==null?void 0:Xt.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"]),f.createVNode(D,{scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"]),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...vt)=>a.toggleCardInfo&&a.toggleCardInfo(...vt)),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(R,{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:(jt=(rn=r.tableData)==null?void 0:rn.filterState)!=null&&jt.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",BH,[a.isNoData?(f.openBlock(),f.createBlock(le,{key:1})):(f.openBlock(),f.createElementBlock("table",RH,[f.createElementVNode("thead",LH,[f.createElementVNode("tr",VH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,vt=>(f.openBlock(),f.createBlock(j,{key:vt.name,style:f.normalizeStyle({width:a.rowWidth(vt==null?void 0:vt.name),textAlign:vt==null?void 0:vt.align,wordBreak:vt==null?void 0:vt.wrap}),data:vt,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),e[6]||(e[6]=f.createElementVNode("th",{class:"w-[70px] sticky right-0 top-0"},null,-1))])]),f.createElementVNode("tbody",FH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Kt=r.tableData)==null?void 0:Kt.rows,(vt,ri)=>{var Bn,Pn,Rn;return f.openBlock(),f.createElementBlock("tr",{key:ri},[f.createElementVNode("td",$H,[f.createElementVNode("button",{onClick:()=>a.pushToCard(vt==null?void 0:vt.id),class:f.normalizeClass(["text-sm font-medium",[((Bn=r.tableData)==null?void 0:Bn.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(W,{row:vt,column:a.columns[0],table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,jH)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Pn=a.columns)==null?void 0:Pn.slice(1),Ee=>(f.openBlock(),f.createElementBlock("td",{onClick:je=>a.changeActiveCardInfo(vt==null?void 0:vt.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start whitespace-nowrap",{"cursor-pointer":r.isVisibleCardInfo}]),key:Ee.name},[f.createVNode(W,{row:vt,column:Ee,table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,UH))),128)),(Rn=a.getActions)!=null&&Rn.length?(f.openBlock(),f.createElementBlock("td",HH,[f.createVNode(ee,{actions:a.getActions,isForm:a.isForm,item:vt,table:n.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])])):f.createCommentVNode("",!0)])}),128))])]))])],4)],2),f.createElementVNode("div",qH,[f.createElementVNode("div",WH,[f.createElementVNode("p",GH,[f.createElementVNode("span",ZH,f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((En=r.tableData)==null?void 0:En.count)||0)+" з ",1),f.createElementVNode("span",YH,f.toDisplayString(((dn=r.tableData)==null?void 0:dn.total)||0),1)])]),r.limit?(f.openBlock(),f.createBlock(J,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((xn=r.tableData)==null?void 0:xn.total)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(Te,{key:0,table:n.table,columns:a.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]),_:1})])])])])}const KH={components:{AdminTable:Fe(MH,[["render",XH],["__scopeId","data-v-4fec8b49"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){ks!=null&&ks.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){t&&(document.title=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(ks.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 lt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},JH=["innerHTML"];function QH(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,JH))}const eq=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(KH,[["render",QH]])},Symbol.toStringTag,{value:"Module"}));return K8});
|
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:S})=>{if(S&&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()}}}),OF=bs.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=>M0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Zf=200,Ii=function(){};Ii.prototype.append=function(e){return e.length?(e=Ii.from(e),!this.length&&e||e.length<Zf&&this.leafAppend(e)||this.length<Zf&&e.leafPrepend(this)||this.appendInner(e)):this},Ii.prototype.prepend=function(e){return e.length?Ii.from(e).append(this):this},Ii.prototype.appendInner=function(e){return new zF(this,e)},Ii.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ii.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ii.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ii.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)},Ii.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},Ii.from=function(e){return e instanceof Ii?e:e&&e.length?new mS(e):Ii.empty};var mS=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<=Zf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Zf)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}(Ii);Ii.empty=new mS([]);var zF=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}(Ii);const NF=500;class Us{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=[],S=[];return this.items.forEach((E,C)=>{if(!E.step){r||(r=this.remapping(i,C+1),a=r.maps.length),a--,S.push(E);return}if(r){S.push(new uo(E.map));let P=E.step.map(r.slice(a)),D;P&&u.maybeStep(P).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new uo(D,void 0,void 0,b.length+S.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 Us(this.items.slice(0,i).append(S.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 S=0;S<e.steps.length;S++){let E=e.steps[S].invert(e.docs[S]),C=new uo(e.mapping.maps[S],E,n),P;(P=g&&g.merge(C))&&(C=P,S?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>RF&&(l=BF(l,b),u-=b),new Us(l.append(a),u)}remapping(e,n){let i=new Ic;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 Us(this.items.append(e.map(n=>new uo(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 P=a.getMirror(--g);if(P==null)return;u=Math.min(u,P);let D=a.maps[P];if(C.step){let R=e.steps[P].invert(e.docs[P]),j=C.selection&&C.selection.map(a.slice(g+1,P));j&&l++,i.push(new uo(D,R,j))}else i.push(new uo(D))},r);let b=[];for(let C=n;C<u;C++)b.push(new uo(a.maps[C]));let S=this.items.slice(0,r).append(b).append(i),E=new Us(S,l);return E.emptyItemCount()>NF&&(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 S=u.selection&&u.selection.map(n.slice(i));S&&a++;let E=new uo(b.invert(),g,S),C,P=r.length-1;(C=r.length&&r[P].merge(E))?r[P]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Us(Ii.from(r.reverse()),a)}}Us.empty=new Us(Ii.empty,0);function BF(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class uo{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 uo(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 RF=20;function LF(t,e,n,i){let r=n.getMeta(Bl),a;if(r)return r.historyState;n.getMeta($F)&&(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(Bl))return u.getMeta(Bl).redo?new Ta(t.done.addTransform(n,void 0,i,Yf(e)),t.undone,gS(n.mapping.maps),t.prevTime,t.prevComposition):new Ta(t.done,t.undone.addTransform(n,void 0,i,Yf(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||!VF(n,t.prevRanges)),b=u?Z0(t.prevRanges,n.mapping):gS(n.mapping.maps);return new Ta(t.done.addTransform(n,g?e.selection.getBookmark():void 0,i,Yf(e)),Us.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),Z0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ta(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Z0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function VF(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 gS(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 Z0(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 FF(t,e,n){let i=Yf(e),r=Bl.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(Bl,{redo:n,historyState:g})}let Y0=!1,yS=null;function Yf(t){let e=t.plugins;if(yS!=e){Y0=!1,yS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Y0=!0;break}}return Y0}const Bl=new Mr("history"),$F=new Mr("closeHistory");function jF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Fi({key:Bl,state:{init(){return new Ta(Us.empty,Us.empty,null,0,-1)},apply(e,n,i){return LF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?bS:i=="historyRedo"?xS:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function _S(t,e){return(n,i)=>{let r=Bl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=FF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const bS=_S(!1,!0),xS=_S(!0,!0),UF=Ai.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>bS(t,e),redo:()=>({state:t,dispatch:e})=>xS(t,e)}},addProseMirrorPlugins(){return[jF(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()}}}),HF=bs.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}):v2(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,S=b.end();if(b.nodeAfter)b.nodeAfter.isTextblock?u.setSelection(Ft.create(u.doc,b.pos+1)):b.nodeAfter.isBlock?u.setSelection(zt.create(u.doc,b.pos)):u.setSelection(Ft.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(S,E),u.setSelection(Ft.create(u.doc,S+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[w4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),qF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,WF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,GF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ZF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,YF=oo.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[qc({find:qF,type:this.type}),qc({find:GF,type:this.type})]},addPasteRules(){return[Wc({find:WF,type:this.type}),Wc({find:ZF,type:this.type})]}}),vS=/^(\d+)\.\s$/,XF=bs.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(W0.name,this.editor.getAttributes(Zh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Rh({find:vS,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=Rh({find:vS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Zh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),KF=bs.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()}}}),JF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,QF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,e6=oo.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[qc({find:JF,type:this.type})]},addPasteRules(){return[Wc({find:QF,type:this.type})]}}),wS=bs.create({name:"text",group:"inline"}),t6=Ai.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,g,b,S,E,C,P,D,R,j,W;const ee=[];return this.options.bold!==!1&&ee.push(pF.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&ee.push(lF.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&ee.push(fF.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&ee.push(yF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&ee.push(fS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&ee.push(xF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&ee.push(kF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&ee.push(PF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&ee.push(DF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&ee.push(OF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&ee.push(UF.configure((S=this.options)===null||S===void 0?void 0:S.history)),this.options.horizontalRule!==!1&&ee.push(HF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&ee.push(YF.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&ee.push(W0.configure((P=this.options)===null||P===void 0?void 0:P.listItem)),this.options.orderedList!==!1&&ee.push(XF.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&ee.push(KF.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&ee.push(e6.configure((j=this.options)===null||j===void 0?void 0:j.strike)),this.options.text!==!1&&ee.push(wS.configure((W=this.options)===null||W===void 0?void 0:W.text)),ee}}),n6=Ai.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 i6(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=k4(n),g=new RegExp(`\\s${l}$`),b=a?"^":"",S=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,P=Array.from(E.matchAll(S)).pop();if(!P||P.input===void 0||P.index===void 0)return null;const D=P.input.slice(Math.max(0,P.index-1),P.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const j=C+P.index;let W=j+P[0].length;return i&&g.test(E.slice(W-1,W+1))&&(P[0]+=" ",W+=1),j<u.pos&&W>=u.pos?{range:{from:j,to:W},query:P[0].slice(n.length),text:P[0]}:null}const r6=new Mr("suggestion");function s6({pluginKey:t=r6,editor:e,char:n="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:g=()=>null,items:b=()=>[],render:S=()=>({}),allow:E=()=>!0,findSuggestionMatch:C=i6}){let P;const D=S==null?void 0:S(),R=new Fi({key:t,view(){return{update:async(j,W)=>{var ee,le,J,Te,xe,Ae,$e;const Pe=(ee=this.key)===null||ee===void 0?void 0:ee.getState(W),Xe=(le=this.key)===null||le===void 0?void 0:le.getState(j.state),rt=Pe.active&&Xe.active&&Pe.range.from!==Xe.range.from,Rt=!Pe.active&&Xe.active,pt=Pe.active&&!Xe.active,Nt=!Rt&&!pt&&Pe.query!==Xe.query,Xt=Rt||rt&&Nt,rn=Nt||rt,jt=pt||rt&&Nt;if(!Xt&&!rn&&!jt)return;const Kt=jt&&!Xt?Pe:Xe,En=j.dom.querySelector(`[data-decoration-id="${Kt.decorationId}"]`);P={editor:e,range:Kt.range,query:Kt.query,text:Kt.text,items:[],command:dn=>g({editor:e,range:Kt.range,props:dn}),decorationNode:En,clientRect:En?()=>{var dn;const{decorationId:xn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),vt=j.dom.querySelector(`[data-decoration-id="${xn}"]`);return(vt==null?void 0:vt.getBoundingClientRect())||null}:null},Xt&&((J=D==null?void 0:D.onBeforeStart)===null||J===void 0||J.call(D,P)),rn&&((Te=D==null?void 0:D.onBeforeUpdate)===null||Te===void 0||Te.call(D,P)),(rn||Xt)&&(P.items=await b({editor:e,query:Kt.query})),jt&&((xe=D==null?void 0:D.onExit)===null||xe===void 0||xe.call(D,P)),rn&&((Ae=D==null?void 0:D.onUpdate)===null||Ae===void 0||Ae.call(D,P)),Xt&&(($e=D==null?void 0:D.onStart)===null||$e===void 0||$e.call(D,P))},destroy:()=>{var j;P&&((j=D==null?void 0:D.onExit)===null||j===void 0||j.call(D,P))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(j,W,ee,le){const{isEditable:J}=e,{composing:Te}=e.view,{selection:xe}=j,{empty:Ae,from:$e}=xe,Pe={...W};if(Pe.composing=Te,J&&(Ae||e.view.composing)){($e<W.range.from||$e>W.range.to)&&!Te&&!W.composing&&(Pe.active=!1);const Xe=C({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:xe.$from}),rt=`id_${Math.floor(Math.random()*4294967295)}`;Xe&&E({editor:e,state:le,range:Xe.range,isActive:W.active})?(Pe.active=!0,Pe.decorationId=W.decorationId?W.decorationId:rt,Pe.range=Xe.range,Pe.query=Xe.query,Pe.text=Xe.text):Pe.active=!1}else Pe.active=!1;return Pe.active||(Pe.decorationId=null,Pe.range={from:0,to:0},Pe.query=null,Pe.text=null),Pe}},props:{handleKeyDown(j,W){var ee;const{active:le,range:J}=R.getState(j.state);return le&&((ee=D==null?void 0:D.onKeyDown)===null||ee===void 0?void 0:ee.call(D,{view:j,event:W,range:J}))||!1},decorations(j){const{active:W,range:ee,decorationId:le}=R.getState(j);return W?pi.create(j.doc,[Gr.inline(ee.from,ee.to,{nodeName:u,class:l,"data-decoration-id":le})]):null}}});return R}const o6=new Mr("mention"),a6=bs.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:o6,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[s6({editor:this.editor,...this.options.suggestion})]}}),l6=oo.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()}}}),c6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function u6(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 h6=Fe(c6,[["render",u6]]),d6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function p6(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 f6=Fe(d6,[["render",p6]]),m6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function g6(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 y6=Fe(m6,[["render",g6]]),_6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function b6(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 x6=Fe(_6,[["render",b6]]),v6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function w6(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 k6=Fe(v6,[["render",w6]]),S6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function E6(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 C6=Fe(S6,[["render",E6]]),T6={},M6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function A6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",M6,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 I6={components:{IconA:Fe(T6,[["render",A6]])},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)}}},P6={class:"relative flex"},D6={class:"flex w-[160px] flex-wrap gap-[4px]"},O6=["onClick"];function z6(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",P6,[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",D6,[(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,O6))),128))])])]),_:1},512)}const N6=Fe(I6,[["render",z6]]),B6={},R6={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 L6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",R6,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 kS=Fe(B6,[["render",L6]]),V6={components:{IconMore:kS},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 F6(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 $6={bold:k6,italic:C6,text_more:Fe(V6,[["render",F6]]),color:N6,bullet_list:f6,ordered_list:y6,blockquote:h6,codeblock:x6},j6={components:{EditorContent:oF},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($6).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 sF({content:this.modelValue,extensions:[t6,fS,Zh,n6,l6,wS,a6.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()}}},U6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},H6={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 q6(t,e,n,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",U6,[r.editor?(f.openBlock(),f.createElementBlock("div",H6,[(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 SS=Fe(j6,[["render",q6]]),W6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},G6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return W6(this.name)}}},Z6={class:"mr-2"},Y6=["src"],X6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},K6={key:0},J6={key:1,class:"text-sm"};function Q6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",Z6,[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,Y6)):n.name?(f.openBlock(),f.createElementBlock("div",X6,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",K6,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",J6,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const e$={components:{VsWidgetCommentsAvatar:Fe(G6,[["render",Q6]]),VsTextEditor:SS},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=ct(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 lt.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 lt.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}}},t$={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},n$={class:"flex justify-between items-center mb-2"},i$={class:"flex items-center"},r$={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},s$={class:"text-sm text-gray-600 dark:text-gray-400"},o$={class:"flex flex-col items-center gap-[4px]"},a$=["innerHTML"],l$={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},c$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function u$(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",t$,[f.createElementVNode("div",n$,[f.createElementVNode("div",i$,[f.createElementVNode("p",r$,[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",s$,[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",o$,[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]=(...S)=>a.openEditModal&&a.openEditModal(...S))}," Редагувати "),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]=S=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),f.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:n.comment.body},null,8,a$)]),f.createVNode(b,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=S=>r.isOpen=S),title:"Редагувати",size:"small"},{footer:f.withCtx(()=>[f.createElementVNode("div",c$,[f.createElementVNode("button",{onClick:e[3]||(e[3]=S=>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]=(...S)=>a.updateComment&&a.updateComment(...S)),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",l$,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=S=>r.textareaValue=S),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const h$={components:{VsWidgetCommentsItem:Fe(e$,[["render",u$]])},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 lt.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}}},d$={class:"flex flex-col"},p$={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"},f$={key:1},m$={class:"p-4"},g$={class:"mt-1 text-gray-500 dark:text-neutral-500"},y$={class:"mt-4 flex justify-end gap-x-3"};function _$(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",d$,[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",p$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.comments,(S,E)=>(f.openBlock(),f.createBlock(l,{key:E,comment:S,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",f$,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]=S=>r.isModalVisible=S)},{default:f.withCtx(()=>[f.createElementVNode("div",m$,[f.createElementVNode("p",g$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",y$,[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]=(...S)=>r.modal.cancel&&r.modal.cancel(...S))},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]=(...S)=>r.modal.confirm&&r.modal.confirm(...S))},f.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const b$=Fe(h$,[["render",_$]]),x$={components:{VsTextEditor:SS},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 lt.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}}},v$={class:"flex flex-col items-start w-full widget-comment-form"},w$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},k$={class:"flex"};function S$(t,e,n,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",v$,[f.createElementVNode("div",w$,[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",k$,[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 E$={components:{VsWidgetCommentsList:b$,VsWidgetCommentsAddForm:Fe(x$,[["render",S$]])},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 lt.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"}}},C$={class:"w-full bg-white-200"};function T$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",C$,[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 ES=Fe(E$,[["render",T$]]),CS=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),M$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),A$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},I$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return A$(this.username)}}}),P$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function D$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",P$,f.toDisplayString(t.inItials),1)}const O$=Fe(I$,[["render",D$]]),X0={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)=>{X0.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)})}},z$={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 X0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await X0.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)}}},N$={id:"map",style:{height:"9rem",width:"24rem"}};function B$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",N$)}const R$=Fe(z$,[["render",B$]]),L$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:O$,VsWidgetHistoryItemMap:R$},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 M$(t.cdate)}}}),V$={class:"relative [&_p]:m-0"},F$={class:"flex items-center gap-3"},$$={class:"w-full flex justify-between"},j$={class:"text-gray-500"},U$={class:"text-gray-800 font-medium"},H$={class:"text-gray-500 text-sm"},q$={class:"mt-2 pl-10"},W$={key:0},G$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},Z$={class:"font-medium"},Y$={class:"font-medium"};function X$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",V$,[f.createElementVNode("div",F$,[f.createVNode(u,{username:t.item.username},null,8,["username"]),f.createElementVNode("div",$$,[f.createElementVNode("p",j$,[f.createElementVNode("span",U$,f.toDisplayString(t.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",H$,f.toDisplayString(t.getDate(t.item)),1)])]),f.createElementVNode("div",q$,[(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",W$,[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",G$,[f.createElementVNode("p",null,f.toDisplayString(`- ${t.getTitle(g)}:`),1),f.createElementVNode("p",Z$,f.toDisplayString(t.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",Y$,f.toDisplayString(t.getNewValue(g)),1)]))]))),128))])])}const K$=Fe(L$,[["render",X$]]),J$=f.defineComponent({components:{VsWidgetHistoryItem:K$,VsEmptyWidget:jv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?CS(this.history.data.cdate):""},lastEditDate(){return this.history.data?CS(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 lt.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)}}}),Q$={class:"bg-white"},e8={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"},t8={key:1,class:"w-full h-[330px] flex items-center justify-center"};function n8(t,e,n,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",Q$,[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",e8,[(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",t8," Історія відсутні "))])}const i8={"vs-widget-map":q1,"vs-widget-gallery":OB,"vs-widget-comments":ES,"vs-widget-file":Hv,"vs-widget-history":Fe(J$,[["render",n8]])},r8={"table-format-text":gp,"table-format-select":Fx,"table-format-badge":Lx,"table-format-swetch":yp,"table-format-check":yp,"table-format-html":gp,"table-format-tags":$x,"table-format-date":sy,"table-format-number":V1,"table-format-slot":F1},s8={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},o8={__name:"vs-dashboard",setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",s8,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)])))}},a8={},l8={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 c8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",l8,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 K0=Fe(a8,[["render",c8]]),u8={components:{IconSearch:K0},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 lt.get("/api/user-cls");this.data=t}catch{}}}},h8={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},d8={class:"relative"},p8={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)"}},f8={class:"w-[99%] overflow-hidden overflow-ellipsis"},m8={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function g8(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",h8,[f.createElementVNode("div",d8,[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",p8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.rows,b=>{var S,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=(S=t.$route)==null?void 0:S.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",f8,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",m8,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const y8=Fe(u8,[["render",g8]]),_8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},b8={class:"w-full"},x8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},v8={class:"max-w-sm mx-auto mt-6"},w8={class:"font-medium text-gray-800 dark:text-neutral-200"},k8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function S8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",b8,[f.createElementVNode("div",x8,[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",v8,[f.createElementVNode("p",w8,f.toDisplayString(n.title),1),f.createElementVNode("p",k8,f.toDisplayString(n.text),1)])])])}const TS=Fe(_8,[["render",S8]]),E8={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()}}},C8={class:"flex w-[160px] flex-wrap gap-[4px]"},T8=["onClick"];function M8(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",C8,[(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,T8))),128))])])]),_:1},512)}const MS=Fe(E8,[["render",M8]]),A8={components:{VsChoceColor:MS},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)}}},I8={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},P8={class:"flex flex-col"},D8={class:"flex gap-[30px]"},O8={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},z8={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},N8={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function B8(t,e,n,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",I8,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",P8,[f.createElementVNode("div",D8,[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",O8,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",z8,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",N8,f.toDisplayString((g=n.item)==null?void 0:g.parent),1)])])}const R8={components:{VsReesterUsersItem:Fe(A8,[["render",B8]])},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)}}},L8={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)"}},V8=["onDragstart","onDrop"];function F8(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",L8,[(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,V8))),128))])}const $8={components:{VsNoData:TS,VsChoceColor:MS,IconCheck:Vx,VsReesterUsersList:Fe(R8,[["render",F8],["__scopeId","data-v-87c0b333"]])},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 lt.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 lt.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 lt.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)}}}},j8={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},U8={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},H8={class:"flex items-end w-full gap-[4px]"};function q8(t,e,n,i,r,a){var E,C,P,D,R;const u=f.resolveComponent("VsForm"),l=f.resolveComponent("VsChoceColor"),g=f.resolveComponent("IconCheck"),b=f.resolveComponent("VsReesterUsersList"),S=f.resolveComponent("VsNoData");return f.openBlock(),f.createElementBlock("div",j8,[(C=(E=t.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",U8,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",H8,[r.formVisible?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=j=>r.formValues=j),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]=j=>r.color=j)},null,8,["modelValue"]),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...j)=>a.addOneChild&&a.addOneChild(...j)),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=(P=r.data)==null?void 0:P.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(S,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const W8={components:{VsReesterNavList:y8,VsReesterContent:Fe($8,[["render",q8]])}},G8={class:"flex items-start gap-0"};function Z8(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",G8,[f.createVNode(u),f.createVNode(l)])}const J0={...i8,...r8,"vs-dashboard":o8,...{"user-cls-page":Fe(W8,[["render",Z8]])}},AS=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...AS(n.menu)):e.push(n)}),e},ks=f.ref(null),Y8=async()=>{try{const{data:t}=await lt.get("/api/user-menu");return ks.value=t,AS(t)}catch(t){return console.error(t),[]}},X8=(t,e)=>{Object.entries(e).forEach(([n,i])=>{t.component(n,i)})},K8={async install(t,{componentsApp:e={}}){try{const i=(await Y8()).filter(a=>a==null?void 0:a.component).map(a=>({...a,component:{...J0,...e}[a==null?void 0:a.component]}));X8(t,{...J0,...e}),t.component("admin",qT);const{router:r}=await TA(i);t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...xz,componentsApp:e},$router:r},t.use(r)}catch(n){console.error(n)}},components:J0},J8={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(ks.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 lt.get(`/api/template/table/${n}`),{data:u}=await lt.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 lt.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){try{await this.$refs.form.doValidation(),await lt.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 lt.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"})}}}},Q8={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},ej={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},tj={class:"flex items-center gap-[6px]"},nj={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},ij={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 rj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",Q8,[f.createElementVNode("div",ej,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",tj,[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",nj,[f.createElementVNode("div",ij,[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 sj=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(J8,[["render",rj]])},Symbol.toStringTag,{value:"Module"})),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(ks.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 lt.get(`/api/table-data/${n}`),{data:u}=await lt.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(){try{await this.$refs.form.doValidation(),await lt.post(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Заповніть обов'язкові поля",type:"error"})}}}},aj={style:{width:"calc(100vw - 260px)"},class:"bg-gray-50"},lj={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},cj={class:"flex items-center gap-[6px]"},uj={style:{height:"calc(100vh - 165px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},hj={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 dj(t,e,n,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",aj,[f.createElementVNode("div",lj,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",cj,[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",uj,[f.createElementVNode("div",hj,[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 pj=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(oj,[["render",dj]])},Symbol.toStringTag,{value:"Module"})),fj={};function mj(t,e,n,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const IS=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(fj,[["render",mj]])},Symbol.toStringTag,{value:"Module"})),gj={class:"h-[76px] bg-white border rounded-xl flex items-center justify-between px-[20px] mb-[16px]"},yj={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},_j={class:"flex items-center gap-[6px]"},bj={components:{AdminCardHeader:{__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0}},setup(t){const e=t,n=bA(),i=xA(),r=()=>{n.back()},a=f.computed(()=>{var u;return`/edit?table=${e.getRoute}&id=${(u=i==null?void 0:i.params)==null?void 0:u.id}`});return(u,l)=>{const g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",gj,[f.createElementVNode("div",null,[f.createElementVNode("button",{onClick:r,class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),f.createElementVNode("h2",yj,f.toDisplayString(t.title),1)]),f.createElementVNode("div",_j,[f.createVNode(g,{to:a.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(()=>l[0]||(l[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])])])}}}},data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(ks.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,S,E,C,P,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:((P=(C=(E=(S=this.objectData)==null?void 0:S.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:P.slice(0,35))+" ...";{const R=(D=this.flattenMenu(ks.value))==null?void 0:D.find(j=>{var W,ee;return(j==null?void 0:j.table)===((ee=(W=this.$route)==null?void 0:W.params)==null?void 0:ee.table)});return R==null?void 0:R.ua}}},async mounted(){await this.getObjectData(),await this.checkActiveComponent()},watch:{component(t){this.$router.replace({...this.$route,query:{tab:t}})}},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 lt.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(S=>(S==null?void 0:S.type)==="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}}},xj={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},vj={key:0,class:"bg-white border rounded-xl"},wj={class:"p-[10px] pl-[20px] text-md font-[500]"},kj=["innerHTML"],Sj={key:1},Ej={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},Cj={key:2,class:"p-[20px] border-t"},Tj=["innerHTML"],Mj={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]"},Aj=["onClick"],Ij={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},Pj={key:0,class:"p-[20px] border-t"},Dj={key:1,class:"p-[20px] border-t"},Oj=["innerHTML"],zj={key:3,class:"flex"},Nj={class:"flex flex-col space-y-2 w-[200px] border rounded-xl mr-4 h-auto items-start pl-[10px] bg-white py-[20px]"},Bj=["onClick"],Rj={class:"flex-grow"},Lj={key:0,class:"h-full bg-white border rounded-xl"},Vj={key:0,class:"p-[20px]"},Fj={key:1,class:"p-[20px] border-t"},$j=["innerHTML"];function jj(t,e,n,i,r,a){var l,g;const u=f.resolveComponent("AdminCardHeader");return f.openBlock(),f.createElementBlock("div",xj,[((l=r.objectData)==null?void 0:l.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute},null,8,["title","get-route"])):f.createCommentVNode("",!0),f.createElementVNode("div",{class:f.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((g=r.objectData)==null?void 0:g.panels,(b,S)=>{var E;return f.openBlock(),f.createElementBlock("div",{key:S,class:f.normalizeClass(a.getColClass(b.col))},[b!=null&&b.name?(f.openBlock(),f.createElementBlock("div",vj,[f.createElementVNode("h2",wj,f.toDisplayString((b==null?void 0:b.title)||"Панель"),1),f.createElementVNode("div",{class:"p-[20px] border-t",innerHTML:(E=r.objectData)==null?void 0:E.data[b==null?void 0:b.name]},null,8,kj)])):b.type==="container"?(f.openBlock(),f.createElementBlock("div",Sj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b.items,(C,P)=>{var D,R,j,W,ee;return f.openBlock(),f.createElementBlock("div",{key:P,class:f.normalizeClass([{"mb-[20px]":b.items.length>1},"bg-white border rounded-xl"])},[C!=null&&C.title?(f.openBlock(),f.createElementBlock("h2",Ej,f.toDisplayString((C==null?void 0:C.title)||"Панель"),1)):f.createCommentVNode("",!0),C!=null&&C.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":C==null?void 0:C.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(C.component),{geometry:(R=(D=r.objectData)==null?void 0:D.rows[0])==null?void 0:R.geom,zoom:16,id:(W=(j=t.$route)==null?void 0:j.params)==null?void 0:W.id},null,8,["geometry","id"]))],2)):f.createCommentVNode("",!0),C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Cj,[f.createElementVNode("div",{innerHTML:(ee=r.objectData)==null?void 0:ee.data[C==null?void 0:C.name]},null,8,Tj)])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(b==null?void 0:b.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",Mj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b==null?void 0:b.items,C=>(f.openBlock(),f.createElementBlock("button",{key:(C==null?void 0:C.name)||(C==null?void 0:C.component),onClick:P=>r.component=(C==null?void 0:C.component)||(C==null?void 0:C.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===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name),"":r.component!==(C==null?void 0:C.component)&&r.component!==(C==null?void 0:C.name)}])},f.toDisplayString(C==null?void 0:C.title),11,Aj))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b.items,(C,P)=>{var D,R,j,W,ee;return f.openBlock(),f.createElementBlock(f.Fragment,{key:P},[r.component===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name)?(f.openBlock(),f.createElementBlock("div",Ij,[C!=null&&C.component?(f.openBlock(),f.createElementBlock("div",Pj,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(C.component),{geometry:(R=(D=r.objectData)==null?void 0:D.rows[0])==null?void 0:R.geom,zoom:16,id:(W=(j=t.$route)==null?void 0:j.params)==null?void 0:W.id},null,8,["geometry","id"]))])):f.createCommentVNode("",!0),C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Dj,[f.createElementVNode("div",{innerHTML:(ee=r.objectData)==null?void 0:ee.data[C==null?void 0:C.name]},null,8,Oj)])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(b==null?void 0:b.type)==="vertical_tabs"?(f.openBlock(),f.createElementBlock("div",zj,[f.createElementVNode("nav",Nj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b==null?void 0:b.items,C=>(f.openBlock(),f.createElementBlock("button",{key:(C==null?void 0:C.name)||(C==null?void 0:C.component),onClick:P=>r.component=(C==null?void 0:C.component)||(C==null?void 0:C.name),class:f.normalizeClass(["relative inline-flex items-center w-full py-1 text-sm border-transparent pe-4 gap-x-2 border-e-2 whitespace-nowrap 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===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name),"text-gray-500":r.component!==(C==null?void 0:C.component)&&r.component!==(C==null?void 0:C.name)}])},f.toDisplayString(C==null?void 0:C.title),11,Bj))),128))]),f.createElementVNode("div",Rj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(b.items,(C,P)=>{var D,R,j,W,ee;return f.openBlock(),f.createElementBlock(f.Fragment,{key:P},[r.component===(C==null?void 0:C.component)||r.component===(C==null?void 0:C.name)?(f.openBlock(),f.createElementBlock("div",Lj,[C!=null&&C.component?(f.openBlock(),f.createElementBlock("div",Vj,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(C.component),{geometry:(R=(D=r.objectData)==null?void 0:D.rows[0])==null?void 0:R.geom,zoom:16,id:(W=(j=t.$route)==null?void 0:j.params)==null?void 0:W.id},null,8,["geometry","id"]))])):f.createCommentVNode("",!0),C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",Fj,[f.createElementVNode("div",{innerHTML:(ee=r.objectData)==null?void 0:ee.data[C==null?void 0:C.name]},null,8,$j)])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const Uj=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(bj,[["render",jj],["__scopeId","data-v-8e82b07c"]])},Symbol.toStringTag,{value:"Module"})),Hj={},qj={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 Wj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",qj,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 Gj=Fe(Hj,[["render",Wj]]),Zj={},Yj={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Xj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Yj,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 Kj=Fe(Zj,[["render",Xj]]),Jj={},Qj={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 e7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Qj,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 PS=Fe(Jj,[["render",e7]]),t7={components:{IconChevronDown:PS},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}}},n7={key:0,class:""},i7={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"},r7={key:1};function s7(t,e,n,i,r,a){var g,b,S,E,C,P,D,R,j,W,ee,le,J;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=n.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",n7,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Te=>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-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300",[((S=(b=n.route)==null?void 0:b.menu)==null?void 0:S.some(Te=>{var xe,Ae;return(Te==null?void 0:Te.path)===t.$route.path.replace("/","")||(Te==null?void 0:Te.table)===((Ae=(xe=t.$route)==null?void 0:xe.params)==null?void 0:Ae.table)&&(Te==null?void 0:Te.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 Te;return[f.withDirectives(f.createElementVNode("ul",i7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Te=n.route)==null?void 0:Te.menu,(xe,Ae)=>{var $e,Pe;return f.openBlock(),f.createElementBlock("li",{key:Ae,class:"w-full"},[f.createVNode(l,{to:"/"+(xe==null?void 0:xe.path),class:f.normalizeClass([[((xe==null?void 0:xe.path)===t.$route.path.replace("/","")||((Pe=($e=t.$route)==null?void 0:$e.params)==null?void 0:Pe.table)===(xe==null?void 0:xe.table)&&(xe==null?void 0:xe.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(xe==null?void 0:xe.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(f.openBlock(),f.createElementBlock("div",r7,[f.createVNode(l,{to:((P=(C=n.route)==null?void 0:C.path)==null?void 0:P[0])==="/"?(D=n.route)==null?void 0:D.path:"/"+((R=n.route)==null?void 0:R.path),class:f.normalizeClass([[(((j=n.route)==null?void 0:j.path.replace("/",""))===t.$route.path.replace("/","")||((ee=(W=t.$route)==null?void 0:W.params)==null?void 0:ee.table)===((le=n.route)==null?void 0:le.table)&&((J=n.route)==null?void 0:J.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 Te;return[f.createTextVNode(f.toDisplayString((Te=n.route)==null?void 0:Te.ua),1)]}),_:1},8,["to","class"])]))}const o7={components:{IconLogout:Gj,NavbarItem:Fe(t7,[["render",s7]]),IconLogo:Kj,IconSearch:K0},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t,e;return(t=this.searchValue)!=null&&t.trim()?(e=this.flattenMenu(ks.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())}):ks.value}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},a7={class:"flex flex-col h-[100vh] border-r w-[260px] shrink-0"},l7={class:"relative"},c7={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"},u7={class:"flex flex-col flex-wrap w-full pb-3"},h7={key:0,class:"flex flex-col gap-[6px]"},d7={key:1,class:"text-gray-800 text-lg mt-[20px]"};function p7(t,e,n,i,r,a){var S;const u=f.resolveComponent("IconLogo"),l=f.resolveComponent("IconSearch"),g=f.resolveComponent("VsText"),b=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",a7,[f.createVNode(u,{height:"40",width:"200",class:"my-[20px] ml-[20px]"}),f.createElementVNode("div",l7,[f.createVNode(l,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(g,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>r.searchValue=E),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",c7,[f.createElementVNode("nav",u7,[(S=a.data)!=null&&S.length?(f.openBlock(),f.createElementBlock("ul",h7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(E,C)=>(f.openBlock(),f.createElementBlock("li",{key:C,class:"flex flex-col gap-[6px]"},[f.createVNode(b,{route:E},null,8,["route"])]))),128))])):(f.openBlock(),f.createElementBlock("div",d7,"Не знайдено"))])])])}const f7=Fe(o7,[["render",p7]]),m7={},g7={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 y7(t,e){return f.openBlock(),f.createElementBlock("svg",g7,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 _7=Fe(m7,[["render",y7]]),b7={},x7={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 v7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",x7,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 DS=Fe(b7,[["render",v7]]),w7={},k7={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 S7(t,e){return f.openBlock(),f.createElementBlock("svg",k7,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 E7=Fe(w7,[["render",S7]]),C7={class:"relative shrink-0"},T7=["src"],M7={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},A7={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},I7={class:"grow"},P7={class:"text-xs text-gray-500 dark:text-neutral-500"},D7={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},O7={class:"text-sm text-gray-500 dark:text-neutral-500"},z7={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"},N7={__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 lt.get(`/api/notification-read/${(l=t.item)==null?void 0:l.id}`),await n("update-notification")}catch{}};return(l,g)=>{var S,E,C,P,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",[(S=t.item)!=null&&S.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",C7,[(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,T7)):(f.openBlock(),f.createElementBlock("div",M7,[f.createVNode(DS)])),(P=t.item)!=null&&P.read?(f.openBlock(),f.createElementBlock("span",A7)):f.createCommentVNode("",!0)]),f.createElementVNode("div",I7,[f.createElementVNode("p",P7,[f.createVNode(sy,{name:"cdate",data:t.item},null,8,["data"])]),f.createElementVNode("span",D7,f.toDisplayString((D=t.item)==null?void 0:D.author),1),f.createElementVNode("p",O7,f.toDisplayString((R=t.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",z7,[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(E7)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},B7={},R7={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 L7(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",R7,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 V7=Fe(B7,[["render",L7]]),F7={},$7={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 j7(t,e){return f.openBlock(),f.createElementBlock("svg",$7,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 U7=Fe(F7,[["render",j7]]),H7={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},q7={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"},W7={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},G7={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)]"},Z7={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"},Y7={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"},X7={key:0},K7={__name:"admin-notification",setup(t){var b,S,E,C,P;const e=f.ref(0),n=f.ref([]),i=f.ref(!1),r=f.ref(null),a=(P=(C=(E=(S=(b=f.getCurrentInstance())==null?void 0:b.appContext)==null?void 0:S.app)==null?void 0:E.config)==null?void 0:C.globalProperties)==null?void 0:P.$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 lt.get("/api/notification");n.value=(D==null?void 0:D.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await lt.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]=j=>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(V7,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",H7,[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",q7,f.toDisplayString(e.value),1)])):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,null,{default:f.withCtx(()=>{var j;return[i.value?(f.openBlock(),f.createElementBlock("div",W7,[f.createElementVNode("div",G7,[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",Z7,[f.createVNode(U7)])]),f.createElementVNode("div",Y7,[(j=n.value)!=null&&j.length?(f.openBlock(),f.createElementBlock("ul",X7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.value,W=>(f.openBlock(),f.createBlock(N7,{key:W==null?void 0:W.id,item:W,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(_7,{height:"16",width:"16"}),R[3]||(R[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},J7={},Q7={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 e9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Q7,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 t9={components:{IconQuestion:Fe(J7,[["render",e9]]),IconUser:DS,AdminNotification:K7},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 lt.get("/user");this.userData=t}catch{}},async logout(){try{await lt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},n9={class:"h-[60px] border-b flex justify-end px-[20px]",style:{width:"calc(100vw - 260px)"}},i9={class:"flex items-center gap-[6px]"},r9={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"},s9={class:"relative"},o9=["src"],a9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},l9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},c9=["src"],u9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},h9={class:"text-[14px] mr-[10px] text-gray-500"},d9={class:"flex flex-col p-[4px]"};function p9(t,e,n,i,r,a){var S,E,C,P,D,R,j,W,ee,le;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",n9,[f.createElementVNode("div",i9,[f.createElementVNode("a",r9,[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",s9,[f.createElementVNode("div",{onClick:e[0]||(e[0]=J=>r.isVisible=!0),class:"cursor-pointer"},[(E=(S=r.userData)==null?void 0:S.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(P=(C=r.userData)==null?void 0:C.user)==null?void 0:P.avatar,alt:"Image Description"},null,8,o9)):(f.openBlock(),f.createElementBlock("div",a9,[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",l9,[(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:(W=(j=r.userData)==null?void 0:j.user)==null?void 0:W.avatar,alt:"Image Description"},null,8,c9)):(f.openBlock(),f.createElementBlock("div",u9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",h9,f.toDisplayString((le=(ee=r.userData)==null?void 0:ee.user)==null?void 0:le.username),1)])]),f.createElementVNode("div",d9,[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]=(...J)=>a.logout&&a.logout(...J)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const f9={components:{navbar:f7,AdminHeader:Fe(t9,[["render",p9]])},computed:{isMenu(){return ks.value||null}}},m9={class:"admin-wrapper"},g9={class:"flex flex-col"};function y9(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",m9,[f.createVNode(u),f.createElementVNode("div",g9,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createVNode(l),f.createVNode(g)],64)):f.createCommentVNode("",!0)])])}const _9=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(f9,[["render",y9],["__scopeId","data-v-a53a7af5"]])},Symbol.toStringTag,{value:"Module"})),b9={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}}},x9={scope:"col",class:"text-start px-2 py-1"},v9={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"},w9={key:0,d:"m7 15 5 5 5-5"},k9={key:1,d:"m7 9 5-5 5 5"},S9={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500"};function E9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("th",x9,[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",v9,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",w9)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",k9)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",S9,f.toDisplayString(a.label),1))])}const C9=Fe(b9,[["render",E9]]),T9={},M9={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 A9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",M9,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 I9=Fe(T9,[["render",A9]]),P9={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},D9={style:{display:"none"}},O9=["height","width","fill"];function z9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock("svg",D9,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,O9))],64)}const N9={components:{IconMore:kS,IconDelete:I9,IconEdit:Fe(P9,[["render",z9]])},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await lt.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 lt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await lt.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}}}},B9={class:"hs-dropdown [--placement:bottom-right] inline-flex"},R9={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"},L9={class:"flex flex-col items-start"},V9={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},F9={class:"p-4"},$9={class:"flex justify-end mt-4 gap-x-3"};function j9(t,e,n,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),S=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",B9,[f.createVNode(S,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",R9,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D,R,j;return[f.createElementVNode("div",L9,[(C=n.actions)!=null&&C.includes("edit")&&n.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(P=t.$route)==null?void 0:P.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),n.isForm?(f.openBlock(),f.createElementBlock("div",V9)):f.createCommentVNode("",!0),(j=n.actions)!=null&&j.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...W)=>a.openConfirm&&a.openConfirm(...W),["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",F9,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",$9,[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 U9=Fe(N9,[["render",j9]]),H9={},q9={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 W9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",q9,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 G9=Fe(H9,[["render",W9]]),Z9={},Y9={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 X9(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Y9,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 K9={components:{IconExport:G9,IconChevronDown:PS,IconSuccess:Fe(Z9,[["render",X9]])},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 lt.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"}}},J9={key:0,class:"flex flex-col items-center"},Q9={key:1,class:"p-4"},eU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},tU={class:"flex items-center"},nU={class:"flex items-center gap-[10px] ml-auto"},iU=["onClick"],rU={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},sU={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},oU={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},aU={class:"mt-2 space-y-2"},lU=["id","onChange"],cU=["for"],uU={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},hU={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function dU(t,e,n,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),S=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(S,{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",uU,[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",hU,[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",J9,[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",Q9,[f.createElementVNode("div",eU,[f.createElementVNode("div",tU,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",nU,[(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",rU)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,iU))),128))])]),f.createElementVNode("div",sU,[(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]=P=>r.cols=P),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",oU,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",aU,[(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:P=>a.selectFormat(E)},null,40,lU),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,cU)]))),128))])])]))]),_:1},8,["visible"])],64)}const pU=Fe(K9,[["render",dU]]),fU={},mU={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 gU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",mU,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 yU=Fe(fU,[["render",gU]]),_U={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)}},bU={class:"flex w-full gap-[8px] items-centr"};function xU(t,e,n,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",bU,[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 vU={components:{IconColumns:yU,AdminTableColumnsHiddenItem:Fe(_U,[["render",xU]])},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])}}},wU={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"},kU={class:"py-[10px] px-[10px] w-[260px]"},SU={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 EU(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",wU,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",kU,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",SU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,(b,S)=>(f.openBlock(),f.createElementBlock("li",{key:S},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const CU=Fe(vU,[["render",EU]]),TU={},MU={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function AU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",MU,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 OS=Fe(TU,[["render",AU]]),IU={},PU={class:"vs-table-interface__table-wrp w-full rounded h-fit overflow-hidden"};function DU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",PU,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 OU=Fe(IU,[["render",DU]]),zU={props:{row:Object,column:Object,table:String}};function NU(t,e,n,i,r,a){var u,l,g,b,S,E,C,P;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:(S=n.column)==null?void 0:S.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:(P=n.column)==null?void 0:P.edit},null,40,["name","data","value","table","column","edit"])}const zS=Fe(zU,[["render",NU]]),BU={},RU={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 LU(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",RU,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 VU={components:{IconPlus:OS,IconMinus:Fe(BU,[["render",LU]])},props:{title:String},data(){return{expanded:!1}}},FU={class:"hs-accordion"},$U={class:"py-0.5 flex items-center gap-x-0.5 w-full"},jU={class:"text-sm font-medium"},UU={class:"w-full duration-150 before:block before:absolute relative inline-block b cursor-pointer"};function HU(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",FU,[f.createElementVNode("div",$U,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"grow rounded-md cursor-pointer"},[f.createElementVNode("span",jU,f.toDisplayString(n.title),1)]),f.createElementVNode("button",{class:"size-6 flex justify-center items-center hover:bg-gray-100 rounded-md",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",UU,[f.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const qU={components:{AdminComponentIs:zS,AdminTree:Fe(VU,[["render",HU],["__scopeId","data-v-4139bc00"]]),VsNoData:TS,VsWidgetComments:ES,VsWidgetMap:q1,VsWidgetFileList:Hv},props:{table:String,columns:Array,row:Object}},WU={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)"}},GU={class:"border-l",style:{height:"calc(100vh - 360px)"}},ZU={class:"flex items-center justify-between py-1 gap-x-4"},YU={class:"col-span-1"},XU={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},KU={class:"col-span-2"},JU={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},QU={class:"table-info-card"},eH={class:"table-info-card"};function tH(t,e,n,i,r,a){var C,P;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),S=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",WU,[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",GU,[(P=(C=t.$route)==null?void 0:C.query)!=null&&P.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[n.row?(f.openBlock(),f.createBlock(l,{key:0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.columns,D=>(f.openBlock(),f.createElementBlock("dl",ZU,[f.createElementVNode("dt",YU,[f.createElementVNode("p",XU,f.toDisplayString((D==null?void 0:D.ua)||(D==null?void 0:D.title))+": ",1)]),f.createElementVNode("dd",KU,[f.createElementVNode("p",JU,[f.createVNode(u,{row:n.row,column:D,table:n.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var D,R;return[(D=n.row)!=null&&D.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:(R=n.row)==null?void 0:R.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.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var D;return[f.createElementVNode("div",QU,[f.createVNode(S,{id:(D=n.row)==null?void 0:D.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var D;return[f.createElementVNode("div",eH,[f.createVNode(E,{id:(D=n.row)==null?void 0:D.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const nH=Fe(qU,[["render",tH]]),iH={},rH={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 sH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",rH,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 oH=Fe(iH,[["render",sH]]),aH={},lH={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 cH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",lH,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 uH={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Fe(aH,[["render",cH]])},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},hH={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"},dH={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 pH(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",hH,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",dH,[(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 fH=Fe(uH,[["render",pH]]),mH={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},gH={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"},yH=["onClick"];function _H(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("nav",gH,[(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,yH))),256))])}const bH=Fe(mH,[["render",_H]]),xH={},vH={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 wH(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",vH,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 kH={components:{IconFilter2:Fe(xH,[["render",wH]])},props:{filterCustom:String,customList:Array}},SH={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"},EH={class:"flex flex-col gap-[4px]"},CH=["onClick"];function TH(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",SH,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",EH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:S=>{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,CH))),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 MH={props:{table:String,title:String},components:{AdminTableControl:U9,AdminTableExport:pU,AdminTableColumnsHidden:CU,AdminTableColumn:C9,AdminNodata:OU,IconPlus:OS,IconSearch:K0,AdminTableCardInfo:nH,IconOpenCard:oH,AdminComponentIs:zS,AdminTableFilters:fH,AdminTableTabs:bH,AdminTableCustomFilters:Fe(kH,[["render",TH]])},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),immediate:!0},$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,filterCustom: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,S,E,C,P;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.filterState=((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filterState)||null,this.filterCustom=((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.filterCustom)||null,this.searchValue=((b=(g=this.$route)==null?void 0:g.query)==null?void 0:b.search)||null,this.visibleColumns=((C=(E=(S=this.$route)==null?void 0:S.query)==null?void 0:E.columns)==null?void 0:C.split(","))||[],(P=this.$route)!=null&&P.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,S;try{const{data:E}=await lt.get(`/api/template/table/${this.table}`),C=await lt.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(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:r.map(P=>P==null?void 0:P.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(P=>{var D;(D=this.visibleColumns)!=null&&D.includes(P==null?void 0:P.name)?P.hidden=!1:P.hidden=!0}):this.visibleColumns=(S=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:S.map(P=>P==null?void 0:P.name)}catch{}},async getFilters(){var t;try{const{data:e}=await lt.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}})}}},AH={class:"w-[calc(100vw - 320px)] bg-gray-50"},IH={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},PH={class:"text-xl font-medium"},DH={style:{height:"calc(100vh - 155px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex pt-[10px]"},OH={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},zH={class:"flex"},NH={class:"flex gap-[6px] ml-auto"},BH={class:"inline-block w-full align-middle"},RH={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"},LH={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},VH={class:"right-0 border-t border-stone-200"},FH={class:"divide-y divide-gray-200"},$H={class:"px-4 py-3 text-sm text-gray-600"},jH=["onClick"],UH=["onClick"],HH={key:0,class:"text-center sticky right-0 bg-white w-[80px] px-[10px]"},qH={class:"p-[20px] flex justify-start items-center w-full"},WH={class:"w-[200px]"},GH={class:"text-sm text-gray-600 dark:text-neutral-400"},ZH={class:"font-semibold text-gray-800 dark:text-neutral-200"},YH={class:"font-semibold text-gray-800 dark:text-neutral-200"};function XH(t,e,n,i,r,a){var xe,Ae,$e,Pe,Xe,rt,Rt,pt,Nt,Xt,rn,jt,Kt,En,dn,xn;const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("router-link"),g=f.resolveComponent("AdminTableTabs"),b=f.resolveComponent("IconSearch"),S=f.resolveComponent("VsText"),E=f.resolveComponent("AdminTableCustomFilters"),C=f.resolveComponent("AdminTableColumnsHidden"),P=f.resolveComponent("AdminTableExport"),D=f.resolveComponent("AdminTableFilters"),R=f.resolveComponent("IconOpenCard"),j=f.resolveComponent("AdminTableColumn"),W=f.resolveComponent("AdminComponentIs"),ee=f.resolveComponent("AdminTableControl"),le=f.resolveComponent("AdminNodata"),J=f.resolveComponent("VsPagination"),Te=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",AH,[f.createElementVNode("div",IH,[f.createElementVNode("h2",PH,f.toDisplayString(n.title),1),a.isForm?(f.openBlock(),f.createBlock(l,{key:0,to:`/add?table=${(Ae=(xe=t.$route)==null?void 0:xe.params)==null?void 0:Ae.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",DH,[f.createElementVNode("div",OH,[(Pe=($e=r.tableData)==null?void 0:$e.filterState)!=null&&Pe.length?(f.openBlock(),f.createBlock(g,{key:0,tabsList:(Xe=r.tableData)==null?void 0:Xe.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=vt=>r.filterState=vt)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",zH,[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(S,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=vt=>r.searchValue=vt),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",NH,[(Rt=(rt=r.tableData)==null?void 0:rt.filterCustom)!=null&&Rt.length?(f.openBlock(),f.createBlock(E,{key:0,customList:(pt=r.tableData)==null?void 0:pt.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=vt=>r.filterCustom=vt)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(C,{columns:(Nt=r.tableData)==null?void 0:Nt.columns,onUpdateColumns:e[3]||(e[3]=vt=>r.tableData.columns=vt)},null,8,["columns"]),f.createVNode(P,{table:n.table,columns:(Xt=r.tableData)==null?void 0:Xt.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"]),f.createVNode(D,{scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"]),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...vt)=>a.toggleCardInfo&&a.toggleCardInfo(...vt)),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(R,{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:(jt=(rn=r.tableData)==null?void 0:rn.filterState)!=null&&jt.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",BH,[a.isNoData?(f.openBlock(),f.createBlock(le,{key:1})):(f.openBlock(),f.createElementBlock("table",RH,[f.createElementVNode("thead",LH,[f.createElementVNode("tr",VH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,vt=>(f.openBlock(),f.createBlock(j,{key:vt.name,style:f.normalizeStyle({width:a.rowWidth(vt==null?void 0:vt.name),textAlign:vt==null?void 0:vt.align,wordBreak:vt==null?void 0:vt.wrap}),data:vt,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),e[6]||(e[6]=f.createElementVNode("th",{class:"w-[70px] sticky right-0 top-0"},null,-1))])]),f.createElementVNode("tbody",FH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Kt=r.tableData)==null?void 0:Kt.rows,(vt,ri)=>{var Bn,Pn,Rn;return f.openBlock(),f.createElementBlock("tr",{key:ri},[f.createElementVNode("td",$H,[f.createElementVNode("button",{onClick:()=>a.pushToCard(vt==null?void 0:vt.id),class:f.normalizeClass(["text-sm font-medium",[((Bn=r.tableData)==null?void 0:Bn.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(W,{row:vt,column:a.columns[0],table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,jH)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Pn=a.columns)==null?void 0:Pn.slice(1),Ee=>(f.openBlock(),f.createElementBlock("td",{onClick:je=>a.changeActiveCardInfo(vt==null?void 0:vt.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start whitespace-nowrap",{"cursor-pointer":r.isVisibleCardInfo}]),key:Ee.name},[f.createVNode(W,{row:vt,column:Ee,table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,UH))),128)),(Rn=a.getActions)!=null&&Rn.length?(f.openBlock(),f.createElementBlock("td",HH,[f.createVNode(ee,{actions:a.getActions,isForm:a.isForm,item:vt,table:n.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])])):f.createCommentVNode("",!0)])}),128))])]))])],4)],2),f.createElementVNode("div",qH,[f.createElementVNode("div",WH,[f.createElementVNode("p",GH,[f.createElementVNode("span",ZH,f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((En=r.tableData)==null?void 0:En.count)||0)+" з ",1),f.createElementVNode("span",YH,f.toDisplayString(((dn=r.tableData)==null?void 0:dn.total)||0),1)])]),r.limit?(f.openBlock(),f.createBlock(J,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((xn=r.tableData)==null?void 0:xn.total)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(Te,{key:0,table:n.table,columns:a.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]),_:1})])])])])}const KH={components:{AdminTable:Fe(MH,[["render",XH],["__scopeId","data-v-4fec8b49"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){ks!=null&&ks.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){t&&(document.title=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(ks.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 lt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},JH=["innerHTML"];function QH(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,JH))}const eq=Object.freeze(Object.defineProperty({__proto__:null,default:Fe(KH,[["render",QH]])},Symbol.toStringTag,{value:"Module"}));return K8});
|