generated from siyuan-note/theme-sample
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy paththeme.js
1 lines (1 loc) · 49.6 KB
/
theme.js
1
(()=>{"use strict";var n={12:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.t=void 0,t.o=d,t.i=function(n){return o(this,void 0,void 0,(function*(){var t,e,c;if("mouseup"!==n.type)return;a||(a=yield(0,s.u)());const d=n.target,f=d.closest(".ariaLabel");if(!f)return;const m=f.dataset.type,_=d.closest(".protyle-title__icon")||"doc"===f.dataset.type?"doc":void 0,b=r.includes(m)?m:_;if(!b)return;const v="doc"===b?null!==(t=f.parentElement.dataset.nodeId)&&void 0!==t?t:null===(c=null===(e=f.closest(".protyle"))||void 0===e?void 0:e.querySelector(".protyle-title"))||void 0===c?void 0:c.dataset.nodeId:f.dataset.nodeId;l=yield(0,u.l)("#commonMenu:not(.fn__none)"),function(n,t){o(this,void 0,void 0,(function*(){const e="doc"===n;!function(n){o(this,void 0,void 0,(function*(){var t;if(!l||document.getElementById("afwdMenuItem-clear"))return;const e=l.lastChild,o=document.createElement("button");o.className="b3-menu__item";const i=document.createElement("button");i.className="b3-menu__separator";const u=`\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-on">\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\n <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m9 12l2 2l4-4"/></g>\n </svg>\n <span class="b3-menu__label">${a["afwdMenuItem-on"]}</span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-off">\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\n <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9l-6 6m0-6l6 6"/></g>\n </svg>\n <span class="b3-menu__label">${a["afwdMenuItem-off"]}</span>\n </button>\n `,c=`\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-all">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon" style=""></svg>\n <span>${a["afwdMenuItem-all"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-db">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon" style=""><use xlink:href="#iconDatabase"></use></svg>\n <span>${a["afwdMenuItem-db"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-t">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon" style=""><use xlink:href="#iconTable"></use></svg>\n <span>${a["afwdMenuItem-t"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-p">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon"><use xlink:href="#iconImage"></use></svg>\n <span>${a["afwdMenuItem-p"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-iframe">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon"><use xlink:href="#iconHTML5"></use></svg>\n <span>${a["afwdMenuItem-iframe"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-sb">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon"><use xlink:href="#iconSuper"></use></svg>\n <span>${a["afwdMenuItem-sb"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n `,s=`\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 18 18">\n <path fill="currentColor" d="m15.503 15.003l-.735.71a.75.75 0 1 0 1.042 1.078l1.886-1.82a1 1 0 0 0 0-1.44l-1.886-1.82a.75.75 0 0 0-1.042 1.079l.739.713H12.75a.75.75 0 0 0 0 1.5zM15 3a2 2 0 0 1 2 2v4.25a.75.75 0 0 1-1.5 0V5a.5.5 0 0 0-.5-.5H5a.5.5 0 0 0-.5.5v4.25a.75.75 0 0 1-1.5 0V5a2 2 0 0 1 2-2zM5.234 15.712l-.735-.71h2.752a.75.75 0 1 0 0-1.5H4.495l.739-.713a.75.75 0 0 0-1.042-1.078l-1.886 1.82a1 1 0 0 0 0 1.44l1.886 1.82a.75.75 0 0 0 1.042-1.079"/>\n </svg>\n <span class="b3-menu__label">${a.afwdDocMenuLabel}</span>\n <svg class="b3-menu__icon b3-menu__icon--small">\n <use xlink:href="#iconRight"></use>\n </svg>\n <div class="b3-menu__submenu">\n <div class="b3-menu__items">\n ${"doc"===n?c:u}\n <button class="b3-menu__separator"></button>\n <button class="b3-menu__item" id="afwdMenuItem-clear">\n <svg class="b3-menu__icon " style=""><use xlink:href="#iconTrashcan"></use></svg>\n <span class="b3-menu__label">${a["afwdMenuItem-clear"]}\n </span>\n </button>\n </div>\n </div>\n `;o.innerHTML=s,e.insertBefore(o,null===(t=e.lastChild)||void 0===t?void 0:t.previousSibling),e.insertBefore(i,o)}))}(n);let u=yield(0,i.m)(t).then((n=>n["custom-afwd"]));if(u||(u=""),u=u.split(" "),u.length>0&&e){if(u.forEach((n=>{const t=document.getElementById(`afwdMenuItem-${n}`);t&&(t.querySelector("input").checked=!0)})),u.includes("all")){const n=null==l?void 0:l.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-all, #afwdMenuItem-clear)");null==n||n.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))}}else if(u.length>0){const n=document.getElementById(`afwdMenuItem-${u[0]}`);n&&n.classList.add("b3-menu__item--selected")}!function(n,t,e){const o=null==l?void 0:l.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-clear)");let u=[];if(!o)return;const c=[...o].filter((n=>"afwdMenuItem-all"!==n.id));n?null==o||o.forEach((n=>{n.onclick=o=>{if(n.classList.contains("b3-menu__item--disabled"))return;const s=n.querySelector("input"),r=n.id.split("-")[1];let l=s.checked;o.target===s?l=!l:s.checked=!l,l?"all"===r?(c.forEach((n=>{n.classList.remove("b3-menu__item--disabled"),n.querySelector("input").disabled=!1})),e=u.length>0?u:[]):e=e.filter((n=>n!==r)):"all"===r?(e.includes("all")||(u=e),e=["all"],c.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))):e.push(r),(0,i._)(t,{"custom-afwd":e.join(" ")||""})}})):null==o||o.forEach(((n,o,u)=>{n.onclick=()=>{const c=n.id.split("-")[1];n.classList.contains("b3-menu__item--selected")?(e=[],n.classList.remove("b3-menu__item--selected")):(e=[c],n.classList.add("b3-menu__item--selected"),u[1-o].classList.remove("b3-menu__item--selected")),(0,i._)(t,{"custom-afwd":(null==e?void 0:e.join(" "))||""})}}));const s=document.getElementById("afwdMenuItem-clear");s&&(s.onclick=()=>{e=[],u=[],(0,i._)(t,{"custom-afwd":""}),o.forEach((t=>{if(t.classList.remove("b3-menu__item--disabled"),t.classList.remove("b3-menu__item--selected"),n){const n=t.querySelector("input");n.disabled=!1,n.checked=!1}}))})}(e,t,u)}))}(b,v)}))},t.v=function(){null===c.h||void 0===c.h||c.h.forEach((n=>{(n.querySelector(".file-tree")?[]:n.querySelectorAll(".protyle-wysiwyg")).forEach((n=>{n.style.removeProperty("--protyle-spacing"),n.dataset.p=void 0}))}))};const i=e(613),u=e(629),c=e(937),s=e(553);t.t=(0,u.k)(d,200);const r=["NodeParagraph","NodeTable","NodeAttributeView","NodeSuperBlock","NodeVideo","NodeWidget","NodeIFrame"];let l,a=s.M;function d(){null===c.h||void 0===c.h||c.h.forEach((n=>{let t=n.querySelector(".file-tree")?[]:n.querySelectorAll(".protyle-wysiwyg");setTimeout((()=>{t.forEach((n=>{let t;t=n.style.paddingLeft,t!==n.dataset.p&&(n.style.setProperty("--protyle-spacing",t),n.dataset.p=t)}))}),300)}))}},553:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.S=t.followSysAccentColor=t.M=void 0,t.P=function(){return o(this,void 0,void 0,(function*(){d=r.A.O,function(){return o(this,void 0,void 0,(function*(){yield(0,i.getFile)("/data/snippets/Asri.config.json").then((n=>n&&200===n.status?n.json():null)).then((n=>{var e,o,i;if(!n)return void(t.followSysAccentColor=a[d].followSysAccentColor);let u;n.light||(u=n,Object.keys(a).forEach((t=>{n[t]=u})));const c=["light","dark"];for(const t of c)a[t].followSysAccentColor=!!n[t].followSysAccentColor,a[t].chroma=null!==(e=n[t].chroma)&&void 0!==e?e:"1",a[t].userCustomColor=null!==(o=n[t].userCustomColor)&&void 0!==o?o:"#3478f6",a[t].presetPalette=null!==(i=n[t].presetPalette)&&void 0!==i?i:"";t.followSysAccentColor=!!n[d].followSysAccentColor}))}))}().then((()=>{if(r.A.C){if(r.A.I||r.A.j||r.A.T?(document.documentElement.style.setProperty("--asri-user-custom-accent",a[d].userCustomColor),j(a[d].userCustomColor)):t.followSysAccentColor?document.documentElement.style.removeProperty("--asri-user-custom-accent"):(document.documentElement.style.setProperty("--asri-user-custom-accent",a[d].userCustomColor),j(a[d].userCustomColor)),a[d].presetPalette){const n=a[d].presetPalette,e=T[n][d];document.documentElement.setAttribute("data-asri-palette",n.split("-")[2]),t.followSysAccentColor=!1,document.documentElement.style.setProperty("--asri-user-custom-accent",e.primary),document.documentElement.style.setProperty("--asri-c-factor",e.chroma),y="0"===e.chroma,C(e.chroma),j(e.primary)}else document.documentElement.style.setProperty("--asri-c-factor",a[d].chroma),document.documentElement.removeAttribute("data-asri-palette"),y="0"===a[d].chroma,C(a[d].chroma);A()}}))}))},t.$=function(){document.documentElement.style.removeProperty("--asri-user-custom-accent"),document.documentElement.style.removeProperty("--asri-sys-accent-grayscale"),document.documentElement.style.removeProperty("--asri-c-factor"),document.documentElement.style.removeProperty("--asri-sys-accent"),document.documentElement.style.removeProperty("--asri-sys-accent-accessible"),document.documentElement.style.removeProperty("--asri-c-0"),document.documentElement.style.removeProperty("--asri-on-primary-reverse"),document.querySelectorAll(".asri-config").forEach((n=>n.remove()))},t.u=w,t.L=function(n){return o(this,void 0,void 0,(function*(){var e,o;if("mouseup"!==n.type)return;Object.keys(t.M).length||(t.M=yield w());if(!n.target.closest(".toolbar__item"))return;if(document.querySelector(".asri-config"))return;let i=yield(0,s.l)('#commonMenu[data-name="barmode"] .b3-menu__items',document,2,0);if(!i)return;const u=`\n <button class="b3-menu__separator asri-config"></button>\n <div class="menu-item__subtitle" style="user-select: none;">${t.M["palette-presets"]}</div>\n ${x("prst-palette-everbliss")}\n ${x("prst-palette-auriflow")}\n <button class="b3-menu__separator asri-config"></button>\n <button class="b3-menu__item asri-config" id="pickColor">\n <svg class="b3-menu__icon"></svg>\n <input id="asriColorPicker" type="color" value="${a[d].userCustomColor}">\n <label for="asriColorPicker" class="be-menu__label">${t.M.pickColor}</label>\n </button>\n <button class="b3-menu__item asri-config" id="followSysAccent">\n <svg class="b3-menu__icon"></svg>\n <label for="" class="be-menu__label">${t.M.followSysAccent}</label>\n </button>\n <button class="b3-menu__item asri-config" data-type="nobg" id="asriChroma">\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\n <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 11l-8-8l-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0zM5 2l5 5m-8 6h15m5 7a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4c.3 1.6 2 2.4 2 4" />\n </svg>\n <div aria-label="${t.M.asriChroma+(null!==(o=null!==(e=null==v?void 0:v.value)&&void 0!==e?e:a[d].chroma)&&void 0!==o?o:"1")}" class="b3-tooltips b3-tooltips__n">\n <input style="box-sizing: border-box" type="range" id="asriChromaSlider" class="b3-slider fn__block" min="0" max="5" step="0.1" value="1">\n </div>\n </button>\n`,c=document.createRange().createContextualFragment(u);i.appendChild(c),_=document.getElementById("followSysAccent"),b=document.getElementById("pickColor"),v=document.getElementById("asriChromaSlider"),h=b.querySelector("input"),_&&b&&v&&h&&(function(){const n=document.getElementById("asriChroma");a[d].presetPalette&&(null==b||b.classList.add("b3-menu__item--disabled"),null==_||_.classList.add("b3-menu__item--disabled"),null==n||n.classList.add("b3-menu__item--disabled"));if(_.classList.toggle("b3-menu__item--selected",!a[d].presetPalette&&t.followSysAccentColor),b.classList.toggle("b3-menu__item--selected",!a[d].presetPalette&&!t.followSysAccentColor),v.value=a[d].chroma||"1",v.parentElement.ariaLabel=t.M.asriChroma+a[d].chroma,a[d].presetPalette){const n=document.getElementById(`${a[d].presetPalette}`);null==n||n.classList.add("b3-menu__item--selected")}}(),function(){if(!(_&&b&&v&&h))return;r.A.I||r.A.j||r.A.T?_.classList.add("fn__none"):_.addEventListener("mouseup",k);b.addEventListener("click",M),h.addEventListener("input",S),h.addEventListener("change",P),v.addEventListener("input",O)}())}))},t.N=A;const i=e(613),u=e(571),c=e(796),s=e(629),r=e(49),l=e(288),a={light:{followSysAccentColor:!1,chroma:"1",userCustomColor:"#3478f6",presetPalette:""},dark:{followSysAccentColor:!1,chroma:"1",userCustomColor:"#3478f6",presetPalette:""}};let d;const f=(0,s.k)(g,200);let m,_,b,v,h,p=!1,y=!1;function w(){return o(this,void 0,void 0,(function*(){let n;try{return n=["zh_CN","zh_CHT","en_US"].includes(r.A.lang)?yield fetch(`/appearance/themes/Asri/i18n/${r.A.lang}.json`):yield fetch("/appearance/themes/Asri/i18n/en_US.json"),t.M=yield n.json(),t.M}catch(n){throw n}}))}function g(){return o(this,void 0,void 0,(function*(){yield(0,i.B)("/data/snippets/Asri.config.json",JSON.stringify(a,void 0,4))}))}t.followSysAccentColor=!1;const x=n=>`<button class="b3-menu__item asri-config" id="${n}"><svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M19 3h-4a2 2 0 0 0-2 2v12a4 4 0 0 0 8 0V5a2 2 0 0 0-2-2"/><path d="m13 7.35l-2-2a2 2 0 0 0-2.828 0L5.344 8.178a2 2 0 0 0 0 2.828l9 9"/><path d="M7.3 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h12m0-4v.01"/></g></svg><span class="b3-menu__label">${t.M[n]||n}</span></button>`;function k(){(0,l.R)(600,(()=>{document.querySelectorAll(".asri-config.b3-menu__item--selected").forEach((n=>n.classList.remove("b3-menu__item--selected"))),a[d].followSysAccentColor?(t.followSysAccentColor=!1,b.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",a[d].userCustomColor||m||"#3478f6"),C(a[d].chroma),j(a[d].userCustomColor||m||"#3478f6"),a[d].followSysAccentColor=!1):(t.followSysAccentColor=!0,_.classList.add("b3-menu__item--selected"),document.documentElement.style.removeProperty("--asri-user-custom-accent"),a[d].followSysAccentColor=!0,A()),g()}))}function M(n){(0,l.R)(600,(()=>{t.followSysAccentColor&&(t.followSysAccentColor=!1,_.classList.remove("b3-menu__item--selected"),b.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",a[d].userCustomColor),C(a[d].chroma),j(a[d].userCustomColor),a[d].userCustomColor=a[d].userCustomColor,a[d].followSysAccentColor=!1,g())}))}function S(){const n=h.value;document.documentElement.style.setProperty("--asri-user-custom-accent",n),j(n)}function P(){_.classList.remove("b3-menu__item--selected"),b.classList.add("b3-menu__item--selected"),j(h.value),a[d].userCustomColor=h.value,t.followSysAccentColor=!1,a[d].followSysAccentColor=!1,g()}function O(){const n=this.value;document.documentElement.style.setProperty("--asri-c-factor",n),this.parentElement.ariaLabel=t.M.asriChroma+n,a[d].chroma=n,y="0"===n,C(n),f()}function A(){if(!(r.A.I||r.A.j||r.A.T)){const n="#"+u.remote.systemPreferences.getAccentColor().slice(0,6),e=(0,s.D)(n);if(!e)return;m!==n&&(document.documentElement.style.setProperty("--asri-sys-accent",n),e.s>.28?document.documentElement.style.setProperty("--asri-sys-accent-accessible",n):document.documentElement.style.removeProperty("--asri-sys-accent-accessible"),p=0===e.s,m=n),t.followSysAccentColor&&(C(e.s),j(n))}}function C(n){return"0"===String(n)||t.followSysAccentColor&&p||y?(document.documentElement.style.setProperty("--asri-c-0","0"),!0):(document.documentElement.style.removeProperty("--asri-c-0"),!1)}const I="light"===r.A.O?.81:.79;function j(n){const t=(0,s.F)(n);t&&(t>I?document.documentElement.style.setProperty("--asri-on-primary-reverse","light"===r.A.O?".4":".3"):document.documentElement.style.removeProperty("--asri-on-primary-reverse"))}const T={"prst-palette-auriflow":{dark:{primary:"#D2B983",chroma:"0.3",followSysAccentColor:!1},light:{primary:"#F4D18B",chroma:"0",followSysAccentColor:!1}},"prst-palette-everbliss":{dark:{primary:"#ccc4fb",chroma:"1.5",followSysAccentColor:!1},light:{primary:"#F4CA57",chroma:"2.8",followSysAccentColor:!1}}};t.S=new c.V((function(n){return o(this,void 0,void 0,(function*(){const e=n.target.closest('[id^="prst-palette-"]');if(!e)return;const o=document.getElementById("asriChroma"),i=e.id,u=T[i][d];document.querySelectorAll('[id^="prst-palette-"]').forEach((n=>n.classList.remove("b3-menu__item--selected"))),(0,l.R)(600,(()=>{a[d].presetPalette===i?(e.classList.remove("b3-menu__item--selected"),document.documentElement.removeAttribute("data-asri-palette"),null==b||b.classList.remove("b3-menu__item--disabled"),null==_||_.classList.remove("b3-menu__item--disabled"),null==o||o.classList.remove("b3-menu__item--disabled"),a[d].presetPalette="",t.followSysAccentColor=a[d].followSysAccentColor,t.followSysAccentColor?(_.classList.add("b3-menu__item--selected"),document.documentElement.style.removeProperty("--asri-user-custom-accent"),a[d].followSysAccentColor=!0,A()):(b.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",a[d].userCustomColor||m||"#3478f6"),a[d].followSysAccentColor=!1),document.documentElement.style.setProperty("--asri-c-factor",a[d].chroma),y="0"===a[d].chroma,C(a[d].chroma),j(t.followSysAccentColor?m:a[d].userCustomColor),g()):(e.classList.add("b3-menu__item--selected"),document.documentElement.setAttribute("data-asri-palette",i.split("-")[2]),null==b||b.classList.add("b3-menu__item--disabled"),null==_||_.classList.add("b3-menu__item--disabled"),null==o||o.classList.add("b3-menu__item--disabled"),t.followSysAccentColor=!1,_.classList.remove("b3-menu__item--selected"),b.classList.remove("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",u.primary),document.documentElement.style.setProperty("--asri-c-factor",u.chroma),y="0"===u.chroma,C(u.chroma),j(u.primary),a[d].presetPalette=i,g())}))}))}))},344:(n,t)=>{function e(){document.body.classList.toggle("has-exportimg",!!document.querySelector('[data-key="dialog-exportimage"]'))}Object.defineProperty(t,"__esModule",{value:!0}),t.H=function(n,t){e()},t.J=e},818:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.U=function(){return o(this,void 0,void 0,(function*(){const n=u.K.W?u.K.W:yield(0,i.l)("#dockLeft");u.K.Y||(yield(0,i.l)(".layout__dockl"));const t=u.K.q;for(let e of[n,t]){let t=(0,c.G)(e===n?"L":"R"),o=(0,c.X)(e===n?"L":"R");t&&o?null==e||e.classList.add("dock-layout-expanded"):null==e||e.classList.remove("dock-layout-expanded")}}))},t.Z=function(){return o(this,void 0,void 0,(function*(){var n,t,e;if(u.A.j)return;const o=yield(0,c.nn)(),i=!(0,c.G)("B")&&(0,c.X)("B");null===(n=u.K.toolbar)||void 0===n||n.nextElementSibling.classList.toggle("has-dockb",o),null===(t=u.K.toolbar)||void 0===t||t.nextElementSibling.classList.toggle("has-layout-dockb-float",i),null===(e=u.K.tn)||void 0===e||e.classList.toggle("has-layout-dockb-float",i)}))},t.en=function(){var n,t;null===(n=u.K.toolbar)||void 0===n||n.nextElementSibling.classList.remove("has-dockb"),null===(t=u.K.toolbar)||void 0===t||t.nextElementSibling.classList.remove("has-layout-dockb-float")},t.un=function(){var n;null===(n=document.querySelector(".dock-layout-expanded"))||void 0===n||n.classList.remove("dock-layout-expanded")};const i=e(629),u=e(49),c=e(937)},261:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.cn=function(){i.forEach((({sn:n,className:t})=>{n&&document.body.classList.add(t)}))},t.rn=function(){i.forEach((({className:n})=>{document.body.classList.remove(n)}))};const o=e(49),i=[{sn:o.A.ln,className:"body-asri--mac"},{sn:o.A.T,className:"body-asri--linux"},{sn:o.A.j,className:"body-asri--mobile"},{sn:o.A.I,className:"body-asri--browser"},{sn:o.A.an,className:"body-asri--android"},{sn:o.A.dn,className:"body-asri--iosApp"},{sn:o.A.fn,className:"body-asri--readOnly"},{sn:o.A.mn,className:"body-asri--safari"}]},54:(n,t)=>{function e(){document.querySelectorAll(".asri-selected-block").forEach((n=>n.classList.remove("asri-selected-block")))}Object.defineProperty(t,"__esModule",{value:!0}),t._n=function(n){const t=new Promise((n=>{const t=()=>{document.removeEventListener("mouseup",t,!0),n()};document.addEventListener("mouseup",t,!0)})),o=new Promise((n=>{setTimeout(n,300)})),i=new Promise((n=>{const t=()=>{document.removeEventListener("keyup",t,!0),n()};document.addEventListener("keyup",t,!0)}));Promise.race([t,i,o]).then((()=>{const n=window.getSelection(),t=n&&n.rangeCount>0?n.getRangeAt(0):null;if(!t)return;const o=t.commonAncestorContainer.parentElement,i=o?o.closest("[data-node-id]"):null;if(!i)return;const u=i.getAttribute("data-type");e(),u&&!["NodeAttributeView","NodeCodeBlock","NodeList","NodeHTMLBlock"].includes(u)&&i.classList.add("asri-selected-block")}))},t.bn=e},2:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.vn=function(){return o(this,void 0,void 0,(function*(){(0,m.cn)(),(0,h.hn)(),(0,g.pn)(),(0,y.yn)(),(0,a.P)(),(0,v.wn)(),yield(0,a.u)(),r.A.j||(yield(0,u.gn)(),yield(0,w.xn)("initials"),(0,w.kn)()),N(),(0,f.Z)(),(0,y.Mn)(),x.start(document,"mouseup"),k.start(document,"dragend"),M.start(document,"keyup",!0),S.start(window,"focus"),S.start(window,"blur"),P.start(document,"selectionchange"),A.observe(document.body,s.Sn),O.observe(document.body,{childList:!0}),j.start(b.Pn,"change"),a.S.start(document,"mouseup"),r.K.On||(yield(0,c.l)(".layout__center")),r.A.j||(C.observe(r.K.On),I.observe(document.body))}))},t.An=function(){return o(this,arguments,void 0,(function*(n=!0){n&&(r.A.j||(yield(0,w.Cn)()),(0,f.un)(),(0,p.In)(),(0,l.v)(),(0,f.en)(),(0,v.jn)(),(0,_.bn)(),(0,y.Tn)(),(0,y.$n)(),(0,m.rn)(),(0,h.Ln)(),(0,g.Nn)(),document.body.classList.remove("body-asri--fullscreen"),(0,a.$)()),x.remove(document,"mouseup"),k.remove(document,"dragend"),M.remove(document,"keyup",!0),S.remove(window,"focus"),S.remove(window,"blur"),P.remove(document,"selectionchange"),A.disconnect(),j.remove(b.Pn,"change"),a.S.remove(document,"mouseup"),O.disconnect((()=>{document.body.classList.remove("has-exportimg")})),r.A.j||(C.disconnect(),I.disconnect())}))};const i=e(796),u=e(937),c=e(629),s=e(766),r=e(49),l=e(12),a=e(553),d=e(344),f=e(818),m=e(261),_=e(54),b=e(288),v=e(863),h=e(832),p=e(844),y=e(414),w=e(376),g=e(130),x=new i.V(L),k=new i.V(L),M=new i.V(L),S=new i.V((function(n){(0,u.gn)().then((()=>{N(),!r.A.dn&&a.followSysAccentColor&&r.A.C&&(0,a.N)()}))})),P=new i.V(_._n),O=new s.Bn((0,c.k)(d.H)),A=new s.Bn((function(n,t){return o(this,void 0,void 0,(function*(){var t,e;for(let o of n){const n=o.target;if(n.classList.contains("body--blur"))return;if(n.classList.contains("b3-list-item--focus")&&(0,p.Rn)(),n.classList.contains("item--focus")){const e=null!==(t=n.getAttribute("data-id"))&&void 0!==t?t:void 0;(0,v.wn)(e)}if(n.classList.contains("layout__wnd--active")){const t=n.querySelector(".layout__center .layout-tab-container>[data-id]:not(.fn__none)");if(!t)return;const o=null!==(e=t.getAttribute("data-id"))&&void 0!==e?e:void 0;(0,v.wn)(o)}}}))})),C=new s.zn((function(n,t){(0,w.Dn)(0,T,u.Fn).then(w.Vn),(0,l.t)(),(0,y.Hn)()})),I=new s.zn((function(n,t){for(let t of n){T=!0,B();const{inlineSize:n}=t.contentBoxSize[0];if(t.target instanceof HTMLElement){if(!t.target.dataset.En){t.target.dataset.En=n+"";continue}const e=n-parseFloat(t.target.dataset.En);t.target.dataset.En=n+"",$=e}}})),j=new i.V((function(n){(0,b.R)(600,(()=>{}),200)}));let T=!1,$=0;function L(n){(0,a.L)(n),(0,l.i)(n),N(n),(0,b.Jn)(n)}function N(n){return o(this,void 0,void 0,(function*(){function t(){setTimeout((()=>o(this,void 0,void 0,(function*(){(0,f.U)(),(0,y.Hn)(),(0,y.yn)(),yield(0,u.gn)(),(0,l.o)(),(0,f.Z)(),(0,y.Mn)(),!r.A.dn&&a.followSysAccentColor&&r.A.C&&(0,a.N)()}))),0)}n?(n.type.startsWith("mouse")||n.type.startsWith("drag")||n instanceof KeyboardEvent&&("Control"===n.key||"Alt"===n.key||"Shift"===n.key||"Meta"===n.key))&&(t(),setTimeout((()=>{(0,w.Un)(),(0,w.Dn)(0,!1,u.Fn).then(w.Vn)}),0)):(t(),(0,w.Dn)().then(w.Vn))}))}const B=(0,c.k)((()=>{T=!1,(0,w.Wn)(),(0,u.Kn)(),u.Fn||(0,w.Un)(),(0,w.Dn)($,T,u.Fn).then(w.Vn),$=0}),200)},288:function(n,t){var e=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};function o(){return e(this,arguments,void 0,(function*(n=600,t,o=0){if(document.startViewTransition)if(o>0){const i=n=>new Promise((t=>setTimeout(t,n)));document.startViewTransition((()=>e(this,void 0,void 0,(function*(){yield Promise.race([i(o)]),t&&t()})))).ready.then((()=>{document.documentElement.animate({opacity:[0,1]},{duration:n})}))}else{const e=document.startViewTransition(t),o=document.createElement("style");o.textContent=`\n ::view-transition-old(root),\n ::view-transition-new(root) {\n animation-duration: ${n}ms;\n }\n `,document.head.appendChild(o),yield e.finished,o.remove()}else t&&t()}))}Object.defineProperty(t,"__esModule",{value:!0}),t.Pn=void 0,t.Jn=function(n){return e(this,void 0,void 0,(function*(){if("mouseup"!==n.type)return;n.target.closest('[data-name="barmode"] .b3-menu__item:not([id])')&&o()}))},t.R=o,t.Pn=window.matchMedia("(prefers-color-scheme: dark)")},863:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.wn=function(n){return o(this,void 0,void 0,(function*(){let t=yield(0,i.Yn)(n);const e=u.K.status||(yield(0,i.l)("#status"));e&&e.classList.toggle("asri--non-protyle-status",!t)}))},t.jn=function(){const n=u.K.status;if(!n)return;n.classList.remove("asri--non-protyle-status")};const i=e(629),u=e(49)},832:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.hn=function(){return o(this,void 0,void 0,(function*(){if(u||c)for(let n=0;n<document.styleSheets.length;n++){let t=document.styleSheets[n];try{for(let n=0;n<t.cssRules.length;n++){let e=t.cssRules[n];e.selectorText&&e.selectorText.includes("::-webkit-scrollbar")&&(e.style.width||e.style.height||e.style.backgroundColor)&&(s.push({styleSheet:t,qn:e.cssText}),t.deleteRule(n),n--)}}catch(n){}}}))},t.Ln=function(){return o(this,void 0,void 0,(function*(){if(s)for(let n=0;n<s.length;n++){let t=s[n];t.styleSheet.insertRule(t.qn,t.styleSheet.cssRules.length)}}))};const i=e(49),{ln:u,j:c}=i.A,s=[]},844:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Rn=void 0,t.Gn=s,t.In=function(){document.querySelectorAll(".file-tree .has-focus").forEach((n=>n.classList.remove("has-focus")))};const i=e(629),u=e(49),{j:c}=u.A;function s(){return o(this,void 0,void 0,(function*(){if(c)return;u.K.Y||(yield(0,i.l)(".layout__dockl"));let n=document.querySelectorAll(".file-tree .b3-list-item--focus");n.length&&(document.querySelectorAll(".file-tree .has-focus").forEach((n=>n.classList.remove("has-focus"))),n.forEach((n=>{n.nextElementSibling&&"UL"===n.nextElementSibling.tagName&&!n.nextElementSibling.classList.contains("fn__none")||n.parentNode instanceof Element&&n.parentNode.classList.add("has-focus")})))}))}t.Rn=(0,i.k)(s)},414:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Hn=void 0,t.Qn=s,t.yn=function(){const n=(0,i.Xn)()?0:32;document.body.style.setProperty("--status-height",`${n}px`)},t.$n=function(){document.body.style.removeProperty("--status-height"),setTimeout((()=>{var n,t,e;null===(n=u.K.status)||void 0===n||n.style.removeProperty("max-width"),null===(t=u.K.status)||void 0===t||t.style.removeProperty("--asri-status-transform-x"),null===(e=u.K.status)||void 0===e||e.style.removeProperty("--asri-status-transform-y")}),200)},t.Mn=function(){var n,t;if(!(0,i.Xn)()){const e=null===(n=u.K.Zn)||void 0===n?void 0:n.querySelectorAll(".layout__center .layout-tab-container"),o=u.K.status;null==e||e.forEach((n=>{let t=n.querySelector(".file-tree");t&&!t.classList.contains("fn__none")&&(0,c.nt)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom")}));const i=document.getElementById("searchList"),s=document.getElementById("searchPreview");(i||s)&&((0,c.nt)(i,o)?i.style.paddingBottom="35px":i.style.removeProperty("padding-bottom"),(0,c.nt)(s,o)?s.style.paddingBottom="35px":s.style.removeProperty("padding-bottom"));const r=document.getElementById("viewerContainer");r&&((0,c.nt)(r,o)?r.style.paddingBottom="35px":r.style.removeProperty("padding-bottom")),null===(t=u.K.Zn)||void 0===t||t.querySelectorAll(".card__main").forEach((n=>{n&&((0,c.nt)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom"))}))}},t.Tn=function(){var n,t;null===(n=u.K.Zn)||void 0===n||n.querySelectorAll(".layout__center .layout-tab-container").forEach((n=>{n.style.removeProperty("padding-bottom")})),null===(t=u.K.Zn)||void 0===t||t.querySelectorAll(".card__main").forEach((n=>{n.style.removeProperty("padding-bottom")}));const e=document.getElementById("searchList"),o=document.getElementById("searchPreview"),i=document.getElementById("viewerContainer");for(const n of[e,o,i])n&&n.style.removeProperty("padding-bottom")};const i=e(937),u=e(49),c=e(629);function s(){return o(this,void 0,void 0,(function*(){var n,t,e;if(!u.A.j&&!u.A.tt)if(u.K.status||(yield(0,c.l)("#status")),yield(0,i.nn)())null===(n=u.K.status)||void 0===n||n.style.removeProperty("max-width"),null===(t=u.K.status)||void 0===t||t.style.removeProperty("--asri-status-transform-x"),null===(e=u.K.status)||void 0===e||e.style.removeProperty("--asri-status-transform-y");else{function o(n,t){u.K.status.style.setProperty("--asri-status-transform-x",`${n}px`),u.K.status.style.setProperty("--asri-status-transform-y",`${t}px`)}let s=(u.K.Zn||(yield(0,c.l)("#layouts"))).querySelector(".layout__center");if(s&&u.K.et&&!u.K.status.classList.contains(".fn__none")){let r=u.K.et.clientWidth,l=s.clientWidth,a=0;u.K.ot||(yield(0,c.l)(".layout__dockb")),a=u.K.ot&&!u.K.ot.classList.contains(".fn__none")&&(0,i.G)("B")?-1*u.K.ot.clientHeight:0,u.K.status.style.maxWidth=l-12+"px";let d=(0,i.it)("R"),f=!(0,i.G)("R")&&(0,i.X)("R");d&&f?o(0,a):!d&&f?o(-40,a):d||f?d&&!f&&o(-1*r,a):o(-1*(r+40),a)}}}))}t.Hn=(0,c.k)(s)},376:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.xn=y,t.Wn=function(){return o(this,void 0,void 0,(function*(){u.A.ln&&((0,c.isFullScreen)()?(document.body.classList.add("body-asri--fullscreen"),b-=p?0:88,p=!0):(document.body.classList.remove("body-asri--fullscreen"),null==r||r.style.setProperty("width","0px"),b=yield y("initials","L"),null==r||r.style.removeProperty("width"),p=!1))}))},t.Dn=function(){return o(this,arguments,void 0,(function*(n=0,t=!1,e=!1){if(u.A.tt||u.A.j)return{ut:!1,ct:0};let c=u.K.On||(yield(0,i.l)(".layout__center"));return new Promise((i=>o(this,void 0,void 0,(function*(){var o,s,l,a,d,w;t&&(v+=n),b&&v||(yield y("initials")),f=c.getBoundingClientRect(),_=u.K.st.getBoundingClientRect(),m=u.K.rt.getBoundingClientRect();let g=f.left,x=f.right,k=u.K.lt.getBoundingClientRect().left;t||(g>b+8?(null==h||h.style.setProperty("--topbar-left-spacing","0"),u.A.ln&&p||(yield y("initials","L")),null==r||r.classList.remove("asri-expanded")):u.A.ln&&!u.A.I?(h.style.setProperty("--topbar-left-spacing",g-_.right+4+"px"),null==r||r.classList.add("asri-expanded")):(h.style.setProperty("--topbar-left-spacing",g-m.right+4+"px"),null==r||r.classList.add("asri-expanded")),x<v-8&&!e?(h.style.setProperty("--topbar-right-spacing","0"),yield y("initials","R"),null===(o=u.K.q)||void 0===o||o.style.removeProperty("--avoid-topbar"),null===(s=u.K.et)||void 0===s||s.style.removeProperty("--avoid-topbar")):u.A.ln||u.A.I?(h.style.setProperty("--topbar-right-spacing",window.innerWidth-x+1+"px"),null===(l=u.K.q)||void 0===l||l.style.setProperty("--avoid-topbar","4px"),null===(a=u.K.et)||void 0===a||a.style.setProperty("--avoid-topbar","4px")):(h.style.setProperty("--topbar-right-spacing",k-x+6+"px"),null===(d=u.K.q)||void 0===d||d.style.setProperty("--avoid-topbar","calc(var(--toolbar-height) - 6px)"),null===(w=u.K.et)||void 0===w||w.style.setProperty("--avoid-topbar","calc(var(--toolbar-height) - 6px)"))),i({ut:!0,ct:x})}))))}))},t.Vn=function(){return o(this,arguments,void 0,(function*({ut:n,ct:t}={ut:!1,ct:0}){var e,r;n&&(a=null===(e=u.K.toolbar)||void 0===e?void 0:e.getBoundingClientRect(),yield y("rect"),f=null===(r=u.K.On)||void 0===r?void 0:r.getBoundingClientRect(),(s||(s=document.getElementById("AsriPluginsIconsDivider")))&&(t<v-8?(s.style.setProperty("--container-bg","var(--b3-border-color-trans))"),s.style.left=t+"px",s.style.right="0",s.style.removeProperty("height"),s.style.removeProperty("top"),s.style.removeProperty("width")):(s.style.setProperty("--container-bg","var(--b3-border-color-trans)"),s.style.left=d.right-10+"px",s.style.width="2px",s.style.height="21px",s.style.top="13.5px")),null===c.h||void 0===c.h||c.h.forEach((n=>o(this,void 0,void 0,(function*(){let t,e=n.querySelector('.fn__flex-column[data-type="wnd"] > .fn__flex:first-child');if(e.classList.contains("fn__none")&&(e=yield(0,i.l)('.fn__flex-column[data-type="wnd"] > .fn__flex:first-child:not(.fn__none)',n,3)),t=null==e?void 0:e.getBoundingClientRect(),!t)return;let o=t.left<d.left?d.left-t.left-4:0,c=t.right>d.right?t.right-d.right+8:0;(0,i.nt)(e,u.K.dt)||(0,i.nt)(e,u.K.toolbar)?(e.style.paddingLeft=o+"px",e.style.paddingRight=c+"px",t.right-c-240<d.left&&t.left<d.left||t.left+o+240>d.right&&t.right>d.right?(e.style.paddingTop="42px",e.style.paddingLeft="0",e.style.paddingRight="0"):e.style.removeProperty("padding-top")):(e.style.removeProperty("padding-left"),e.style.removeProperty("padding-right"),e.style.removeProperty("padding-top"))})))))}))},t.Cn=function(){return o(this,void 0,void 0,(function*(){var n,t;yield(0,c.gn)(),function(){s&&s.remove();r&&(r.remove(),r=void 0);l&&(l.remove(),l=void 0)}(),null===c.h||void 0===c.h||c.h.forEach((n=>{let t=n.firstElementChild;t.style.removeProperty("padding-top"),t.style.removeProperty("padding-left"),t.style.removeProperty("padding-right")})),u.K.On.dataset.En=void 0,document.body.dataset.En=void 0,null===(n=u.K.q)||void 0===n||n.style.removeProperty("--avoid-topbar"),null===(t=u.K.et)||void 0===t||t.style.removeProperty("--avoid-topbar")}))},t.kn=function(){if(u.A.j)return;s=w("AsriPluginsIconsDivider",void 0,u.K.dt),r=u.A.ln&&!u.A.I?w("AsriTopbarLeftSpacing",void 0,u.K.st):w("AsriTopbarLeftSpacing",void 0,u.K.rt),l=u.A.ln||u.A.I?w("AsriTopbarRightSpacing"):w("AsriTopbarRightSpacing",u.K.lt);const n=document.createElementNS("http://www.w3.org/2000/svg","svg");null==l||l.appendChild(n.cloneNode(!0)),null==s||s.appendChild(n.cloneNode(!0)),null==r||r.appendChild(n.cloneNode(!0))},t.Un=function(){return o(this,void 0,void 0,(function*(){r&&l&&(r.style.setProperty("width","0px"),l.style.setProperty("width","0px"),yield y("initials"),r.style.removeProperty("width"),l.style.removeProperty("width"))}))};const i=e(629),u=e(49),c=e(937);let s,r,l,a,d,f,m,_,b,v,h=u.K.toolbar,p=!1;function y(){return o(this,arguments,void 0,(function*(n="rect",...t){const e=u.K.dt||(yield(0,i.l)("#drag"));return!e||u.A.tt?-1:new Promise((o=>{"initials"===n?(t.length&&!t.includes("L")||(b=e.getBoundingClientRect().left,o(b)),t.length&&!t.includes("R")||(v=e.getBoundingClientRect().right,o(v))):(d=e.getBoundingClientRect(),o(d))}))}))}function w(n,t=void 0,e=void 0){if(document.getElementById(n))return;if(!u.K.toolbar)return;let o=document.createElement("div");return o.id=n,t?u.K.toolbar.insertBefore(o,t):e?u.K.toolbar.insertBefore(o,e.nextSibling):u.K.toolbar.appendChild(o),o}},130:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pn=function(){i.A.ln&&(i.A.I||u(16),i.A.tt&&u(14))},t.Nn=function(){i.A.ln&&(i.A.I||u(8),i.A.tt&&u(8,13))};const o=e(571),i=e(49);function u(n,t=n){o.remote&&o.remote.getCurrentWindow().setWindowButtonPosition({x:n,y:t})}},613:function(n,t){var e=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};function o(n){return e(this,void 0,void 0,(function*(){let t=yield n;return 0===t.code?t.data:null}))}function i(n,t){return e(this,void 0,void 0,(function*(){let e=null;return yield fetch(n,{body:JSON.stringify(t),method:"POST",headers:{Authorization:"Token "}}).then((function(n){e=n.json()})),e}))}Object.defineProperty(t,"__esModule",{value:!0}),t.getFile=function(n){return e(this,void 0,void 0,(function*(){const t=yield fetch("/api/file/getFile",{method:"POST",headers:{Authorization:"Token ''"},body:JSON.stringify({path:n})});return t.ok?t:null}))},t.B=function(n,t){return e(this,arguments,void 0,(function*(n,t,e=!1,o=Date.now()){let i=new Blob([t]),u=n.split("/").pop(),c=new File([i],u),s=new FormData;s.append("path",n),s.append("file",c),s.append("isDir",String(e)),s.append("modTime",String(o));const r=yield fetch("/api/file/putFile",{body:s,method:"POST",headers:{Authorization:"Token ''"}});return r.ok?yield r.json():null}))},t._=function(n,t){return e(this,void 0,void 0,(function*(){return o(i("/api/attr/setBlockAttrs",{id:n,attrs:t}))}))},t.m=function(n){return e(this,void 0,void 0,(function*(){return o(i("/api/attr/getBlockAttrs",{id:n}))}))}},571:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.remote=void 0;const o=e(49);t.remote=o.A.I||o.A.j?null:e(21)},796:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.V=void 0;t.V=class{constructor(n){this.ft=n}start(n,t,e=!1){n.addEventListener(t,this.ft,e)}remove(n,t,e=!1){n.removeEventListener(t,this.ft,e)}}},937:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.h=t._t=t.Fn=void 0,t.Kn=s,t.G=function(n){const t="B"===n?c.K.ot:"L"===n?c.K.Y:c.K.et;return!(!t||t.classList.contains("layout--float"))},t.X=function(n){const t="B"===n?c.K.ot:"L"===n?c.K.Y:c.K.et;let e;if(!t)return!1;e="B"===n?t.style.height:t.style.width;return!(!e||"0px"===e)},t.it=function(n="L"){const t="B"===n?c.K.tn:"L"===n?c.K.W:c.K.q;return!(!t||!t.classList.contains("fn__none"))},t.nn=function(){return o(this,void 0,void 0,(function*(){return c.K.tn||(yield(0,u.l)(".layout__dockb")),!(!c.K.tn||c.K.tn.classList.contains("fn__none"))}))},t.isFullScreen=function(){return!(!i.remote||!i.remote.getCurrentWindow().isFullScreen())},t.Xn=function(){return!(!c.K.status||!c.K.status.classList.contains("fn__none"))},t.gn=function(){return o(this,void 0,void 0,(function*(){return yield(0,u.bt)('.layout__center [data-type="wnd"]').then((n=>{t.h=n})),t.h}))};const i=e(571),u=e(629),c=e(49);function s(){var n,e;c.K.toolbar&&(t.Fn=(null===(n=c.K.toolbar)||void 0===n?void 0:n.scrollWidth)>c.K.toolbar.clientWidth,(null===(e=c.K.vt)||void 0===e?void 0:e.classList.contains("fn__none"))||(t.Fn=!0))}t.Fn=!1,t._t=(0,u.k)(s),t.h=document.querySelectorAll('.layout__center [data-type="wnd"]')},629:function(n,t){var e=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{r(o.next(n))}catch(n){u(n)}}function s(n){try{r(o.throw(n))}catch(n){u(n)}}function r(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}r((o=o.apply(n,t||[])).next())}))};function o(n,t){let e=!1;return n&&t&&(e=n.right>t.left&&n.bottom>t.top&&n.left<t.left+t.width&&n.top<t.top+t.height),e}function i(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,o=200){let i=0;for(;i<e;){const e=t.querySelector(n);if(e)return e;yield new Promise((n=>setTimeout(n,o))),i++}}))}Object.defineProperty(t,"__esModule",{value:!0}),t.ht=function(n,t){n.includes(t)||n.push(t)},t.k=function(n,t=200){let e=null;return(...o)=>{e&&clearTimeout(e),e=setTimeout((()=>{n(...o),e=null}),t)}},t.D=function(n){if(!n)return;const t=parseInt(n.substring(1,3),16)/255,e=parseInt(n.substring(3,5),16)/255,o=parseInt(n.substring(5,7),16)/255,i=Math.max(t,e,o),u=Math.min(t,e,o),c=(i+u)/2;if(i===u)return{yt:0,s:0,wt:c};let s=0;const r=i-u,l=c>.5?r/(2-i-u):r/(i+u);switch(i){case t:s=(e-o)/r+(e<o?6:0);break;case e:s=(o-t)/r+2;break;case o:s=(t-e)/r+4}return s/=6,{yt:s,s:l,wt:c}},t.F=function(n){if(!n)return;4===(n=n.replace(/^#/,"")).length?n.substring(0,3):8===n.length&&n.substring(0,6);3===n.length&&(n=n.split("").map((function(n){return n+n})).join(""));let t=parseInt(n.slice(0,2),16)/255,e=parseInt(n.slice(2,4),16)/255,o=parseInt(n.slice(4,6),16)/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,o=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92;let i=.4124564*t+.3575761*e+.1804375*o,u=.2126729*t+.7151522*e+.072175*o,c=.0193339*t+.119192*e+.9503041*o,s=.8189330101*i+.3618667424*u-.1288597137*c,r=.0329845436*i+.9293118715*u+.0361456387*c,l=.0482003018*i+.2643662691*u+.633851707*c;return s=Math.cbrt(s),r=Math.cbrt(r),l=Math.cbrt(l),.2104542553*s+.793617785*r-.0040720468*l},t.nt=function(n,t){if(!n||!t)return!1;let e,i;e=n.getBoundingClientRect(),i=t.getBoundingClientRect();return o(e,i)},t.gt=function(n,t){return e(this,void 0,void 0,(function*(){return!(!n||!t)&&new Promise((e=>{let i,u;i=n.getBoundingClientRect(),u=t.getBoundingClientRect();e(o(i,u))}))}))},t.xt=function(n,t){if(!n.length||!t.length)return!1;const e=new Set(n),o=new Set(t);if(e.size!==o.size)return!1;for(const n of e)if(!o.has(n))return!1;return!0},t.l=i,t.bt=function(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,o=200){let i=0;for(;i<e;){const e=t.querySelectorAll(n);if(e.length>0)return e;yield new Promise((n=>setTimeout(n,o))),i++}}))},t.Yn=function(n){return e(this,void 0,void 0,(function*(){var t;if(!n){const e=yield i(".layout__center .layout-tab-bar .item--focus");n=null!==(t=null==e?void 0:e.getAttribute("data-id"))&&void 0!==t?t:void 0}const e=document.querySelector(`.layout__center .layout-tab-container>[data-id="${n}"]:not(.fn__none)`);return!e||e.classList.contains("protyle")}))}},766:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sn=t.Bn=t.zn=void 0;t.zn=class{constructor(n){this.ft=(t,e)=>n(t,e),this.kt=new ResizeObserver(this.ft)}observe(n,t){this.kt.observe(n,t)}disconnect(n){this.kt.disconnect(),n&&n()}unobserve(n){this.kt.unobserve(n)}};t.Bn=class{constructor(n){this.ft=(t,e)=>n(t,e),this.Mt=new MutationObserver(this.ft)}observe(n,t){this.Mt.observe(n,t)}disconnect(n){this.Mt.disconnect(),n&&n()}},t.Sn={attributes:!0,subtree:!0,attributeFilter:["class"],attributeOldValue:!0}},49:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.A=t.K=void 0;const e=navigator.userAgent;let o=null,i=null,u=null,c=null,s=null,r=null,l=null,a=null,d=null,f=null,m=null,_=null,b=null,v=null,h=null,p=null,y=null,w=null;t.K={get Zn(){return null!=o?o:o=document.getElementById("layouts")},get On(){return null!=i?i:i=document.querySelector(".layout__center")},get toolbar(){return null!=u?u:u=document.getElementById("toolbar")},get W(){return null!=c?c:c=document.getElementById("dockLeft")},get q(){return null!=s?s:s=document.getElementById("dockRight")},get tn(){return null!=r?r:r=document.getElementById("dockBottom")},get status(){return null!=l?l:l=document.getElementById("status")},get Y(){return null!=a?a:a=document.querySelector(".layout__dockl")},get et(){return null!=d?d:d=document.querySelector(".layout__dockr")},get ot(){return null!=f?f:f=document.querySelector(".layout__dockb")},get st(){return null!=m?m:m=document.getElementById("barSync")},get rt(){return null!=_?_:_=document.getElementById("barForward")},get St(){return null!=b?b:b=document.getElementById("toolbarVIP")},get dt(){return null!=v?v:v=document.getElementById("drag")},get Pt(){return null!=h?h:h=document.getElementById("barPlugins")},get lt(){return null!=p?p:p=document.getElementById("barSearch")},get Ot(){return null!=y?y:y=document.getElementById("barMode")},get vt(){return null!=w?w:w=document.getElementById("barMore")}},t.A={ln:navigator.platform.indexOf("Mac")>-1,T:navigator.platform.indexOf("Linux")>-1,an:/Android/.test(e),j:!!document.getElementById("sidebar"),I:!e.startsWith("SiYuan")||e.indexOf("iPad")>-1||/Android/.test(e)&&!/(?:Mobile)/.test(e),tt:document.body.classList.contains("body--window"),dn:(/iOS/i.test(e)||/iPad/i.test(e))&&/AppleWebKit/i.test(e)&&e.startsWith("SiYuan/"),lang:window.siyuan.config.lang,C:CSS.supports("color","oklch(from red calc(l * 0.5) 0 h)"),fn:window.siyuan.config.readonly,O:window.siyuan.config.appearance.mode>0?"dark":"light",mn:/^((?!chrome|android).)*safari/i.test(e)}},21:n=>{n.exports=require("@electron/remote")}},t={};function e(o){var i=t[o];if(void 0!==i)return i.exports;var u=t[o]={exports:{}};return n[o].call(u.exports,u,u.exports,e),u.exports}(()=>{const n=e(2);(0,n.vn)(),window.destroyTheme=()=>{let t=!0;setTimeout((()=>{const e=window.siyuan.config.appearance.themeLight,o=window.siyuan.config.appearance.themeDark;"Asri"===e&&"Asri"===o&&(t=!1),(0,n.An)(t)}),0)}})()})();