| 1 |
(()=>{var e={640:(e,t,o)=>{"use strict";var a=o(742),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var o,n,c,l,s,d,i=!1;t||(t={}),o=t.debug||!1;try{if(c=a(),l=document.createRange(),s=document.getSelection(),(d=document.createElement("span")).textContent=e,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",(function(a){if(a.stopPropagation(),t.format)if(a.preventDefault(),void 0===a.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var n=r[t.format]||r.default;window.clipboardData.setData(n,e)}else a.clipboardData.clearData(),a.clipboardData.setData(t.format,e);t.onCopy&&(a.preventDefault(),t.onCopy(a.clipboardData))})),document.body.appendChild(d),l.selectNodeContents(d),s.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");i=!0}catch(a){o&&console.error("unable to copy using execCommand: ",a),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),i=!0}catch(a){o&&console.error("unable to copy using clipboardData: ",a),o&&console.error("falling back to prompt"),n=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(n,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),d&&document.body.removeChild(d),c()}return i}},742:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],a=0;a<e.rangeCount;a++)o.push(e.getRangeAt(a));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}},t={};function o(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=o(640),t=o.n(e);const a=()=>{Array.from(document.querySelectorAll(".code-block-pro-copy-button:not(.cbp-cb-loaded)")).forEach((e=>{e.classList.add("cbp-cb-loaded"),e.style.display="block",e.addEventListener("click",(e=>{var o;const a=e.target?.closest("span");t()(null!==(o=a?.dataset?.code)&&void 0!==o?o:"",{format:"text/plain"}),a.classList.add("copying"),setTimeout((()=>{a.classList.remove("copying")}),2e3)}))})),Array.from(document.querySelectorAll(".wp-block-kevinbatdorf-code-block-pro pre:not(.cbp-hl-loaded)")).forEach((e=>{e.classList.add("cbp-hl-loaded");const t=e.querySelectorAll(".cbp-line-highlight");t.length&&(new ResizeObserver((t=>{t.forEach((t=>{e.style.setProperty("--cbp-block-width","0");const o=t.target.querySelector("code").offsetWidth,a=o+16===t.target.scrollWidth?o+16:t.target.scrollWidth+16;e.style.setProperty("--cbp-block-width",`${a}px`)}))})).observe(e),t.forEach((e=>{e.insertAdjacentHTML("beforeend",'<span aria-hidden="true" class="cbp-line-highlighter"></span>')})))})),(()=>{if(!window.codeBlockPro?.pluginUrl)return;const e=Array.from(document.querySelectorAll("[data-code-block-pro-font-family]:not(.cbp-ff-loaded)")||[]);e.forEach((e=>e.classList.add("cbp-ff-loaded"))),[...new Set(e.map((e=>e.dataset.codeBlockProFontFamily)).filter(Boolean))].forEach((async e=>{const t=new FontFace(e,`url(${window.codeBlockPro.pluginUrl}/build/fonts/${e}.woff2)`);await t.load(),document.fonts.add(t)}))})()};a(),window.addEventListener("DOMContentLoaded",a),window.addEventListener("load",a)})()})(); |