OwlCyberSecurity - MANAGER
Edit File: Tabs.C-PQxwBC.js
import{b as ut,u as dt,o as ft}from"./links.C572zDFG.js";import"./default-i18n.Bd0Z306Z.js";import{T as pt,_ as vt,v as ht,w as _e}from"./_plugin-vue_export-helper.BLXtEB-G.js";import{u as mt,T as bt}from"./TruSeoScore.TjofuHRQ.js";import{S as yt,a as wt}from"./Ellipse.CAgnKuMU.js";import{B as gt,a as _t,c as St}from"./Caret.CGwYaMo_.js";import{S as $t}from"./Information.JAmX9TGg.js";import{T as Tt}from"./Slide.D2pWF0rN.js";import{r as ue,aW as Ct,w as U,am as Ie,b4 as Re,i as Pt,L as de,f as w,y as De,n as ae,b2 as xe,p as kt,u as Mt,N as Et,aZ as Ot,o as y,c as $,a as _,m as A,aa as P,j as q,e as fe,g as b,ak as Lt,af as Fe,k as j,l as R,A as Nt,q as je,v as E,B as F,F as oe,ac as re,t as I,b as O,C as ie}from"./runtime-core.esm-bundler.DMBo7TXk.js";const Ve={locks:{},zIndex:2e3,enableRipple:!0};ue(Ve);var He=ue(Ve),zt=Object.defineProperty,Bt=Object.defineProperties,At=Object.getOwnPropertyDescriptors,Se=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable,$e=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t)=>{for(var n in t||(t={}))Wt.call(t,n)&&$e(e,n,t[n]);if(Se)for(var n of Se(t))It.call(t,n)&&$e(e,n,t[n]);return e},Dt=(e,t)=>Bt(e,At(t)),k=e=>typeof e=="string",xt=e=>typeof e=="boolean",pe=e=>typeof e=="number",Ue=e=>pe(e)||k(e)&&/^[-+]?\d+$/.test(e),Ft=e=>Object.prototype.toString.call(e)==="[object Object]",jt=e=>typeof e=="function",qe=e=>Array.isArray(e),Vt=e=>e===window,Ht=()=>ee()&&"ontouchstart"in window,ee=()=>typeof window<"u",Te=(e,t)=>{if(e.length){const n=e.indexOf(t);if(n>-1)return e.splice(n,1)}},Ut=(...e)=>e.map(t=>{if(qe(t)){const[n,o,r=null]=t;return n?o:r}return t}),qt=()=>typeof globalThis<"u"?globalThis:ee()?window:typeof global<"u"?global:self,le=e=>{const t=qt();return t.requestAnimationFrame?t.requestAnimationFrame(e):t.setTimeout(e)},Yt=()=>new Promise(e=>{le(e)}),Ye=()=>new Promise(e=>{le(()=>{le(e)})}),ve=e=>window.getComputedStyle(e),Z=e=>{if(Vt(e)){const t=e.innerWidth,n=e.innerHeight,o={x:0,y:0,top:0,left:0,right:t,bottom:n,width:t,height:n};return Dt(Rt({},o),{toJSON:()=>o})}return e.getBoundingClientRect()},Xt=e=>{const t="scrollTop"in e?e.scrollTop:e.scrollY;return Math.max(t,0)},Kt=e=>{const t="scrollLeft"in e?e.scrollLeft:e.scrollX;return Math.max(t,0)};function D(e,...t){if(qe(e))return e.map(n=>n(...t));if(e)return e(...t)}var Xe=e=>e==null?0:k(e)?(e=parseFloat(e),e=Number.isNaN(e)?0:e,e):xt(e)?Number(e):e,Zt=(e,t,n)=>Math.min(n,Math.max(t,e)),Gt=e=>Jt(e).replace(e.charAt(0),e.charAt(0).toUpperCase()),Jt=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase());function Qt(e){return t=>{const n=`${e}-${t}`,o=r=>r?r[0]==="$"?r.replace("$",e):r.startsWith("--")?`${n}${r}`:`${n}__${r}`:n;return{name:Gt(n),n:o,classes:Ut}}}var en=Object.defineProperty,G=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,Ce=(e,t,n)=>t in e?en(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tn=(e,t)=>{for(var n in t||(t={}))Ke.call(t,n)&&Ce(e,n,t[n]);if(G)for(var n of G(t))Ze.call(t,n)&&Ce(e,n,t[n]);return e},nn=(e,t)=>{var n={};for(var o in e)Ke.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&G)for(var o of G(e))t.indexOf(o)<0&&Ze.call(e,o)&&(n[o]=e[o]);return n};function Ge(e){let t=!1;De(()=>{e(),ae(()=>{t=!0})}),xe(()=>{t&&e()})}function ce(e,t,n,o={}){if(!ee())return;const{passive:r=!1,capture:i=!1}=o;let a=!1,l=!1;const s=f=>jt(f)?f():Mt(f),c=f=>{if(a||l)return;const u=s(f);u&&(u.addEventListener(t,n,{passive:r,capture:i}),a=!0)},d=f=>{if(!a||l)return;const u=s(f);u&&(u.removeEventListener(t,n,{capture:i}),a=!1)};let v;Ct(e)&&(v=U(()=>e.value,(f,u)=>{d(u),c(f)}));const h=()=>{v==null||v(),d(e),l=!0};return Ge(()=>{c(e)}),Ie(()=>{d(e)}),Re(()=>{d(e)}),h}function on(e){let t=!1;Re(()=>{t=!0,e()}),Et(()=>{t||e()})}function rn(e){const t=de();return e in t.provides}function sn(e){if(!rn(e))return{index:null,parentProvider:null,bindParent:null};const n=Pt(e),{childInstances:o,collect:r,clear:i}=n,a=nn(n,["childInstances","collect","clear"]),l=de();return{index:w(()=>o.indexOf(l)),parentProvider:a,bindParent:d=>{De(()=>{ae().then(()=>{r(l,d)})}),Ie(()=>{ae().then(()=>{i(l,d)})})}}}function an(e){const t=[],n=o=>{if(o!=null&&o.component){n(o==null?void 0:o.component.subTree);return}Array.isArray(o==null?void 0:o.children)&&o.children.forEach(r=>{Ot(r)&&(t.push(r),n(r))})};return n(e),t}function ln(e){const t=de(),n=ue([]),o=[],r=w(()=>n.length),i=()=>{const c=an(t.subTree);n.sort((d,v)=>c.indexOf(d.vnode)-c.indexOf(v.vnode))},a=(c,d)=>{n.push(c),o.push(d),i()},l=(c,d)=>{Te(n,c),Te(o,d)};return{length:r,childProviders:o,bindChildren:c=>{kt(e,tn({childInstances:n,collect:a,clear:l},c))}}}function Je(e){ce(()=>window,"resize",e,{passive:!0}),ce(()=>window,"orientationchange",e,{passive:!0})}var cn=Object.defineProperty,un=Object.defineProperties,dn=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,fn=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,ke=(e,t,n)=>t in e?cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vn=(e,t)=>{for(var n in t||(t={}))fn.call(t,n)&&ke(e,n,t[n]);if(Pe)for(var n of Pe(t))pn.call(t,n)&&ke(e,n,t[n]);return e},hn=(e,t)=>un(e,dn(t));function se(e,t){return Array.isArray(t)?t.reduce((n,o)=>(n[o]=e[o],n),{}):e[t]}function he(e,t){const n=e;return n.install=function(o){const{name:r}=e;r&&o.component(r,e)},n}function me(e,t){e.setPropsDefaults=function(n){Object.entries(n).forEach(([o,r])=>{const i=t[o];if(i!=null){if(Ft(i)){t[o]=hn(vn({},i),{default:r});return}t[o]={type:i,default:r}}})}}const te=Qt("var");function V(e){return{type:[Function,Array],default:e}}function mn(e,t){return e===!1?null:(e===!0&&t&&(e=t),`var-elevation--${e}`)}var bn=Object.defineProperty,yn=Object.defineProperties,wn=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,Ee=(e,t,n)=>t in e?bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qe=(e,t)=>{for(var n in t||(t={}))gn.call(t,n)&&Ee(e,n,t[n]);if(Me)for(var n of Me(t))_n.call(t,n)&&Ee(e,n,t[n]);return e},Sn=(e,t)=>yn(e,wn(t));const{n:et}=te("ripple"),Oe=250;function $n(e){const{zIndex:t,position:n}=ve(e);e.style.overflow="hidden",e.style.overflowX="hidden",e.style.overflowY="hidden",n==="static"&&(e.style.position="relative"),t==="auto"&&(e.style.zIndex="1")}function Le(e){return"touches"in e}function Tn(e,t){const{top:n,left:o}=Z(e),{clientWidth:r,clientHeight:i}=e,a=Math.sqrt(r**2+i**2)/2,l=a*2,s=Le(t)?t.touches[0].clientX-o:r/2,c=Le(t)?t.touches[0].clientY-n:i/2,d=(r-a*2)/2,v=(i-a*2)/2,h=s-a,f=c-a;return{x:h,y:f,centerX:d,centerY:v,size:l}}function be(e){const t=this._ripple;if(t.removeRipple(),t.disabled||t.tasker||!He.enableRipple)return;const n=()=>{t.tasker=null;const{x:o,y:r,centerX:i,centerY:a,size:l}=Tn(this,e),s=document.createElement("div");s.classList.add(et()),s.style.opacity="0",s.style.transform=`translate(${o}px, ${r}px) scale3d(.3, .3, .3)`,s.style.width=`${l}px`,s.style.height=`${l}px`,t.color&&(s.style.backgroundColor=t.color),s.dataset.createdAt=String(performance.now()),$n(this),this.appendChild(s),window.setTimeout(()=>{s.style.transform=`translate(${i}px, ${a}px) scale3d(1, 1, 1)`,s.style.opacity=".25"},20)};t.tasker=window.setTimeout(n,30)}function J(){const e=this._ripple,t=()=>{const n=this.querySelectorAll(`.${et()}`);if(!n.length)return;const o=n[n.length-1],r=Oe-performance.now()+Number(o.dataset.createdAt);window.setTimeout(()=>{o.style.opacity="0",window.setTimeout(()=>{var i;return(i=o.parentNode)==null?void 0:i.removeChild(o)},Oe)},r)};e.tasker?window.setTimeout(t,30):t()}function tt(){if(!Ht()||!He.enableRipple)return;const e=this._ripple;e.tasker&&window.clearTimeout(e.tasker),e.tasker=null}let Q=!1;function Cn(e){Q||!(e.key===" "||e.key==="Enter")||(be.call(this,e),Q=!0)}function Ne(){Q&&(J.call(this),Q=!1)}function Pn(e,t){var n;e._ripple=Sn(Qe({tasker:null},(n=t.value)!=null?n:{}),{removeRipple:J.bind(e)}),e.addEventListener("touchstart",be,{passive:!0}),e.addEventListener("touchmove",tt,{passive:!0}),e.addEventListener("dragstart",J,{passive:!0}),e.addEventListener("keydown",Cn),e.addEventListener("keyup",Ne),e.addEventListener("blur",Ne),document.addEventListener("touchend",e._ripple.removeRipple,{passive:!0}),document.addEventListener("touchcancel",e._ripple.removeRipple,{passive:!0}),document.addEventListener("dragend",e._ripple.removeRipple,{passive:!0})}function kn(e){e.removeEventListener("touchstart",be),e.removeEventListener("touchmove",tt),e.removeEventListener("dragstart",J),!(!e._ripple||!e._ripple.removeRipple)&&(document.removeEventListener("touchend",e._ripple.removeRipple),document.removeEventListener("touchcancel",e._ripple.removeRipple),document.removeEventListener("dragend",e._ripple.removeRipple))}function Mn(e,t){var n,o,r,i,a,l;const s={color:(n=t.value)==null?void 0:n.color,disabled:(o=t.value)==null?void 0:o.disabled};(s.color!==((r=e._ripple)==null?void 0:r.color)||s.disabled!==((i=e._ripple)==null?void 0:i.disabled))&&(e._ripple=Qe({tasker:s.disabled?null:(a=e._ripple)==null?void 0:a.tasker,removeRipple:(l=e._ripple)==null?void 0:l.removeRipple},s))}const En={mounted:Pn,unmounted:kn,updated:Mn,install(e){e.directive("ripple",this)}};var On=En;function Ln(e,t){throw Error(`Varlet [${e}]: ${t}`)}function Nn(e){let t=e;for(;t&&!(!t.parentNode||(t=t.parentNode,t===document.body||t===document.documentElement));){const n=/(scroll|auto)/,{overflowY:o,overflow:r}=ve(t);if(n.test(o)||n.test(r))return t}return window}function zn(){const{width:e,height:t}=Z(window);return{vw:e,vh:t,vMin:Math.min(e,t),vMax:Math.max(e,t)}}const Bn=e=>k(e)&&e.endsWith("rem"),An=e=>k(e)&&e.endsWith("px")||pe(e),Wn=e=>k(e)&&e.endsWith("vw"),In=e=>k(e)&&e.endsWith("vh"),Rn=e=>k(e)&&e.endsWith("vmin"),Dn=e=>k(e)&&e.endsWith("vmax"),xn=e=>{if(Ue(e))return Number(e);if(An(e))return+e.replace("px","");if(!ee())return 0;const{vw:t,vh:n,vMin:o,vMax:r}=zn();if(Wn(e))return+e.replace("vw","")*t/100;if(In(e))return+e.replace("vh","")*n/100;if(Rn(e))return+e.replace("vmin","")*o/100;if(Dn(e))return+e.replace("vmax","")*r/100;if(Bn(e)){const i=+e.replace("rem",""),a=ve(document.documentElement).fontSize;return i*parseFloat(a)}return k(e)?Xe(e):0},Fn=e=>{if(e!=null)return Ue(e)?`${e}px`:String(e)};function ze(e,{top:t=0,left:n=0,duration:o=300,animation:r}){const i=Date.now(),a=Xt(e),l=Kt(e);return new Promise(s=>{const c=()=>{const d=(Date.now()-i)/o;if(d<1){const v=a+(t-a)*r(d),h=l+(n-l)*r(d);e.scrollTo(h,v),requestAnimationFrame(c)}else e.scrollTo(n,t),s()};requestAnimationFrame(c)})}const Be=e=>e,H={offsetTop:{type:[String,Number],default:0},zIndex:{type:[String,Number],default:10},cssMode:Boolean,disabled:Boolean,onScroll:V()};var Ae=(e,t,n)=>new Promise((o,r)=>{var i=s=>{try{l(n.next(s))}catch(c){r(c)}},a=s=>{try{l(n.throw(s))}catch(c){r(c)}},l=s=>s.done?o(s.value):Promise.resolve(s.value).then(i,a);l((n=n.apply(e,t)).next())});const{name:jn,n:Vn,classes:Hn}=te("sticky");function Un(e,t){return y(),$("div",{class:P(e.classes(e.n(),[e.enableCSSMode,e.n("--css-mode")])),ref:"stickyEl",style:q({zIndex:e.toNumber(e.zIndex),top:e.enableCSSMode?`${e.offsetTop}px`:void 0,width:e.enableFixedMode?e.fixedWidth:void 0,height:e.enableFixedMode?e.fixedHeight:void 0})},[_("div",{class:P(e.n("wrapper")),ref:"wrapperEl",style:q({zIndex:e.toNumber(e.zIndex),position:e.enableFixedMode?"fixed":void 0,width:e.enableFixedMode?e.fixedWrapperWidth:void 0,height:e.enableFixedMode?e.fixedWrapperHeight:void 0,left:e.enableFixedMode?e.fixedLeft:void 0,top:e.enableFixedMode?e.fixedTop:void 0})},[A(e.$slots,"default")],6)],6)}const nt=fe({name:jn,props:H,setup(e){const t=b(null),n=b(null),o=b(!1),r=b("0px"),i=b("0px"),a=b("auto"),l=b("auto"),s=b("auto"),c=b("auto"),d=w(()=>!e.disabled&&e.cssMode),v=w(()=>!e.disabled&&!e.cssMode&&o.value),h=w(()=>xn(e.offsetTop));let f;U(()=>e.disabled,L),Ge(()=>Ae(this,null,function*(){yield Ye(),S(),g()})),on(Y),Je(L),ce(()=>window,"scroll",g);function u(){const{cssMode:T,disabled:W}=e;if(W)return;let N=0;if(f&&f!==window){const{top:p}=Z(f);N=p}const z=n.value,B=t.value,{top:ne,left:M}=Z(B),X=ne-N;return X<=h.value?(T||(a.value=`${B.offsetWidth}px`,l.value=`${B.offsetHeight}px`,r.value=`${N+h.value}px`,i.value=`${M}px`,s.value=`${z.offsetWidth}px`,c.value=`${z.offsetHeight}px`,o.value=!0),{offsetTop:h.value,isFixed:!0}):(o.value=!1,{offsetTop:X,isFixed:!1})}function S(){f=Nn(t.value),f!==window&&f.addEventListener("scroll",g)}function g(){const T=u();T&&D(e.onScroll,T.offsetTop,T.isFixed)}function Y(){!f||f===window||f.removeEventListener("scroll",g)}function L(){return Ae(this,null,function*(){o.value=!1,yield Yt(),u()})}return{stickyEl:t,wrapperEl:n,isFixed:o,offsetTop:h,fixedTop:r,fixedLeft:i,fixedWidth:a,fixedHeight:l,fixedWrapperWidth:s,fixedWrapperHeight:c,enableCSSMode:d,enableFixedMode:v,n:Vn,classes:Hn,resize:L,toNumber:Xe}}});nt.render=Un;var ye=nt;he(ye);me(ye,H);var qn=ye;const ot={name:[String,Number],disabled:Boolean,ripple:{type:Boolean,default:!0},onClick:V()},rt=Symbol("TABS_BIND_TAB_KEY");function Yn(){const{childProviders:e,bindChildren:t,length:n}=ln(rt);return{length:n,tabList:e,bindTabList:t}}function Xn(){const{parentProvider:e,bindParent:t,index:n}=sn(rt);return t||Ln("Tab","<var-tab/> must in <var-tabs/>"),{index:n,tabs:e,bindTabs:t}}const{name:Kn,n:K,classes:Zn}=te("tab");function Gn(e,t){const n=Lt("ripple");return Fe((y(),$("div",{class:P(e.classes(e.n(),e.n("$--box"),e.computeColorClass(),e.n(`--${e.itemDirection}`))),ref:"tabEl",style:q({color:e.computeColorStyle()}),onClick:t[0]||(t[0]=(...o)=>e.handleClick&&e.handleClick(...o))},[A(e.$slots,"default")],6)),[[n,{disabled:e.disabled||!e.ripple}]])}const it=fe({name:Kn,directives:{Ripple:On},props:ot,setup(e){const t=b(null),n=w(()=>t.value),o=w(()=>e.name),r=w(()=>e.disabled),{index:i,tabs:a,bindTabs:l}=Xn(),{onTabClick:s,active:c,activeColor:d,inactiveColor:v,disabledColor:h,itemDirection:f,resize:u}=a,S={name:o,index:i,disabled:r,element:n};l(S),U(()=>[e.name,e.disabled],u);function g(){return e.name!=null?c.value===e.name:c.value===(i==null?void 0:i.value)}function Y(){return e.disabled?h.value:g()?d.value:v.value}function L(){return e.disabled?K("$-tab--disabled"):g()?K("$-tab--active"):K("$-tab--inactive")}function T(W){const{disabled:N,name:z,onClick:B}=e;N||(D(B,z??i.value,W),s(S))}return{tabEl:t,active:c,activeColor:d,inactiveColor:v,itemDirection:f,n:K,classes:Zn,computeColorStyle:Y,computeColorClass:L,handleClick:T}}});it.render=Gn;var we=it;he(we);me(we,ot);var Jn=we;const st={active:{type:[String,Number],default:0},layoutDirection:{type:String,default:"horizontal"},itemDirection:{type:String,default:"horizontal"},fixedBottom:Boolean,activeColor:String,inactiveColor:String,disabledColor:String,color:String,indicatorColor:String,indicatorSize:[String,Number],elevation:{type:[Boolean,String,Number],default:!1},scrollable:{type:String,default:"auto"},indicatorPosition:{type:String,default:"normal"},safeArea:Boolean,sticky:Boolean,stickyCssMode:se(H,"cssMode"),stickyZIndex:se(H,"zIndex"),offsetTop:se(H,"offsetTop"),onClick:V(),onChange:V(),"onUpdate:active":V()};var We=(e,t,n)=>new Promise((o,r)=>{var i=s=>{try{l(n.next(s))}catch(c){r(c)}},a=s=>{try{l(n.throw(s))}catch(c){r(c)}},l=s=>s.done?o(s.value):Promise.resolve(s.value).then(i,a);l((n=n.apply(e,t)).next())});const{name:Qn,n:eo,classes:to}=te("tabs");function no(e,t){return y(),j(je(e.sticky?e.n("$-sticky"):e.Transition),{ref:e.sticky?"stickyComponent":void 0,"css-mode":e.sticky?e.stickyCssMode:void 0,"offset-top":e.sticky?e.offsetTop:void 0,"z-index":e.sticky?e.stickyZIndex:void 0},{default:R(()=>[_("div",Nt({class:e.classes(e.n(),e.n("$--box"),e.n(`--item-${e.itemDirection}`),e.n(`--layout-${e.layoutDirection}-padding`),e.formatElevation(e.elevation,4),[e.fixedBottom,e.n("--fixed-bottom")],[e.safeArea,e.n("--safe-area")]),style:{background:e.color}},e.$attrs),[_("div",{ref:"scrollerEl",class:P(e.classes(e.n("tab-wrap"),[e.localScrollable,e.n(`--layout-${e.layoutDirection}-scrollable`)],e.n(`--layout-${e.layoutDirection}`)))},[A(e.$slots,"default"),_("div",{class:P(e.classes(e.n("indicator"),e.n(`--layout-${e.layoutDirection}${e.indicatorPosition}-indicator`))),style:q({width:e.layoutDirection==="horizontal"?e.indicatorWidth:e.toSizeUnit(e.indicatorSize),height:e.layoutDirection==="horizontal"?e.toSizeUnit(e.indicatorSize):e.indicatorHeight,transform:e.layoutDirection==="horizontal"?`translateX(${e.indicatorX})`:`translateY(${e.indicatorY})`})},[_("div",{class:P(e.classes(e.n("indicator-inner"),e.n(`--layout-${e.layoutDirection}-indicator-inner`))),style:q({background:e.indicatorColor||e.activeColor})},null,6)],6)],2)],16)]),_:3},8,["css-mode","offset-top","z-index"])}const at=fe({name:Qn,components:{VarSticky:qn},inheritAttrs:!1,props:st,setup(e){const t=b("0px"),n=b("0px"),o=b("0px"),r=b("0px"),i=b(!1),a=b(null),l=w(()=>e.active),s=w(()=>e.activeColor),c=w(()=>e.inactiveColor),d=w(()=>e.disabledColor),v=w(()=>e.itemDirection),h=b(null),f=w(()=>e.indicatorPosition==="reverse"?"-reverse":""),{tabList:u,bindTabList:S,length:g}=Yn();S({active:l,activeColor:s,inactiveColor:c,disabledColor:d,itemDirection:v,resize:M,onTabClick:L}),U(()=>g.value,()=>We(this,null,function*(){yield Ye(),M()})),U(()=>[e.active,e.scrollable],M),xe(M),Je(M);function L(p){var m;const C=(m=p.name.value)!=null?m:p.index.value,{active:x,onChange:lt,onClick:ct}=e;D(e["onUpdate:active"],C),D(ct,C),C!==x&&D(lt,C)}function T(){return u.find(({name:p})=>e.active===p.value)}function W(p){return u.find(({index:m})=>(p??e.active)===m.value)}function N(){if(g.value===0)return;const{active:p}=e;if(pe(p)){const m=Zt(p,0,g.value-1);return D(e["onUpdate:active"],m),W(m)}}function z(){i.value=e.scrollable==="always"||u.length>=5}function B({element:p}){const m=p.value;m&&(e.layoutDirection==="horizontal"?(t.value=`${m.offsetWidth}px`,o.value=`${m.offsetLeft}px`):(n.value=`${m.offsetHeight}px`,r.value=`${m.offsetTop}px`))}function ne({element:p}){if(!i.value)return;const m=a.value,C=p.value;if(e.layoutDirection==="horizontal"){const x=C.offsetLeft+C.offsetWidth/2-m.offsetWidth/2;ze(m,{left:x,animation:Be})}else{const x=C.offsetTop+C.offsetHeight/2-m.offsetHeight/2;ze(m,{top:x,animation:Be})}}function M(){const p=T()||W()||N();!p||p.disabled.value||(z(),B(p),ne(p))}function X(){return We(this,null,function*(){e.sticky&&h.value&&(yield h.value.resize())})}return{stickyComponent:h,indicatorWidth:t,indicatorHeight:n,indicatorX:o,indicatorY:r,indicatorPosition:f,localScrollable:i,scrollerEl:a,Transition:pt,toSizeUnit:Fn,n:eo,classes:to,resize:M,resizeSticky:X,formatElevation:mn}}});at.render=no;var ge=at;he(ge);me(ge,st);var oo=ge;const ro={setup(){const{strings:e}=mt();return{postEditorStore:ut(),rootStore:dt(),composableStrings:e}},emits:["changed"],components:{BaseButton:gt,SvgCaret:_t,SvgCircleCheck:St,SvgCircleInformation:$t,SvgEllipse:yt,TransitionSlide:Tt,VarTab:Jn,VarTabs:oo},mixins:[wt,bt],props:{tabs:{type:Array,required:!0},skinnyTabs:Boolean,active:String,showSaveButton:{type:Boolean,default(){return!0}},internal:Boolean,disableMobile:Boolean},data(){return{buttonLoading:!1,showMobileMenu:!0,calculateWidth:!1,showMobileTabs:!1,strings:ft(this.composableStrings,{saveChanges:this.$t.__("Save Changes",this.$td)})}},computed:{activeTab(){var e;return this.active?this.active:this.$route&&this.$route.name?this.$route.name:(e=this.tabs[0])==null?void 0:e.slug},filteredTabs(){return this.tabs.filter(e=>e.slug!==(this.active?this.active:this.$route&&this.$route.name?this.$route.name:""))}},methods:{clickMobileTabs(e){this.$emit("changed",e),this.showMobileTabs=!1},maybeChangeTab(e){if(this.active){this.$emit("changed",e);return}const t=this.tabs.find(n=>n.slug===e);t&&this.$router.push(t.url)},getActiveTabName(){const e=this.tabs.find(t=>t.slug===(this.active?this.active:this.$route&&this.$route.name?this.$route.name:""));return e?e.name:""},maybeShowMobileMenu(){if(window.matchMedia("(max-width: 782px)").matches&&!this.disableMobile){this.showMobileMenu=!0;return}let e=0;this.calculateWidth=!0,this.$nextTick(()=>{e=this.$refs["tabs-scroller"].offsetWidth,this.calculateWidth=!1;let t=0;const n=this.$refs["tabs-button"];if(n){const o=n.querySelector(".aioseo-button");t=o?o.scrollWidth:0}if(e+t>this.$refs["aioseo-tabs"].offsetWidth){this.showMobileMenu=!0;return}this.showMobileMenu=!1})},createRipple(e){const t=e.currentTarget,n=document.createElement("span"),o=Math.max(t.clientWidth,t.clientHeight),r=o/2,i=t.getBoundingClientRect();n.style.width=n.style.height=`${o}px`,n.style.left=`${e.clientX-(i.left+r)}px`,n.style.top=`${e.clientY-(i.top+r)}px`,n.classList.add("ripple");const a=t.getElementsByClassName("ripple")[0];a&&a.remove(),t.appendChild(n)}},beforeMount(){window.addEventListener("resize",this.maybeShowMobileMenu)},async mounted(){this.$nextTick(()=>{this.maybeShowMobileMenu();const e=this.$refs["aioseo-tabs"],t=e.querySelector(".var-tab--active"),n=e.querySelector(".var-tabs__indicator");if(!t||!n)return;setTimeout(()=>{n.style.width==="0px"&&(n.style.width=`${t.offsetWidth}px`,n.style.transform=`translateX(${t.offsetLeft}px)`)},300),new MutationObserver(()=>{n.style.width==="0px"&&(n.style.width=`${t.offsetWidth}px`,n.style.transform=`translateX(${t.offsetLeft}px)`)}).observe(n,{attributes:!0});const r=e.querySelectorAll(".var-tab");r.length&&r.forEach(i=>{i.addEventListener("click",this.createRipple)})})},beforeUnmount(){window.removeEventListener("resize",this.maybeShowMobileMenu)}},io={class:"tabs-scroller",ref:"tabs-scroller"},so={class:"tab-label"},ao=["textContent"],lo={key:1,class:"warning"},co={key:0,class:"aioseo-mobile-tabs"},uo=_("span",{class:"tab-indicator"},null,-1),fo={class:"tab-links"},po=["onClick"],vo={key:1,class:"button-right",ref:"tabs-button"},ho={class:"tabs-extra"};function mo(e,t,n,o,r,i){const a=E("svg-ellipse"),l=E("svg-circle-check"),s=E("svg-circle-information"),c=E("var-tab"),d=E("var-tabs"),v=E("svg-caret"),h=E("transition-slide"),f=E("base-button");return y(),$("div",{class:P(["aioseo-tabs",{internal:n.internal,skinny:n.skinnyTabs}]),ref:"aioseo-tabs"},[Fe(_("div",io,[F(d,{active:i.activeTab,onClick:i.maybeChangeTab,ref:"var-tabs"},{default:R(()=>[(y(!0),$(oe,null,re(n.tabs,(u,S)=>(y(),j(c,{name:u.slug,key:S},{default:R(()=>[A(e.$slots,"var-tab",{tab:u},()=>[A(e.$slots,"var-tab-icon",{tab:u}),_("span",so,I(u.name),1),u.errorCount>=0?(y(),$("span",{key:0,class:P(["tab-score",e.getErrorClass(o.postEditorStore.currentPost.page_analysis.analysis[u.slug].errors)])},[0<o.postEditorStore.currentPost.page_analysis.analysis[u.slug].errors?(y(),j(a,{key:0,width:"8"})):O("",!0),o.postEditorStore.currentPost.page_analysis.analysis[u.slug].errors===0?(y(),j(l,{key:1,width:"12"})):O("",!0),_("span",{textContent:I(e.getErrorDisplay(o.postEditorStore.currentPost.page_analysis.analysis[u.slug].errors))},null,8,ao)],2)):O("",!0),u.warning&&e.$root.$data.screenContext!=="sidebar"?(y(),$("span",lo,[F(s,{width:"15",height:"15"})])):O("",!0)])]),_:2},1032,["name"]))),128))]),_:3},8,["active","onClick"])],512),[[ht,!r.showMobileMenu||r.calculateWidth]]),r.showMobileMenu?(y(),$("div",co,[_("div",{class:"active-tab",onClick:t[1]||(t[1]=u=>r.showMobileTabs=!r.showMobileTabs)},[_("div",null,[ie(I(i.getActiveTabName())+" ",1),F(v,{onClick:t[0]||(t[0]=_e(u=>r.showMobileTabs=!r.showMobileTabs,["stop"])),class:P({rotated:!r.showMobileTabs})},null,8,["class"]),uo])]),F(h,{active:r.showMobileTabs,class:"tab-dropdown"},{default:R(()=>[_("div",fo,[n.active?O("",!0):(y(!0),$(oe,{key:0},re(i.filteredTabs,(u,S)=>(y(),j(je(n.active?"a":"router-link"),{key:S,to:u.url,onClick:t[2]||(t[2]=g=>r.showMobileTabs=!1)},{default:R(()=>[ie(I(u.name),1)]),_:2},1032,["to"]))),128)),n.active?(y(!0),$(oe,{key:1},re(i.filteredTabs,(u,S)=>(y(),$("a",{href:"#",key:S,onClick:_e(g=>i.clickMobileTabs(u.slug),["prevent"])},I(u.name),9,po))),128)):O("",!0)])]),_:1},8,["active"])])):O("",!0),n.showSaveButton?(y(),$("div",vo,[A(e.$slots,"button",{},()=>[F(f,{type:"blue",size:"medium",loading:o.rootStore.loading,onClick:e.processSaveChanges},{default:R(()=>[ie(I(r.strings.saveChanges),1)]),_:1},8,["loading","onClick"])])],512)):O("",!0),_("div",ho,[A(e.$slots,"extra")])],2)}const Po=vt(ro,[["render",mo]]);export{Po as C};