!function(){"use strict";var t={n:function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,{a:o}),o},d:function(e,o){for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e=window.wp.domReady,o=t.n(e);class n{constructor(t){Object.assign(this,t),Object.assign(this,n.toHsl(t))}static parse(t){const e=t?.match?.(/(\d+)/g);if(!e||e.length<3)return null;const[o,l,r,c]=e;return new n({r:+o,g:+l,b:+r,a:c?+c:1})}static toHsl(t){let{r:e,g:o,b:n,a:l}=t;e/=255,o/=255,n/=255;const r=Math.max(e,o,n),c=Math.min(e,o,n);let i,a;const u=(r+c)/2;if(r===c)i=a=0;else{const t=r-c;switch(a=u>.5?t/(2-r-c):t/(r+c),r){case e:i=(o-n)/t+(o{let{linkColor:e}=t;return e.css},value:null},"--jm-ui-background-color":{init:t=>{let{darkMode:e,backgroundColor:o}=t;if(o){if(e&&o.l<.5)return`color-mix(in srgb, #fff, ${o.css} 95%)`;if(!e)return`color-mix(in srgb, #fff, ${o.css} 50%)`}return e?"#111":"#fff"},value:null},"--jm-ui-text-color":{init:t=>{let{darkMode:e,textColor:o}=t;return o&&(e&&o.l<.25||!e&&o.l>.25)?o.css:e?"#fff":"#000"},value:null},"--jm-ui-accent-alt-color":{init:t=>{let{linkColor:e,backgroundColor:o}=t;const n=e.l<.2,l=o?.l<.4?o.css:"#000";return`color-mix(in srgb, ${n?"#fff":l}, var(--jm-ui-accent-color) ${n?"65%":"40%"})`},value:null},"--jm-ui-accent-color-contrast":{init:t=>{let{linkColor:e,backgroundColor:o}=t;return Math.abs(o?.l-e?.l)>.5?o.css:"#fff"},value:null,default:"#ffffff"},"--jm-ui-danger-color":{init:t=>{let{backgroundColor:e}=t;if(e?.l<.5)return"var(--jm-ui-danger-color-dark-mode)"},value:null,default:"#cc1818"},"--jm-ui-font-family":{init:t=>{let{bodyFontFamily:e}=t;return e},value:null}},r={linkColor:null,textColor:null,backgroundColor:null,darkMode:!1,bodyFontFamily:!1,initialized:!1,detect(){var t;const e=document.createElement("div");e.classList.add("wp-block-post-content"),e.style.display="none";const o=document.createElement("a");o.setAttribute("href","#?");const l=document.createElement("p"),r=null!==(t=document.querySelector("main"))&&void 0!==t?t:document.body;e.appendChild(o),e.appendChild(l),r.appendChild(e),this.linkColor=n.parse(getComputedStyle(o).color),this.textColor=n.parse(getComputedStyle(l).color),this.backgroundColor=n.parse(getComputedStyle(document.body).backgroundColor),e.remove(),this.bodyFontFamily=getComputedStyle(document.body).fontFamily,this.darkMode=this.textColor.l>.8},get(){return this.initialized||(this.detect(),this.initialized=!0),this}};o()((()=>{try{!function(){const t=getComputedStyle(document.documentElement);for(const[e,o]of Object.entries(l)){let n=t.getPropertyValue(e),l=!!n;o.default&&(l=o.default!==n),l||(n=o.init(r.get()),n&&document.documentElement.style.setProperty(e,n)),o.value=n}}()}catch(t){console.error(t)}}))}();