Sid Gifari File Manager
🏠 Root
/
home2
/
meumer25
/
www
/
wp-content
/
plugins
/
all-in-one-seo-pack
/
dist
/
Lite
/
assets
/
table-of-contents
/
Editing: main.86de4cbc.js
import{h as de,c as he,d as ue,r as Ce}from"../js/utils.6d965f64.js";import{a as K,c as ee}from"../js/runtime-dom.esm-bundler.dc49ee3e.js";import{a as pe,l as $e}from"../js/index.317ad629.js";import{C as we}from"../js/Tooltip.23c7170d.js";import{S as fe}from"../js/Info.13c65c37.js";import"../js/translations.e71e2202.js";import{a as U,_ as m}from"../js/default-i18n.65d58dd6.js";import{W as ge,o as h,c as y,_ as d,a4 as S,$ as k,a7 as j,a1 as O,a2 as T,a3 as Se,l as A,R as _,Y as P,f as J,n as Q,a6 as me,ae as Y,ad as Ae,F as Be,af as He,a5 as Te,ab as ye}from"../js/runtime-core.esm-bundler.ce5add0b.js";import{I as W,o as te}from"../js/helpers.633a054c.js";import{o as oe,u as Ee,M as Ve,f as Me}from"../js/TableOfContentsStore.58079b5d.js";import{B as ie}from"../js/Input.f04bee4d.js";import{S as Oe}from"../js/Close.ccd53ef3.js";import{S as Ie,D as Le}from"../js/vuedraggable.umd.dac39944.js";import{S as Re}from"../js/Eye.489b3324.js";import{_ as ze}from"../js/_plugin-vue_export-helper.eefbdd86.js";import{S as Ne}from"../js/Link.e6a11169.js";import{C as De}from"../js/Index.3a1576c6.js";import{_ as ne}from"../js/Button.9a301412.js";import"../js/Index.2a391835.js";import"../js/Pencil.d82df6a1.js";import"../js/Trash.87a7d946.js";const qe=de` <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0zm0 0h24v24H0V0z" fill="none"/><path d="M3 9h14V7H3v2zm0 4h14v-2H3v2zm0 4h14v-2H3v2zm16 0h2v-2h-2v2zm0-10v2h2V7h-2zm0 6h2v-2h-2v2z"/></svg> `,Fe="https://schemas.wp.org/wp/5.8/block.json",Pe="aioseo/table-of-contents",Ze="1.0.0",Ue="AIOSEO - Table of Contents",je="Automatically output a table of contents (TOC) for long posts or pages (and custom post types).",Ye="layout",Ge=["toc","table of contents","document outline","summary","index"],Je="all-in-one-seo-pack",Qe={listStyle:{type:"string",default:"ul"},collapsibleType:{type:"string",default:"off"},collapsed:{type:"boolean",default:!1},collapsedTitle:{type:"string",default:"Show Table of Contents"},expandedTitle:{type:"string",default:"Hide Table of Contents"},mode:{type:"string",default:null},headings:{type:"array",items:{type:"object"},default:[]},reOrdered:{type:"boolean",default:!1}},Ke={multiple:!0,html:!1,reusable:!1,align:["wide","full"]},We={$schema:Fe,name:Pe,version:Ze,title:Ue,description:je,category:Ye,keywords:Ge,textdomain:Je,attributes:Qe,supports:Ke},Xe={class:"aioseo-toc-header"},et={class:"aioseo-toc-header-title"},tt={key:0,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ot=d("path",{d:"M6 8H0V6H6V0H8V6H14V8H8V14H6V8Z",fill:"#005AE0"},null,-1),it=[ot],nt={key:1,width:"14",height:"2",viewBox:"0 0 14 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lt=d("path",{d:"M0 2V0H14V2H0Z",fill:"#005AE0"},null,-1),st=[lt],ct={key:1},rt={class:"aioseo-toc-header-info"},at={key:0,class:"aioseo-toc-header-instructions"},dt={key:1,class:"aioseo-toc-header-buttons"},le={__name:"Header",props:{blockAttributes:{type:Object,required:!0},loadActions:{type:Boolean,default:!1}},emits:["showModal"],setup(o,{emit:t}){const e="all-in-one-seo-pack",l=t,i=o,n={header:U(m("%1$s Table of Contents",e),"AIOSEO"),instructions:m("Add a heading block below to begin generating the Table of Contents.",e),tooltipMainDescription:U(m("%1$s can automatically output a table of contents based on your heading tags below. Search engines sometimes use table of contents in search results or rich snippets which can help you increase your rankings.",e),"AIOSEO"),reorder:m("Reorder",e),save:m("Save",e)},w=ge(()=>i.blockAttributes.collapsibleType==="off"?"":i.blockAttributes.collapsed?i.blockAttributes.collapsedTitle:i.blockAttributes.expandedTitle),r=()=>{var x;window.wp.data.dispatch("core/block-editor").selectBlock(null),(x=document==null?void 0:document.activeElement)==null||x.blur()},u=()=>{const x=!i.blockAttributes.collapsed;i.blockAttributes.collapsed=x,window.wp.data.dispatch("core/block-editor").updateBlockAttributes(i.clientId,{...i.blockAttributes,collapsed:x})};return(x,V)=>{var E,M,H,s;return h(),y("header",Xe,[d("div",et,[o.blockAttributes.collapsibleType==="open"||o.blockAttributes.collapsibleType==="closed"?(h(),y("div",{key:0,class:"aioseo-toc-header-collapsible",onClick:u},[o.blockAttributes.collapsed?(h(),y("svg",tt,it)):(h(),y("svg",nt,st))])):S("",!0),o.blockAttributes.collapsibleType==="off"?(h(),y("span",ct,k(n.header),1)):S("",!0),j(" "+k(w.value)+" ",1),o.loadActions?(h(),O(_(we),{key:2},{tooltip:T(()=>[Se(x.$slots,"tooltip",{},()=>[j(k(n.tooltipMainDescription),1)])]),default:T(()=>[d("div",rt,[A(_(fe))])]),_:3})):S("",!0)]),((M=(E=o.blockAttributes)==null?void 0:E.headings)==null?void 0:M.length)===0&&o.loadActions?(h(),y("div",at,k(n.instructions),1)):S("",!0),((s=(H=o.blockAttributes)==null?void 0:H.headings)==null?void 0:s.length)!==0&&o.loadActions?(h(),y("div",dt,[d("a",{class:"aioseo-button-link",href:"#",onClick:V[0]||(V[0]=K(c=>l("showModal"),["prevent"]))},k(n.reorder),1),d("a",{class:"aioseo-button-link aioseo-button-link--primary",href:"#",onClick:K(r,["prevent"])},k(n.save),1)])):S("",!0)])}}},ht={},ut={viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-eye-off"},pt=d("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"},null,-1),wt=d("path",{d:"M12 6a9.77 9.77 0 0 1 8.82 5.5 9.647 9.647 0 0 1-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68A11.738 11.738 0 0 0 1 11.5C2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5 2.61 2.61c-.04.01-.08.02-.12.02a2.5 2.5 0 0 1-2.5-2.5c0-.05.01-.08.01-.13zm-3.4-3.4 1.75 1.75a4.6 4.6 0 0 0-.36 1.78 4.507 4.507 0 0 0 6.27 4.14l.98.98c-.88.24-1.8.38-2.75.38a9.77 9.77 0 0 1-8.82-5.5c.7-1.43 1.72-2.61 2.93-3.53z",fill:"currentColor"},null,-1),ft=[pt,wt];function gt(o,t){return h(),y("svg",ut,ft)}const mt=ze(ht,[["render",gt]]),yt={class:"aioseo-toc-list-item__inner"},xt={key:0,class:"aioseo-drag-handle has-icon"},vt={class:"append-icon"},bt={class:"aioseo-tooltip__header"},_t=["onClick"],xe={__name:"List",props:{headings:{required:!0,type:Array},clientId:{required:!0,type:String},allowReorder:{required:!1,type:Boolean,default:!1},group:{required:!1,type:String,default:"description"},parentBlockId:{required:!1,type:String,default:""}},setup(o){const t="all-in-one-seo-pack",e=o,l=pe(),i=P(window.wp.data.select("core/block-editor").getBlockAttributes(e.clientId)),n={tooltipHeader:m("Edit HTML Anchor:",t),tooltipDescription:U(m("The HTML anchor allows %1$s to link directly to your header from this table of contents block. Feel free to edit if you want, but an anchor is required. For headings without an anchor, %1$s will automatically generate them.",t),"AIOSEO")},w=ge(()=>({tag:i.value.listStyle,animation:300,group:e.group,disabled:!e.allowReorder,ghostClass:"aioseo-drag-ghost",dragClass:"aioseo-dragging"})),r=(s,c)=>{c.editedContent=s===c.content?"":he(s,!0,!1),window.wp.data.dispatch("core/block-editor").updateBlockAttributes(e.clientId,{...i.value,headings:e.headings})},u=s=>(s.blockClientId===e.parentBlockId?s.headings=oe(s.headings,s.editedOrder):s.headings.map(u),s),x=s=>{var a;if(i.value.reOrdered=!0,!((a=s==null?void 0:s.moved)==null?void 0:a.element))return;const v=ue(i.value.headings),p=oe(v.map(u));window.wp.data.dispatch("core/block-editor").updateBlockAttributes(e.clientId,{...i.value,headings:p})},V=(s,c)=>{const v=c.blockClientId;if(window.wp.data.select("core/block-editor").getBlock(v)){if(c.anchor=W(s),!s){const a=window.wp.data.select("core/block-editor").getBlockIndex(v);c.anchor=l.aioseo.data.blocks.toc.hashPrefix+W(`${c.content}-${a}`)}window.wp.data.dispatch("core/block-editor").updateBlockAttributes(v,{anchor:c.anchor})}},E=(s,c)=>s==null?void 0:s.map(v=>v.content===c.content&&v.level===Number(c.level)&&v.anchor===c.anchor?c:v.headings?E(v.headings,c):v),M=s=>{if(s.hidden=!s.hidden,e.group==="nested"){window.wp.data.dispatch("core/block-editor").updateBlockAttributes(e.clientId,i.value);return}window.wp.data.dispatch("core/block-editor").updateBlockAttributes(e.clientId,E(i.value.headings,s))},H=s=>{const c=s.target.closest(".aioseo-toc-list-item"),v=c==null?void 0:c.querySelector(".row-input--anchor input");v&&(c.classList.contains("anchor-edit")?(c.classList.add("anchor-is-animating"),c.classList.remove("anchor-edit"),c.classList.remove("done"),v.addEventListener("animationend",function p(){c.classList.remove("anchor-is-animating"),c.removeEventListener("animationend",p,!1)})):(v.focus({preventScroll:!0}),c.classList.add("anchor-edit","anchor-is-animating"),v.addEventListener("animationend",function p(){c.classList.remove("anchor-is-animating"),c.classList.add("done"),v.removeEventListener("animationend",p,!1)})))};return J(()=>{Q(()=>{window.aioseoBus.$on("updateToc"+e.clientId,()=>{i.value=window.wp.data.select("core/block-editor").getBlockAttributes(e.clientId)})})}),(s,c)=>{const v=me("List",!0);return h(),O(_(Le),Ae({class:["aioseo-toc-list",[{orderable:o.allowReorder}]]},w.value,{handle:".aioseo-drag-handle",list:e.headings,onChange:c[0]||(c[0]=p=>x(p)),"item-key":p=>(p==null?void 0:p.id)||p.blockClientId}),{item:T(({element:p})=>[d("li",{class:Y(["aioseo-toc-list-item",{"heading-hidden":p.hidden}])},[d("div",yt,[o.allowReorder?(h(),y("button",xt,[A(_(Ie))])):S("",!0),A(_(ie),{class:"row-input row-input--content",modelValue:p.editedContent||p.content,"onUpdate:modelValue":a=>r(a,p),placeholder:p.content},{"append-icon":T(()=>[o.allowReorder?S("",!0):(h(),y("div",{key:0,class:"append-icon",onClick:H},[A(_(Ne))]))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"]),o.allowReorder?S("",!0):(h(),O(_(ie),{key:1,class:"row-input row-input--anchor",spellcheck:!1,modelValue:p.anchor,"onUpdate:modelValue":a=>V(a,p)},{"append-icon":T(()=>[d("div",vt,[A(_(we),null,{tooltip:T(()=>[d("p",bt,k(n.tooltipHeader),1),d("p",null,k(n.tooltipDescription),1)]),default:T(()=>[d("div",null,[A(_(fe))])]),_:1}),d("div",{onClick:H},[A(_(Oe))])])]),_:2},1032,["modelValue","onUpdate:modelValue"])),o.allowReorder?S("",!0):(h(),y("button",{key:2,class:Y([{active:p.hidden},"aioseo-hide-heading-toggle","has-icon"]),onClick:a=>M(p)},[p.hidden?(h(),O(_(mt),{key:0})):(h(),O(_(Re),{key:1}))],10,_t)),p.headings?(h(),O(v,{key:3,class:"aioseo-toc-list-nested",headings:p.headings,"parent-block-id":p.blockClientId,allowReorder:o.allowReorder,"client-id":o.clientId,group:p.anchor},null,8,["headings","parent-block-id","allowReorder","client-id","group"])):S("",!0)])],2)]),_:1},16,["class","list","item-key"])}}},kt=["href"],Ct={__name:"ListRendered",props:{headings:{required:!0,type:Array},clientId:{required:!0,type:String}},setup(o){const t=o,e=P(window.wp.data.select("core/block-editor").getBlockAttributes(t.clientId));return J(()=>{Q(()=>{window.aioseoBus.$on("updateToc"+t.clientId,()=>{e.value=window.wp.data.select("core/block-editor").getBlockAttributes(t.clientId)})})}),(l,i)=>{const n=me("ListRendered",!0);return h(),y("div",null,[(h(),O(Te(e.value.listStyle),{class:"aioseo-toc-list--rendered"},{default:T(()=>[(h(!0),y(Be,null,He(o.headings,(w,r)=>(h(),y("li",{class:Y(["aioseo-toc-list-item--rendered",[{hidden:w.hidden}]]),key:r},[d("a",{href:`#${w.anchor}`},k(w.editedContent||w.content),9,kt),w.headings?(h(),O(n,{key:0,class:"aioseo-toc-list-nested--rendered",headings:w.headings,"client-id":o.clientId},null,8,["headings","client-id"])):S("",!0)],2))),128))]),_:1}))])}}},$t={class:"aioseo-toc-header"},St={class:"aioseo-toc-header-title"},At={class:"aioseo-toc-header-buttons"},Bt={__name:"Reorder",props:{headings:Array,show:Boolean,clientId:String},emits:["closeModal"],setup(o){const t="all-in-one-seo-pack",e={header:U(m("%1$s Table of Contents",t),"AIOSEO"),done:m("Done",t)};return(l,i)=>(h(),O(_(De),{show:o.show,noHeader:"",classes:["aioseo-toc-modal"],onClose:i[1]||(i[1]=n=>l.$emit("closeModal"))},{body:T(()=>[d("header",$t,[d("div",St,k(e.header),1),d("div",At,[d("a",{class:"aioseo-button-link aioseo-button-link--primary",href:"#",onClick:i[0]||(i[0]=K(n=>l.$emit("closeModal"),["prevent"]))},k(e.done),1)])]),A(_(xe),{headings:o.headings,"client-id":o.clientId,allowReorder:""},null,8,["headings","client-id"])]),_:1},8,["show"]))}},Ht={class:"aioseo-toc-container"},Tt={key:0},Et={key:0,class:"aioseo-toc-content"},Vt={key:0,class:"aioseo-toc-rendered"},Mt={key:0},Ot={__name:"App",props:{clientId:{type:String,required:!0}},setup(o){const t=o,e=P(window.wp.data.select("core/block-editor").getBlockAttributes(t.clientId)),l=P(!1);return J(()=>{Q(()=>{window.aioseoBus.$on("updateToc"+t.clientId,()=>{e.value=window.wp.data.select("core/block-editor").getBlockAttributes(t.clientId)})})}),(i,n)=>{var w,r,u,x,V,E,M,H,s;return h(),y("div",Ht,[d("div",{class:Y(["aioseo-toc-menu",{"aioseo-toc-placeholder":((r=(w=e.value)==null?void 0:w.headings)==null?void 0:r.length)===0}])},[A(_(le),{"block-attributes":e.value,"load-actions":!0,onShowModal:n[0]||(n[0]=c=>l.value=!0)},null,8,["block-attributes"]),e.value.collapsed?S("",!0):(h(),y("div",Tt,[((x=(u=e.value)==null?void 0:u.headings)==null?void 0:x.length)!==0?(h(),y("div",Et,[A(_(xe),{headings:(V=e.value)==null?void 0:V.headings,"client-id":o.clientId},null,8,["headings","client-id"])])):S("",!0)])),A(_(Bt),{show:l.value,headings:(E=e.value)==null?void 0:E.headings,"client-id":o.clientId,onCloseModal:n[1]||(n[1]=c=>l.value=!1)},null,8,["show","headings","client-id"])],2),((H=(M=e.value)==null?void 0:M.headings)==null?void 0:H.length)!==0?(h(),y("div",Vt,[A(_(le),{"block-attributes":e.value},null,8,["block-attributes"]),e.value.collapsed?S("",!0):(h(),y("div",Mt,[A(_(Ct),{headings:(s=e.value)==null?void 0:s.headings,"client-id":o.clientId},null,8,["headings","client-id"])]))])):S("",!0)])}}},It={class:"aioseo-toc-select-mode"},Lt={class:"aioseo-toc-header-title"},Rt={class:"aioseo-toc-select-mode__collapsible"},zt={key:0,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Nt=d("path",{d:"M6 8H0V6H6V0H8V6H14V8H8V14H6V8Z",fill:"#005AE0"},null,-1),Dt=[Nt],qt={key:1,width:"14",height:"2",viewBox:"0 0 14 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ft=d("path",{d:"M0 2V0H14V2H0Z",fill:"#005AE0"},null,-1),Pt=[Ft],Zt={key:0},Ut={key:1},jt={key:0},Yt={class:"aioseo-toc-select-mode__description"},Gt={class:"aioseo-toc-select-mode__selectors"},Jt={class:"aioseo-toc-select-mode__selector"},Qt=ye('<div class="aioseo-toc-select-mode__selector-icon"><svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_171_2017)"><rect width="37.3333" height="37.3333" rx="2" fill="#1A82EA"></rect><rect x="7.29712" y="7.81384" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.29712" y="12.5684" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.29712" y="17.3229" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.29712" y="22.0774" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.29736" y="26.8322" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="12.0515" y="7.81384" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="12.0515" y="12.5684" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="12.0515" y="17.3229" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="12.0515" y="22.0774" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="12.0513" y="26.8322" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="19" y="19" width="37.3333" height="37.3333" rx="2" fill="white"></rect><rect x="22" y="22" width="37.3333" height="37.3333" rx="2" fill="#80B2FF"></rect><rect x="29.2971" y="29.814" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="29.2971" y="34.5685" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="29.2971" y="39.3229" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="29.2971" y="44.0774" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="29.2971" y="48.8322" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="34.0518" y="29.814" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="34.0518" y="34.5685" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="34.0518" y="39.3229" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="34.0518" y="44.0774" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="34.0518" y="48.8322" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="39.6667" y="39.6666" width="37.3333" height="37.3333" rx="2" fill="white"></rect><rect x="42.6667" y="42.6666" width="37.3333" height="37.3333" rx="2" fill="#99C2FF"></rect><rect x="49.9641" y="50.4806" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="49.9641" y="55.2351" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="49.9641" y="59.9896" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="49.9641" y="64.7441" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="49.9641" y="69.4985" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="54.7185" y="50.4806" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.7185" y="55.2351" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.7185" y="59.9896" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.7185" y="64.7441" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.7185" y="69.4985" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect></g><defs><clipPath id="clip0_171_2017"><rect width="80" height="80" fill="white"></rect></clipPath></defs></svg></div>',1),Kt={class:"aioseo-toc-select-mode__selector-title"},Wt={class:"aioseo-toc-select-mode__selector-description"},Xt={class:"aioseo-toc-select-mode__selector"},eo=ye('<div class="aioseo-toc-select-mode__selector-icon"><svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_171_2066)"><path d="M9.8667 40V13.6C9.8667 11.3908 11.6576 9.59998 13.8667 9.59998H66.6667C68.8758 9.59998 70.6667 11.3908 70.6667 13.6V66.4C70.6667 68.6091 68.8758 70.4 66.6667 70.4H40.2667" stroke="#141B38" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="1 2.4"></path><rect y="24.8063" width="37.0026" height="37.416" rx="2" fill="#1A82EA"></rect><rect x="7.13159" y="32.6615" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.13159" y="37.416" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.13159" y="42.1705" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.13159" y="46.925" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="7.13159" y="51.6797" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="11.8862" y="32.6615" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="11.8862" y="37.416" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="11.8862" y="42.1705" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="11.8862" y="46.925" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="11.8862" y="51.6797" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="42.9331" width="37.0026" height="37.416" rx="2" fill="#80B2FF"></rect><rect x="50.0647" y="7.85522" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="50.0649" y="12.6097" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="50.0649" y="17.3641" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="50.0649" y="22.1187" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="50.0649" y="26.8734" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="54.8193" y="7.85522" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.8191" y="12.6097" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.8191" y="17.3641" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.8191" y="22.1187" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="54.8191" y="26.8734" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="21.2666" y="39.1334" width="37.0667" height="37.8667" rx="2" fill="white"></rect><rect x="28.4304" y="47.214" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="28.4304" y="51.9685" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="28.4304" y="56.7231" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="28.4304" y="61.4777" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="28.4304" y="66.2322" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="33.1851" y="47.214" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="33.1853" y="51.9685" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="33.1853" y="56.7231" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="33.1853" y="61.4777" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="33.1853" y="66.2322" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="24.2666" y="42.1334" width="37.0667" height="37.8667" rx="2" fill="#99C2FF"></rect><rect x="31.4304" y="50.214" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="31.4304" y="54.9685" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="31.4304" y="59.7231" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="31.4304" y="64.4777" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="31.4304" y="69.2322" width="2.68734" height="2.68734" rx="1.34367" fill="white"></rect><rect x="36.1851" y="50.214" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="36.1853" y="54.9685" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="36.1853" y="59.7231" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="36.1853" y="64.4777" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><rect x="36.1853" y="69.2322" width="17.9845" height="2.68734" rx="0.413437" fill="white"></rect><circle cx="26" cy="10" r="7" fill="#00AA63"></circle><path d="M22.6667 13.3333V12.5H23.8126L23.6459 12.3541C23.2848 12.0347 23.0313 11.6701 22.8855 11.2604C22.7397 10.8507 22.6667 10.4375 22.6667 10.0208C22.6667 9.24996 22.8977 8.5642 23.3595 7.9635C23.8213 7.36281 24.4237 6.96524 25.1667 6.77079V7.64579C24.6667 7.82635 24.264 8.13364 23.9584 8.56767C23.6529 9.0017 23.5001 9.48607 23.5001 10.0208C23.5001 10.3333 23.5591 10.6371 23.6772 10.9323C23.7952 11.2274 23.9792 11.5 24.2292 11.75L24.3334 11.8541V10.8333H25.1667V13.3333H22.6667ZM26.8334 13.2291V12.3541C27.3334 12.1736 27.7362 11.8663 28.0417 11.4323C28.3473 10.9982 28.5001 10.5138 28.5001 9.97913C28.5001 9.66663 28.4411 9.36281 28.323 9.06767C28.2049 8.77253 28.0209 8.49996 27.7709 8.24996L27.6667 8.14579V9.16663H26.8334V6.66663H29.3334V7.49996H28.1876L28.3542 7.64579C28.6945 7.98607 28.9428 8.35586 29.099 8.75517C29.2553 9.15447 29.3334 9.56246 29.3334 9.97913C29.3334 10.75 29.1025 11.4357 28.6407 12.0364C28.1789 12.6371 27.5765 13.0347 26.8334 13.2291Z" fill="white"></path><circle cx="71" cy="55" r="7" fill="#00AA63"></circle><path d="M67.6667 58.3333V57.5H68.8126L68.6459 57.3541C68.2848 57.0347 68.0313 56.6701 67.8855 56.2604C67.7397 55.8507 67.6667 55.4375 67.6667 55.0208C67.6667 54.25 67.8977 53.5642 68.3595 52.9635C68.8213 52.3628 69.4237 51.9652 70.1667 51.7708V52.6458C69.6667 52.8263 69.264 53.1336 68.9584 53.5677C68.6529 54.0017 68.5001 54.4861 68.5001 55.0208C68.5001 55.3333 68.5591 55.6371 68.6772 55.9323C68.7952 56.2274 68.9792 56.5 69.2292 56.75L69.3334 56.8541V55.8333H70.1667V58.3333H67.6667ZM71.8334 58.2291V57.3541C72.3334 57.1736 72.7362 56.8663 73.0417 56.4323C73.3473 55.9982 73.5001 55.5138 73.5001 54.9791C73.5001 54.6666 73.4411 54.3628 73.323 54.0677C73.2049 53.7725 73.0209 53.5 72.7709 53.25L72.6667 53.1458V54.1666H71.8334V51.6666H74.3334V52.5H73.1876L73.3542 52.6458C73.6945 52.9861 73.9428 53.3559 74.099 53.7552C74.2553 54.1545 74.3334 54.5625 74.3334 54.9791C74.3334 55.75 74.1025 56.4357 73.6407 57.0364C73.1789 57.6371 72.5765 58.0347 71.8334 58.2291Z" fill="white"></path></g><defs><clipPath id="clip0_171_2066"><rect width="80" height="80" fill="white"></rect></clipPath></defs></svg></div>',1),to={class:"aioseo-toc-select-mode__selector-title"},oo={class:"aioseo-toc-select-mode__selector-description"},io={__name:"SelectMode",props:{clientId:{type:String,required:!0}},setup(o){const t="all-in-one-seo-pack",e=o,l=P(window.wp.data.select("core/block-editor").getBlockAttributes(e.clientId)),i={showTableOfContents:m("Show Table of Contents",t),hideTableOfContents:m("Hide Table of Contents",t),description:m("Choose whether you want this table of contents to be standalone or synced. You can change these block settings later from the block panel.",t),standaloneTitle:m("Standalone",t),standaloneDescription:m("Each ToC block acts independently, showing the same headings across all blocks for a unified navigation.",t),syncedTitle:m("Synced",t),syncedDescription:m("Multiple ToC blocks working together, pointing to different sections of your content with their own headings.",t),enableStandalone:m("Enable Standalone",t),enableSynced:m("Enable Synced",t)},n=r=>{window.wp.data.dispatch("core/block-editor").updateBlockAttributes(e.clientId,{mode:r})},w=()=>{const r=!l.value.collapsed;l.value.collapsed=r,window.wp.data.dispatch("core/block-editor").updateBlockAttributes(e.clientId,{collapsed:r})};return J(()=>{Q(()=>{window.aioseoBus.$on("updateToc"+e.clientId,()=>{l.value=window.wp.data.select("core/block-editor").getBlockAttributes(e.clientId)})})}),(r,u)=>(h(),y("div",It,[d("div",Lt,[d("div",Rt,[d("div",{class:"aioseo-toc-header-collapsible",onClick:w},[l.value.collapsed?(h(),y("svg",zt,Dt)):(h(),y("svg",qt,Pt))]),d("p",null,[l.value.collapsed?(h(),y("span",Zt,k(i.showTableOfContents),1)):(h(),y("span",Ut,k(i.hideTableOfContents),1))])])]),l.value.collapsed?S("",!0):(h(),y("div",jt,[d("p",Yt,k(i.description),1),d("div",Gt,[d("div",Jt,[Qt,d("h3",Kt,k(i.standaloneTitle),1),d("p",Wt,k(i.standaloneDescription),1),A(_(ne),{type:"blue",onClick:u[0]||(u[0]=x=>n("standalone")),size:"base"},{default:T(()=>[j(k(i.enableStandalone),1)]),_:1})]),d("div",Xt,[eo,d("h3",to,k(i.syncedTitle),1),d("p",oo,k(i.syncedDescription),1),A(_(ne),{type:"blue",onClick:u[1]||(u[1]=x=>n("synced")),size:"base"},{default:T(()=>[j(k(i.enableSynced),1)]),_:1})])])]))]))}},no=window.wp,{CheckboxControl:lo,SelectControl:se,TextControl:ce}=no.components,D="all-in-one-seo-pack",so=o=>{const{setAttributes:t,attributes:{listStyle:e,collapsibleType:l,collapsedTitle:i,mode:n,expandedTitle:w},clientId:r}=o;return React.createElement(React.Fragment,null,React.createElement(se,{label:m("List Style",D),options:[{label:"Bullets",value:"ul"},{label:"Numbers",value:"ol"}],value:e,onChange:u=>{t({listStyle:u}),window.aioseoBus.$emit("updateToc"+r)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),React.createElement(se,{label:m("Collapsible",D),options:[{label:"Off",value:"off"},{label:"On - Open by default",value:"open"},{label:"On - Closed by default",value:"closed"}],value:l,onChange:u=>{t({collapsibleType:u}),window.aioseoBus.$emit("updateToc"+r)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),l!=="off"&&React.createElement(ce,{label:m("Collapsed Title",D),value:i,onChange:u=>{t({collapsedTitle:u}),window.aioseoBus.$emit("updateToc"+r)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),l!=="off"&&React.createElement(ce,{label:m("Expanded Title",D),value:w,onChange:u=>{t({expandedTitle:u}),window.aioseoBus.$emit("updateToc"+r)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),React.createElement(lo,{label:m("Synced Table of Contents",D),help:m("Syncing table of contents enables you to build one unified table of contents for documents with multiple sections, even using separate ToC blocks.",D),checked:n==="synced",onChange:()=>{t({mode:n==="synced"?"standalone":"synced"}),window.aioseoBus.$emit("updateToc"+r)},__nextHasNoMarginBottom:!0}))},co="all-in-one-seo-pack",R=window.wp,{useState:ro,useEffect:re}=R.element,{InspectorControls:ao}=R.blockEditor,{PanelBody:ho}=R.components,{useSelect:uo}=R.data,ve=R.blockEditor.store,{isTyping:po}=R.data.select(ve)||{isTyping:()=>null},G={HEADING:"core/heading",FAQ:"aioseo/faq",TOC:"aioseo/table-of-contents"},q=new Map;let F=[],Z=null;const wo=o=>{var t;return o.question||((t=o.content)==null?void 0:t.text)||o.content||""},fo=(o,t,e)=>typeof o=="string"&&o!==""&&t<=e,go=(o,t,e,l=[],i)=>{const n=typeof(o==null?void 0:o.anchor)=="string"&&o.anchor!=="",w=o.level||o.tagName.replace("h","");if(w==="div")return null;let r=wo(o);if(!fo(r,e,t))return null;if(r=he(r.replace(/(<br *\/?>)+/g," "),!0),!n&&!po()){const x=pe();o.anchor=x.aioseo.data.blocks.toc.hashPrefix+W(`${r}-${t}`)}const u=l.find(x=>x.content===r&&x.level===Number(w)&&x.anchor===(n?o.anchor:""));return{id:t,content:r,level:Number(w),anchor:n?o.anchor:"",editedOrder:(u==null?void 0:u.editedOrder)??t,hidden:(u==null?void 0:u.hidden)||!1,blockClientId:i}},mo=(o,t,e,l,i)=>{const n=window.wp.data.select(ve).getBlockAttributes(o);if((n==null?void 0:n.mode)!=="synced"||G.TOC!==l)return t.slice(e).map(r=>r);const w=yo(t,e,i);return w===-1?t.slice(e).map(r=>r):t.slice(e,w).map(r=>r)},yo=(o,t,e)=>{const i=o.slice(t+1).findIndex(n=>G.TOC===e(n));return i===-1?-1:t+1+i},xo=({setAttributes:o,attributes:t,clientId:e,className:l,isSelected:i})=>{const{headings:n=[]}=t,[w,r]=ro((t==null?void 0:t.headings)||[]),u=Ee(),x=window.wp.data.subscribe(()=>{if(!window.wp.data.select("core/block-editor").getBlock(e)){const f=q.get(e);f!=null&&f.mainApp&&f.mainApp.unmount(),f!=null&&f.selectedModeApp&&f.selectedModeApp.unmount(),q.delete(e),u.removeClientId(e),F=F.filter(b=>b!==e),x()}}),V=`aioseo-mode-selection-${e}`,E=uo(a=>{const{getEditedPostAttribute:f}=a("core/editor");return f("content")},[]),M=()=>{const{getBlockAttributes:a,getBlockName:f,getBlocks:b}=R.data.select("core/block-editor"),C=b(),$=[],g=N=>{N.forEach(L=>{$.push(L.clientId),L.innerBlocks&&0<L.innerBlocks.length&&g(L.innerBlocks)})};g(C);const I=$.indexOf(e),B=mo(e,$,I,f(e),f),z=[];return B.forEach(N=>{const L=f(N);if(G.HEADING!==L&&G.FAQ!==L)return[];const _e=a(N),ke=$.indexOf(N),X=go(_e,ke,I,w,N);X&&z.push(X)}),z},H=a=>!a||!Array.isArray(a)?a:[...a].sort((b,C)=>b.editedOrder-C.editedOrder).map(b=>({...b,headings:H(b.headings)})),s=a=>!a||!Array.isArray(a)?[]:[...a].sort((f,b)=>{const C=f.content.toLowerCase().localeCompare(b.content.toLowerCase());return C!==0?C:f.level!==b.level?f.level-b.level:(f.anchor||"").localeCompare(b.anchor||"")}),c=()=>{const a=Me(ue(n||[])),b=M().map((g,I)=>{const B=a.find(z=>z.content===g.content&&z.level===Number(g.level)&&z.anchor===g.anchor);return{content:g.content,level:g.level,anchor:g.anchor,blockClientId:g.blockClientId,hidden:(B==null?void 0:B.hidden)||!1,editedContent:(B==null?void 0:B.editedContent)??"",editedOrder:(B==null?void 0:B.editedOrder)??I+1,headings:(B==null?void 0:B.headings)||[]}}),C=[],$=[];return b.forEach(g=>{for(;0<$.length&&$[$.length-1].level>=g.level;)$.pop();const I={...g,headings:[]};$.length===0?C.push(I):$[$.length-1].headings.push(I),$.push(I)}),t!=null&&t.reOrdered?H(C):C},v=()=>{var C,$;const a=c();if(a.length===0)return;const f=(C=s(a))==null?void 0:C.map(g=>({content:g.content,level:g.level,anchor:g.anchor,blockClientId:g.blockClientId,hidden:g.hidden,editedContent:g.editedContent})),b=($=s(n))==null?void 0:$.map(g=>({content:g.content,level:g.level,anchor:g.anchor,blockClientId:g.blockClientId,hidden:g.hidden,editedContent:g.editedContent}));JSON.stringify(f)!==JSON.stringify(b)&&(r(a),o({headings:a}),window.aioseoBus.$emit("updateToc"+e))},p=()=>{const a=`aioseo-${e}`,f=document.getElementById(a);(!F.includes(e)||f&&!f.firstChild)&&(i||document.querySelector(`[data-block="${e}"]`))&&(F.includes(e)||F.push(e),u.addClientId(e),te({id:a,parent:document.querySelector(".block-editor"),subtree:!0,done:function(b){const C=q.get(e);C&&C.unmount(),Z=ee({...Ot,name:"Blocks/TableOfContents",props:["clientId"]},{clientId:e}),$e(Z),Z.mount(b),q.set(e,Z)}}))};return p(),re(()=>{(t==null?void 0:t.mode)===null&&u.clientIds.length===1&&o({mode:Ve.STANDALONE}),v()},[E,t]),re(()=>{p()},[t,e]),t!=null&&t.mode?React.createElement("div",{className:l},React.createElement("div",{id:`aioseo-${e}`}),React.createElement(ao,null,React.createElement(ho,{title:m("Table of Contents Settings",co)},React.createElement(so,{attributes:t,setAttributes:o,clientId:e})))):(te({id:V,parent:document.querySelector(".block-editor"),subtree:!0,done:function(a){const f=q.get(e);f&&f.unmount();const b=ee({...io,name:"Blocks/TableOfContents",props:["clientId"]},{clientId:e});b.mount(a),q.set(e,b)}}),React.createElement("div",{className:l},React.createElement("div",{id:`aioseo-mode-selection-${e}`})))},{RawHTML:ae}=window.wp.element,vo=({attributes:{headings:o,listStyle:t}})=>{if(!o)return"";const e=be(o,t);return de`<${ae}>${e}</${ae}>`},be=(o,t)=>{let e=`<${t}>`;return o.forEach(l=>{var w;if(l.hidden)return;let i="<li>";const n=l.editedContent||l.content;i+=`<a href="#${l.anchor}">${n}</a>`,(w=l.headings)!=null&&w.length&&(i+=be(l.headings,t)),i+="</li>",e+=i}),e+=`</${t}>`,e},{name:bo,title:_o,description:ko,category:Co,supports:$o,attributes:So}=We,Ao={title:_o,description:ko,category:Co,supports:$o,attributes:So,icon:qe,edit:xo,save:vo};Ce({name:bo,settings:Ao});
Save
Cancel