(()=>{var e,t={77:e=>{e.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var l=t[o]={i:o,l:!1,exports:{}};return e[o].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)r.d(o,l,function(t){return e[t]}.bind(null,l));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t),r.d(t,"validateHTMLColorName",(function(){return a})),r.d(t,"validateHTMLColorSpecialName",(function(){return i})),r.d(t,"validateHTMLColorHex",(function(){return s})),r.d(t,"validateHTMLColorRgb",(function(){return g})),r.d(t,"validateHTMLColorHsl",(function(){return f})),r.d(t,"validateHTMLColorHwb",(function(){return m})),r.d(t,"validateHTMLColorLab",(function(){return x})),r.d(t,"validateHTMLColorLch",(function(){return k})),r.d(t,"validateHTMLColor",(function(){return v}));const o=e=>e&&"string"==typeof e,l=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenrod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","Goldenrod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenrodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquamarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenrod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],n=["currentColor","inherit","transparent"],a=e=>{let t=!1;return o(e)&&l.map((r=>(e.toLowerCase()===r.toLowerCase()&&(t=!0),null))),t},i=e=>{let t=!1;return o(e)&&n.map((r=>(e.toLowerCase()===r.toLowerCase()&&(t=!0),null))),t},s=e=>!!o(e)&&(e&&/^#([\da-f]{3}){1,2}$|^#([\da-f]{4}){1,2}$/i.test(e)),u="(([\\d]{0,5})((\\.([\\d]{1,5}))?))",c=`(${u}%)`,d="(([0-9]|[1-9][0-9]|100)%)",b=`(${d}|(0?((\\.([\\d]{1,5}))?))|1)`,h=`([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?)([\\s]{1,5})(((${d}))|(0?((\\.([\\d]{1,5}))?))|1))?([\\s]{0,5})\\)`,p="(-?(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360)(deg)?)",g=e=>{if(o(e)){const t="([\\s]{0,5})([\\d]{1,5})%?([\\s]{0,5}),?",r="((([\\s]{0,5}),?([\\s]{0,5}))|(([\\s]{1,5})))",o=new RegExp(`^(rgb)a?\\(${t}${r}${t}${r}${t}${r}((\\/?([\\s]{0,5})(0?\\.?([\\d]{1,5})%?([\\s]{0,5}))?|1|0))?\\)$`);return e&&o.test(e)}return!1},f=e=>{if(o(e)){const t=new RegExp(`^(hsl)a?\\((([\\s]{0,5})(${p}|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)grad)|((([0-5])?\\.([\\d]{1,5})|6\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)|((0?((\\.([\\d]{1,5}))?)|1)turn))((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${d})((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${d})([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?|,?)([\\s]{0,5})(((${d}))|(0?((\\.([\\d]{1,5}))?))|1))?\\)$`);return e&&t.test(e)}return!1},m=e=>{if(o(e)){const t=new RegExp(`^(hwb\\(([\\s]{0,5})${p}([\\s]{1,5}))((0|${d})([\\s]{1,5}))((0|${d})${h}$`);return e&&t.test(e)}return!1},x=e=>{if(o(e)){const t="(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])((\\.([\\d]{1,5}))?)?|160))",r=new RegExp(`^(lab\\(([\\s]{0,5})${c}([\\s]{1,5})${t}([\\s]{1,5})${t}${h}$`);return e&&r.test(e)}return!1},k=e=>{if(o(e)){const t=new RegExp(`^lch\\((([\\s]{0,5})((([0-9]|[1-9][0-9])?((\\.([\\d]{1,5}))?)|100)(%)?)([\\s]{1,5})${""+u}([\\s]{1,5})((${p})|(0|${b})|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360))([\\s]{0,5})((\\/([\\s]{0,5})${b}))?)\\)$`);return e&&t.test(e)}return!1},v=e=>!!(e&&s(e)||g(e)||f(e)||m(e)||x(e)||k(e));t.default=e=>!!(e&&s(e)||a(e)||i(e)||g(e)||f(e)||m(e)||x(e)||k(e))}])},336:(e,t,r)=>{"use strict";const o=window.wp.blocks,l=window.wp.i18n,n=window.wp.blockEditor,a=window.wp.element,i=window.ReactJSXRuntime;function s({isEditable:e,...t}){const{placeholder:r,...o}=t;return e?(0,i.jsx)(n.RichText,{...t}):(0,i.jsx)(n.RichText.Content,{...o})}const u=window.wp.escapeHtml,c=e=>{const{attributes:t}=e,r=(r,l,n=!1)=>{const a=r.title&&r.title.text?r.title.text:r.title;return(0,i.jsxs)("li",{style:{fontSize:t.fontSizeText+"px",lineHeight:t.fontSizeText+14+"px",color:t.colorText},children:[r.anchor&&(0,i.jsx)("a",{href:e.IsInEditor?"#":`#${(0,u.escapeAttribute)(r.anchor)}`,style:{color:t.colorAnchor},children:(0,u.escapeHTML)(a)}),!r.anchor&&(0,i.jsx)("span",{children:(0,u.escapeHTML)(a)}),o(r,n)]},l)},o=(e,t)=>{if(e.children.length>0)return(0,i.jsx)("ol",{style:{listStyleType:t?"lower-roman":"lower-alpha"},children:e.children.map(((e,t)=>r(e,t,!0)))})};return(0,i.jsx)("ol",{style:{listStyleType:"decimal"},children:t.headingBlocks.map(((e,t)=>r(e,t)))})},d=e=>{const{attributes:t,setAttributes:r}=e;return(0,i.jsx)(a.Fragment,{children:(0,i.jsxs)("div",{className:"superbaddons-tableofcontents superbaddons-tableofcontents-alignment-"+t.toolbarAlignment+(t.boxedModeEnabled?" superbaddons-tableofcontents-boxed":""),style:{backgroundColor:t.boxedModeEnabled?t.colorBackground:"unset",borderRadius:t.boxedModeEnabled?t.borderRadiusBoxed+"px":"unset"},children:[t.labelTitleEnabled&&(0,i.jsx)(s,{isEditable:e.IsInEditor,className:"superbaddons-tableofcontents-title",tagName:"span",onChange:e=>{r({labelTitle:e})},value:t.labelTitle,style:{color:t.colorTitle,fontSize:t.fontSizeTitle+"px",lineHeight:t.fontSizeTitle+8+"px"}}),(0,i.jsx)("div",{className:"superbaddons-tableofcontents-table",children:(0,i.jsx)(c,{...e})})]})})},b=window.wp.components;r(750);var h=r(77);const p=(e,t=!1,r=!1)=>(e=isNaN(e)?0:parseInt(e),t&&er&&(e=r),e),g=e=>1==e,f=function(e,t){return void 0===t?e[0]:e.find((e=>e===t))},m=function(e,t,r=!1){return r?e.find((e=>e.slug===t))[r]:e.find((e=>e.slug===t))},x=function(e){return void 0!==e&&((0,h.validateHTMLColorHex)(e)||(0,h.validateHTMLColorRgb)(e)||(0,h.validateHTMLColorHsl)(e))?e:"unset"},k=[{name:(0,l.__)("Small","superb-blocks"),slug:"small",size:14},{name:(0,l.__)("Medium","superb-blocks"),slug:"medium",size:16},{name:(0,l.__)("Large","superb-blocks"),slug:"large",size:24},{name:(0,l.__)("Huge","superb-blocks"),slug:"huge",size:32},{name:(0,l.__)("Enormous","superb-blocks"),slug:"enormous",size:40}],v=[{name:(0,l.__)("Superb Black","superb-blocks"),slug:"black",color:"#444444"},{name:(0,l.__)("Superb Gray","superb-blocks"),slug:"default",color:"#7C7C7C"},{name:(0,l.__)("Background Gray","superb-blocks"),slug:"bggray",color:"#F2F2F2"},{name:(0,l.__)("Superb Gold","superb-blocks"),slug:"sorange",color:"#FFCA28"},{name:(0,l.__)("White","superb-blocks"),slug:"white",color:"#fff"}],y=window.wp.data,_=e=>{const t=[],r={};return e.forEach((e=>{const o=w(e),l=((e,t)=>{const r=Math.max(...Object.keys(t));for(let o=e.level+1;o<=r;o++)t[o]=!1;t[e.level]=e;for(let r=e.level-1;r>0;r--){const e=t[r];if(e)return e}return!1})(o,r);l?l.children.push(o):t.push(o)})),t},w=e=>{var t;return{id:e.clientId,title:null!==(t=e.attributes.content.text)&&void 0!==t?t:e.attributes.content,level:e.attributes.level,anchor:!!e.attributes.anchor&&e.attributes.anchor,children:[]}},C=JSON.parse('{"UU":"superb-addons/table-of-contents"}'),S=window.React;var T,B;function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.IsPreview||(0,a.useEffect)((()=>{const{getBlocks:e}=(0,y.select)("core/block-editor"),r=()=>{const t=e(),r=[];return t.forEach((e=>{const t=(e=>{let t=[];const r=e=>{if("core/heading"===e.name&&t.push(e),e.innerBlocks)for(const t of e.innerBlocks)r(t)};return r(e),t})(e);t.length>0&&r.push(...t)})),r};let o=r();t({headingBlocks:_(o)}),(0,y.subscribe)((()=>{const e=r();((e,t)=>{if(e.length!==t.length)return!0;for(var r in e)if(e[r]!==t[r])return!0;return!1})(o,e)&&(o=e,t({headingBlocks:_(o)}))}))}),[])})(e);const o=(e,t)=>{let o=g(t);r({[e]:o})};return(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(n.BlockControls,{children:(0,i.jsx)(n.AlignmentToolbar,{value:t.toolbarAlignment,onChange:e=>{let t=f(["left","center","right"],e);r({toolbarAlignment:t})}})}),(0,i.jsx)(n.InspectorControls,{children:(0,i.jsx)(b.PanelBody,{title:(0,l.__)("General Settings","superb-blocks"),initialOpen:!0,children:(0,i.jsxs)("div",{className:"superbaddons-inspector-wrapper",children:[(0,i.jsx)(b.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,l.__)("Boxed Mode","superb-blocks"),checked:t.boxedModeEnabled,onChange:e=>o("boxedModeEnabled",e)}),(0,i.jsx)("p",{className:"superb-addons-small-text-control-description block-editor-hooks__layout-constrained-helptext",children:(0,l.__)("Enabling boxed mode will add a box, with a background color, around the table of contents block.","superb-blocks")}),t.boxedModeEnabled&&(0,i.jsx)(b.RangeControl,{label:(0,l.__)("Boxed Border Radius","superb-blocks"),value:t.borderRadiusBoxed,onChange:e=>{let t=p(e,0,100);r({borderRadiusBoxed:t})},min:0,max:100}),(0,i.jsx)(b.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,l.__)("Display Title","superb-blocks"),checked:t.labelTitleEnabled,onChange:e=>o("labelTitleEnabled",e)})]})})}),(0,i.jsxs)(n.InspectorControls,{group:"styles",children:[(0,i.jsxs)(b.PanelBody,{title:"Colors",initialOpen:!0,children:[(0,i.jsx)("label",{className:"components-base-control__label",children:(0,l.__)("Title Color","superb-blocks")}),(0,i.jsx)(b.ColorPalette,{colors:v,defaultValue:t.colorTitle,value:t.colorTitle,onChange:e=>{let t=x(e);r({colorTitle:t})}}),(0,i.jsx)("label",{className:"components-base-control__label",children:(0,l.__)("Text Color","superb-blocks")}),(0,i.jsx)(b.ColorPalette,{colors:v,defaultValue:t.colorText,value:t.colorText,onChange:e=>{let t=x(e);r({colorText:t})}}),(0,i.jsx)("label",{className:"components-base-control__label",children:(0,l.__)("Anchor Link Color","superb-blocks")}),(0,i.jsx)(b.ColorPalette,{colors:v,defaultValue:t.colorAnchor,value:t.colorAnchor,onChange:e=>{let t=x(e);r({colorAnchor:t})}}),t.boxedModeEnabled&&(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)("label",{className:"components-base-control__label",children:(0,l.__)("Background Color","superb-blocks")}),(0,i.jsx)(b.ColorPalette,{colors:v,defaultValue:t.colorBackground,value:t.colorBackground,onChange:e=>{let t=x(e);r({colorBackground:t})}})]})]}),(0,i.jsxs)(b.PanelBody,{title:(0,l.__)("Font Sizes","superb-blocks"),initialOpen:!0,children:[(0,i.jsx)("label",{className:"components-base-control__label",children:(0,l.__)("Title","superb-blocks")}),(0,i.jsx)(b.FontSizePicker,{__nextHasNoMarginBottom:!0,fontSizes:k,withSlider:!0,withReset:!0,value:t.fontSizeTitle,onChange:e=>{let t=0;t=void 0===e?m(k,"huge","size"):p(e,0,100),r({fontSizeTitle:t})}}),(0,i.jsx)("hr",{}),(0,i.jsx)("label",{className:"components-base-control__label",children:(0,l.__)("Text","superb-blocks")}),(0,i.jsx)(b.FontSizePicker,{__nextHasNoMarginBottom:!0,fontSizes:k,withSlider:!0,withReset:!0,value:t.fontSizeText,onChange:e=>{let t=0;t=void 0===e?m(k,"small","size"):p(e,0,100),r({fontSizeText:t})}})]})]}),(0,i.jsx)("div",{...(0,n.useBlockProps)(),children:(0,i.jsx)(d,{...e,IsInEditor:!0})})]})},save:function(e){return(0,i.jsx)("div",{...n.useBlockProps.save(),children:(0,i.jsx)(d,{...e,IsInEditor:!1})})}})},750:(e,t)=>{"use strict";t.J=void 0;var r=/^([^\w]*)(javascript|data|vbscript)/im,o=/&#(\w+)(^\w|;)?/g,l=/&(newline|tab);/gi,n=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|:)/gim,i=[".","/"];t.J=function(e){var t,s=(t=e||"",t.replace(o,(function(e,t){return String.fromCharCode(t)}))).replace(l,"").replace(n,"").trim();if(!s)return"about:blank";if(function(e){return i.indexOf(e[0])>-1}(s))return s;var u=s.match(a);if(!u)return s;var c=u[0];return r.test(c)?"about:blank":s}}},r={};function o(e){var l=r[e];if(void 0!==l)return l.exports;var n=r[e]={exports:{}};return t[e](n,n.exports,o),n.exports}o.m=t,e=[],o.O=(t,r,l,n)=>{if(!r){var a=1/0;for(c=0;c=n)&&Object.keys(o.O).every((e=>o.O[e](r[s])))?r.splice(s--,1):(i=!1,n0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[r,l,n]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={237:0,361:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var l,n,[a,i,s]=r,u=0;if(a.some((t=>0!==e[t]))){for(l in i)o.o(i,l)&&(o.m[l]=i[l]);if(s)var c=s(o)}for(t&&t(r);uo(336)));l=o.O(l)})();