generated from siyuan-note/theme-sample
-
Notifications
You must be signed in to change notification settings - Fork 5
/
theme.js
1 lines (1 loc) · 44 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,v=r.includes(m)?m:_;if(!v)return;const b="doc"===v?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)}))}(v,b)}))},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(216),s=e(787);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)}))}},787: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.followSysAccentColor=t.M=void 0,t.S=function(){return o(this,void 0,void 0,(function*(){t.M=yield p(),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;n?(t.followSysAccentColor=!!n.followSysAccentColor,l.followSysAccentColor=t.followSysAccentColor,l.chroma=null!==(e=n.chroma)&&void 0!==e?e:"1",l.userCustomColor=null!==(o=n.userCustomColor)&&void 0!==o?o:"#3478f6"):t.followSysAccentColor=l.followSysAccentColor}))}))}().then((()=>{s.P.O&&(s.P.I||s.P.j||s.P.T?(document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),I(l.userCustomColor)):t.followSysAccentColor?document.documentElement.style.removeProperty("--asri-user-custom-accent"):(document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),I(l.userCustomColor)),document.documentElement.style.setProperty("--asri-c-factor",l.chroma),h="0"===l.chroma,O(l.chroma),S())}))}))},t.A=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=p,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 p());if(!n.target.closest(".toolbar__item"))return;if(document.querySelector(".asri-config"))return;let i=yield(0,c.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 <button class="b3-menu__item asri-config" id="pickColor">\n <svg class="b3-menu__icon"></svg>\n <input id="asriColorPicker" type="color" value="${l.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==_?void 0:_.value)&&void 0!==e?e:l.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`,r=document.createRange().createContextualFragment(u);i.appendChild(r),f=document.getElementById("followSysAccent"),m=document.getElementById("pickColor"),_=document.getElementById("asriChromaSlider"),v=m.querySelector("input"),f&&m&&_&&v&&(f.classList.toggle("b3-menu__item--selected",t.followSysAccentColor),m.classList.toggle("b3-menu__item--selected",!t.followSysAccentColor),_.value=l.chroma||"1",_.parentElement.ariaLabel=t.M.asriChroma+l.chroma,function(){if(!(f&&m&&_&&v))return;s.P.I||s.P.j||s.P.T?f.classList.add("fn__none"):f.addEventListener("click",w);m.addEventListener("click",g),v.addEventListener("input",x),v.addEventListener("change",k),_.addEventListener("input",M)}())}))},t.N=S;const i=e(613),u=e(571),c=e(629),s=e(49),r=e(288),l={followSysAccentColor:!1,chroma:"1",userCustomColor:"#3478f6"},a=(0,c.k)((()=>y()),200);let d,f,m,_,v,b=!1,h=!1;function p(){return o(this,void 0,void 0,(function*(){let n;try{return n=["zh_CN","zh_CHT","en_US"].includes(s.P.lang)?yield fetch(`/appearance/themes/Asri/i18n/${s.P.lang}.json`):yield fetch("/appearance/themes/Asri/i18n/en_US.json"),t.M=yield n.json(),t.M}catch(n){throw n}}))}function y(){return o(this,void 0,void 0,(function*(){yield(0,i.R)("/data/snippets/Asri.config.json",JSON.stringify(l,void 0,4))}))}function w(){(0,r.C)((function(){t.followSysAccentColor?(t.followSysAccentColor=!1,f.classList.remove("b3-menu__item--selected"),m.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor||d||"#3478f6"),O(l.chroma),I(l.userCustomColor||d||"#3478f6"),l.followSysAccentColor=!1):(t.followSysAccentColor=!0,f.classList.add("b3-menu__item--selected"),m.classList.remove("b3-menu__item--selected"),document.documentElement.style.removeProperty("--asri-user-custom-accent"),l.followSysAccentColor=!0,S());y()}))}function g(){(0,r.C)((function(){if(!t.followSysAccentColor)return;t.followSysAccentColor=!1,f.classList.remove("b3-menu__item--selected"),m.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),O(l.chroma),I(l.userCustomColor),l.userCustomColor=l.userCustomColor,l.followSysAccentColor=!1,y()}))}function x(){const n=v.value;document.documentElement.style.setProperty("--asri-user-custom-accent",n),I(n)}function k(){f.classList.remove("b3-menu__item--selected"),m.classList.add("b3-menu__item--selected"),I(v.value),l.userCustomColor=v.value,t.followSysAccentColor=!1,l.followSysAccentColor=!1,y()}function M(){const n=this.value;document.documentElement.style.setProperty("--asri-c-factor",n),this.parentElement.ariaLabel=t.M.asriChroma+n,l.chroma=n,h="0"===n,O(n),a()}function S(){if(!(s.P.I||s.P.j||s.P.T)){const n="#"+u.remote.systemPreferences.getAccentColor().slice(0,6),e=(0,c.$)(n);if(!e)return;d!==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"),b=0===e.s,document.body.classList.add("asri-mode-transition"),setTimeout((()=>{document.body.classList.remove("asri-mode-transition")}),350),d=n),t.followSysAccentColor&&(O(e.s),I(n))}}function O(n){return"0"===String(n)||t.followSysAccentColor&&b||h?(document.documentElement.style.setProperty("--asri-c-0","0"),!0):(document.documentElement.style.removeProperty("--asri-c-0"),!1)}t.followSysAccentColor=!1;const P="light"===s.P.B?.81:.79;function I(n){const t=(0,c.F)(n);t&&(t>P?document.documentElement.style.setProperty("--asri-on-primary-reverse","light"===s.P.B?".4":".3"):document.documentElement.style.removeProperty("--asri-on-primary-reverse"))}},344:(n,t)=>{function e(){document.body.classList.toggle("has-exportimg",!!document.querySelector('[data-key="dialog-exportimage"]'))}Object.defineProperty(t,"__esModule",{value:!0}),t.D=function(n,t){e()},t.V=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.H=function(){return o(this,void 0,void 0,(function*(){const n=u.U.J?u.U.J:yield(0,i.l)("#dockLeft");u.U.W||(yield(0,i.l)(".layout__dockl"));const t=u.U.K;for(let e of[n,t]){let t=(0,c.Y)(e===n?"L":"R"),o=(0,c.q)(e===n?"L":"R");t&&o?null==e||e.classList.add("dock-layout-expanded"):null==e||e.classList.remove("dock-layout-expanded")}}))},t.G=function(){return o(this,void 0,void 0,(function*(){var n,t,e;if(u.P.j)return;const o=yield(0,c.X)(),i=!(0,c.Y)("B")&&(0,c.q)("B");null===(n=u.U.toolbar)||void 0===n||n.nextElementSibling.classList.toggle("has-dockb",o),null===(t=u.U.toolbar)||void 0===t||t.nextElementSibling.classList.toggle("has-layout-dockb-float",i),null===(e=u.U.Z)||void 0===e||e.classList.toggle("has-layout-dockb-float",i)}))},t.nn=function(){var n,t;null===(n=u.U.toolbar)||void 0===n||n.nextElementSibling.classList.remove("has-dockb"),null===(t=u.U.toolbar)||void 0===t||t.nextElementSibling.classList.remove("has-layout-dockb-float")},t.tn=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(216)},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.en=void 0,t.un=u,t.cn=function(){document.querySelectorAll(".protyle .protyle-background.without-icon").forEach((n=>{n.classList.remove("without-icon")}))};const i=e(629);function u(){return o(this,void 0,void 0,(function*(){let n=yield(0,i.sn)(".protyle-top>.protyle-background");null==n||n.forEach((n=>{var t;!(null===(t=n.querySelector(".protyle-background__img img"))||void 0===t?void 0:t.classList.contains("fn__none"))&&n.querySelector(".protyle-background__icon.fn__none")?n.classList.add("without-icon"):n.classList.remove("without-icon")}))}))}t.en=(0,i.k)(u)},261:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.rn=function(){i.forEach((({ln:n,className:t})=>{n&&document.body.classList.add(t)}))},t.an=function(){i.forEach((({className:n})=>{document.body.classList.remove(n)}))};const o=e(49),i=[{ln:o.P.dn,className:"body-asri--mac"},{ln:o.P.T,className:"body-asri--linux"},{ln:o.P.j,className:"body-asri--mobile"},{ln:o.P.I,className:"body-asri--browser"},{ln:o.P.fn,className:"body-asri--android"},{ln:o.P.mn,className:"body-asri--iosApp"},{ln:o.P._n,className:"body-asri--readOnly"},{ln:o.P.vn,className:"body-asri--safari"}]},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.bn=t.hn=t.pn=void 0,t.yn=function(){return o(this,void 0,void 0,(function*(){(0,_.rn)(),(0,b.wn)(),(0,w.gn)(),(0,p.xn)(),(0,a.S)(),s.P.j||(yield(0,r.kn)(),yield(0,y.Mn)("initials"),(0,y.Sn)()),L(),(0,f.G)(),(0,p.On)(),g.start(document,"mouseup"),x.start(document,"dragend"),k.start(document,"keyup"),M.start(window,"focus"),M.start(window,"blur"),S.start(document,"selectionchange"),P.observe(document.body,c.Pn),O.observe(document.body,{childList:!0}),T.start(v.In,"change"),s.U.jn||(yield(0,u.l)(".layout__center")),s.P.j||(I.observe(s.U.jn),j.observe(document.body))}))},t.Tn=function(){return o(this,void 0,void 0,(function*(){(0,_.an)(),(0,b.An)(),(0,w.Ln)(),(0,p.Nn)(),s.P.j||(yield(0,y.Rn)()),(0,f.tn)(),(0,h.Cn)(),(0,m.cn)(),(0,l.v)(),(0,f.nn)(),(0,p.$n)(),g.remove(document,"mouseup"),x.remove(document,"dragend"),k.remove(document,"keyup"),M.remove(window,"focus"),M.remove(window,"blur"),S.remove(document,"selectionchange"),P.disconnect(),T.remove(v.In,"change"),O.disconnect((()=>{document.body.classList.remove("has-exportimg")})),document.body.classList.remove("body-asri--fullscreen"),s.P.j||(I.disconnect(),j.disconnect()),(0,a.A)()}))};const i=e(796),u=e(629),c=e(766),s=e(49),r=e(216),l=e(12),a=e(787),d=e(344),f=e(818),m=e(937),_=e(261),v=e(288),b=e(832),h=e(844),p=e(414),y=e(376),w=e(130),g=new i.Bn(A),x=new i.Bn(A),k=new i.Bn(A),M=new i.Bn((function(n){(0,r.kn)().then((()=>{L(),!s.P.mn&&a.followSysAccentColor&&s.P.O&&(0,a.N)()}))})),S=new i.Bn((function(n){const t=window.getSelection(),e=t&&t.rangeCount>0?t.getRangeAt(0):null;if(!e)return;const o=e.commonAncestorContainer,i=o.parentElement?o.parentElement.closest("[data-node-id]"):null;if(!i)return;const u=i.getAttribute("data-type");if(document.querySelectorAll(".asri-selected-block").forEach((n=>n.classList.remove("asri-selected-block"))),"NodeAttributeView"===u||!u||"NodeCodeBlock"===u)return;i.classList.add("asri-selected-block")})),O=new c.zn((0,u.k)(d.D)),P=new c.zn((function(n,t){for(let t of n){if(t.target.classList.contains("body--blur"))return;t.target.classList.contains("b3-list-item--focus")&&((0,h.Fn)(),(0,m.en)())}})),I=new c.Dn((function(n,e){(0,y.Vn)(0,t.pn,r.Hn).then(y.En),(0,l.t)(),(0,p.Jn)()})),j=new c.Dn((function(n,e){for(let e of n){t.pn=!0,N();const{inlineSize:n}=e.contentBoxSize[0];if(e.target instanceof HTMLElement){if(!e.target.dataset.Un){e.target.dataset.Un=n+"";continue}const o=n-parseFloat(e.target.dataset.Un);e.target.dataset.Un=n+"",t.bn=o}}})),T=new i.Bn((function(n){(0,v.C)((()=>{}),200)}));function A(n){(0,a.L)(n),(0,l.i)(n),L(n),(0,v.Wn)(n)}function L(n){return o(this,void 0,void 0,(function*(){function t(){setTimeout((()=>o(this,void 0,void 0,(function*(){(0,f.H)(),(0,m.en)(),(0,p.Jn)(),(0,p.xn)(),yield(0,r.kn)(),(0,l.o)(),(0,f.G)(),(0,p.On)(),!s.P.mn&&a.followSysAccentColor&&s.P.O&&(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,y.Kn)(),(0,y.Vn)(0,!1,r.Hn).then(y.En)}),0)):(t(),(0,y.Vn)().then(y.En))}))}t.pn=!1,t.bn=0;const N=(0,u.k)((()=>{t.pn=!1,(0,y.Yn)(),(0,r.qn)(),r.Hn||(0,y.Kn)(),(0,y.Vn)(t.bn,t.pn,r.Hn).then(y.En),t.bn=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(n){return e(this,arguments,void 0,(function*(n,t=0){if(document.startViewTransition)if(t>0){const o=n=>new Promise((t=>setTimeout(t,n)));document.startViewTransition((()=>e(this,void 0,void 0,(function*(){yield Promise.race([o(t)]),n&&n()})))).ready.then((()=>{document.documentElement.animate({opacity:[0,1]},{duration:500,Gn:"ease-in-out"})}))}else document.startViewTransition(n);else n&&n()}))}Object.defineProperty(t,"__esModule",{value:!0}),t.In=void 0,t.Wn=function(n){return e(this,void 0,void 0,(function*(){n.target.closest('[data-name="barmode"] .b3-menu__item:not([id])')&&o((()=>{}))}))},t.C=o,t.In=window.matchMedia("(prefers-color-scheme: dark)")},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.wn=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.An=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),{dn:u,j:c}=i.P,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.Fn=void 0,t.Xn=s,t.Cn=function(){document.querySelectorAll(".file-tree .has-focus").forEach((n=>n.classList.remove("has-focus")))};const i=e(629),u=e(49),{j:c}=u.P;function s(){return o(this,void 0,void 0,(function*(){if(c)return;u.U.W||(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.Fn=(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.Jn=void 0,t.Zn=s,t.xn=function(){const n=(0,i.nt)()?0:32;document.body.style.setProperty("--status-height",`${n}px`)},t.Nn=function(){document.body.style.removeProperty("--status-height"),setTimeout((()=>{var n,t;null===(n=document.getElementById("status"))||void 0===n||n.style.removeProperty("max-width"),null===(t=document.getElementById("status"))||void 0===t||t.style.removeProperty("transform")}),200)},t.On=function(){var n,t;if(!(0,i.nt)()){const e=null===(n=u.U.tt)||void 0===n?void 0:n.querySelectorAll(".layout__center .layout-tab-container"),o=u.U.status;null==e||e.forEach((n=>{let t=n.querySelector(".file-tree");t&&!t.classList.contains("fn__none")&&(0,c.et)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom")}));const i=document.getElementById("searchList"),s=document.getElementById("searchPreview");(i||s)&&((0,c.et)(i,o)?i.style.paddingBottom="35px":i.style.removeProperty("padding-bottom"),(0,c.et)(s,o)?s.style.paddingBottom="35px":s.style.removeProperty("padding-bottom"));const r=document.getElementById("viewerContainer");r&&((0,c.et)(r,o)?r.style.paddingBottom="35px":r.style.removeProperty("padding-bottom")),null===(t=u.U.tt)||void 0===t||t.querySelectorAll(".card__main").forEach((n=>{n&&((0,c.et)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom"))}))}},t.$n=function(){var n,t;null===(n=u.U.tt)||void 0===n||n.querySelectorAll(".layout__center .layout-tab-container").forEach((n=>{n.style.removeProperty("padding-bottom")})),null===(t=u.U.tt)||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(216),u=e(49),c=e(629);function s(){return o(this,void 0,void 0,(function*(){var n,t;if(!u.P.j&&!u.P.ot)if(u.U.status||(yield(0,c.l)("#status")),yield(0,i.X)())null===(n=u.U.status)||void 0===n||n.style.removeProperty("max-width"),null===(t=u.U.status)||void 0===t||t.style.removeProperty("transform");else{function e(n,t){u.U.status.style.transform=`translate(${n}px, ${t}px)`}let o=(u.U.tt||(yield(0,c.l)("#layouts"))).querySelector(".layout__center");if(o&&u.U.it&&!u.U.status.classList.contains(".fn__none")){let s=u.U.it.clientWidth,r=o.clientWidth,l=0;u.U.ut||(yield(0,c.l)(".layout__dockb")),l=u.U.ut&&!u.U.ut.classList.contains(".fn__none")&&(0,i.Y)("B")?-1*u.U.ut.clientHeight:0,u.U.status.style.maxWidth=r-12+"px";let a=(0,i.ct)("R"),d=!(0,i.Y)("R")&&(0,i.q)("R");a&&d?e(0,l):!a&&d?e(-40,l):a||d?a&&!d&&e(-1*s,l):e(-1*(s+40),l)}}}))}t.Jn=(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.Mn=y,t.Yn=function(){return o(this,void 0,void 0,(function*(){u.P.dn&&((0,c.isFullScreen)()?(document.body.classList.add("body-asri--fullscreen"),v-=p?0:88,p=!0):(document.body.classList.remove("body-asri--fullscreen"),null==r||r.style.setProperty("width","0px"),v=yield y("initials","L"),null==r||r.style.removeProperty("width"),p=!1))}))},t.Vn=function(){return o(this,arguments,void 0,(function*(n=0,t=!1,e=!1){if(u.P.ot||u.P.j)return{st:!1,rt:0};let c=u.U.jn||(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&&(b+=n),v&&b||(yield y("initials")),f=c.getBoundingClientRect(),_=u.U.lt.getBoundingClientRect(),m=u.U.dt.getBoundingClientRect();let g=f.left,x=f.right,k=u.U.ft.getBoundingClientRect().left;t||(g>v+8?(null==h||h.style.setProperty("--topbar-left-spacing","0"),u.P.dn&&p||(yield y("initials","L")),null==r||r.classList.remove("asri-expanded")):u.P.dn&&!u.P.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<b-8&&!e?(h.style.setProperty("--topbar-right-spacing","0"),yield y("initials","R"),null===(o=u.U.K)||void 0===o||o.style.removeProperty("--avoid-topbar"),null===(s=u.U.it)||void 0===s||s.style.removeProperty("--avoid-topbar")):u.P.dn||u.P.I?(h.style.setProperty("--topbar-right-spacing",window.innerWidth-x+1+"px"),null===(l=u.U.K)||void 0===l||l.style.setProperty("--avoid-topbar","4px"),null===(a=u.U.it)||void 0===a||a.style.setProperty("--avoid-topbar","4px")):(h.style.setProperty("--topbar-right-spacing",k-x+6+"px"),null===(d=u.U.K)||void 0===d||d.style.setProperty("--avoid-topbar","calc(var(--toolbar-height) - 6px)"),null===(w=u.U.it)||void 0===w||w.style.setProperty("--avoid-topbar","calc(var(--toolbar-height) - 6px)"))),i({st:!0,rt:x})}))))}))},t.En=function(){return o(this,arguments,void 0,(function*({st:n,rt:t}={st:!1,rt:0}){var e,r;n&&(a=null===(e=u.U.toolbar)||void 0===e?void 0:e.getBoundingClientRect(),yield y("rect"),f=null===(r=u.U.jn)||void 0===r?void 0:r.getBoundingClientRect(),s&&(t<b-8?(s.style.setProperty("--container-bg","var(--b3-list-hover)"),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.et)(e,u.U._t)||(0,i.et)(e,u.U.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.Sn=function(){return o(this,void 0,void 0,(function*(){!function(){if(u.P.j)return;s=w("AsriPluginsIconsDivider",void 0,u.U._t),r=u.P.dn&&!u.P.I?w("AsriTopbarLeftSpacing",void 0,u.U.lt):w("AsriTopbarLeftSpacing",void 0,u.U.dt),l=u.P.dn||u.P.I?w("AsriTopbarRightSpacing"):w("AsriTopbarRightSpacing",u.U.ft);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.Rn=function(){return o(this,void 0,void 0,(function*(){var n,t;yield(0,c.kn)(),function(){s&&(s.remove(),s=void 0);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.U.jn.dataset.Un=void 0,document.body.dataset.Un=void 0,null===(n=u.U.K)||void 0===n||n.style.removeProperty("--avoid-topbar"),null===(t=u.U.it)||void 0===t||t.style.removeProperty("--avoid-topbar")}))},t.Kn=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(216);let s,r,l,a,d,f,m,_,v,b,h=u.U.toolbar,p=!1;function y(){return o(this,arguments,void 0,(function*(n="rect",...t){const e=u.U._t||(yield(0,i.l)("#drag"));return!e||u.P.ot?-1:new Promise((o=>{"initials"===n?(t.length&&!t.includes("L")||(v=e.getBoundingClientRect().left,o(v)),t.length&&!t.includes("R")||(b=e.getBoundingClientRect().right,o(b))):(d=e.getBoundingClientRect(),o(d))}))}))}function w(n,t=void 0,e=void 0){if(document.getElementById(n))return;if(!u.U.toolbar)return;let o=document.createElement("div");return o.id=n,t?u.U.toolbar.insertBefore(o,t):e?u.U.toolbar.insertBefore(o,e.nextSibling):u.U.toolbar.appendChild(o),o}},130:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.gn=function(){i.P.dn&&(i.P.I||u(16),i.P.ot&&u(14))},t.Ln=function(){i.P.dn&&(i.P.I||u(8),i.P.ot&&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.R=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.P.I||o.P.j?null:e(21)},796:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Bn=void 0;t.Bn=class{constructor(n){this.vt=n}start(n,t,e){n.addEventListener(t,this.vt,e)}remove(n,t,e){n.removeEventListener(t,this.vt,e)}}},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}Object.defineProperty(t,"__esModule",{value:!0}),t.bt=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.$=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{ht:0,s:0,yt: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,{ht:s,s:l,yt: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.et=function(n,t){if(!n||!t)return!1;let e,i;e=n.getBoundingClientRect(),i=t.getBoundingClientRect();return o(e,i)},t.wt=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.gt=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=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.querySelector(n);if(e)return e;yield new Promise((n=>setTimeout(n,o))),i++}}))},t.sn=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++}}))}},766:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Pn=t.zn=t.Dn=void 0;t.Dn=class{constructor(n){this.vt=(t,e)=>n(t,e),this.xt=new ResizeObserver(this.vt)}observe(n,t){this.xt.observe(n,t)}disconnect(n){this.xt.disconnect(),n&&n()}unobserve(n){this.xt.unobserve(n)}};t.zn=class{constructor(n){this.vt=(t,e)=>n(t,e),this.kt=new MutationObserver(this.vt)}observe(n,t){this.kt.observe(n,t)}disconnect(n){this.kt.disconnect(),n&&n()}},t.Pn={attributes:!0,subtree:!0,attributeFilter:["class"],attributeOldValue:!0}},49:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.P=t.U=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,v=null,b=null,h=null,p=null,y=null,w=null;t.U={get tt(){return null!=o?o:o=document.getElementById("layouts")},get jn(){return null!=i?i:i=document.querySelector(".layout__center")},get toolbar(){return null!=u?u:u=document.getElementById("toolbar")},get J(){return null!=c?c:c=document.getElementById("dockLeft")},get K(){return null!=s?s:s=document.getElementById("dockRight")},get Z(){return null!=r?r:r=document.getElementById("dockBottom")},get status(){return null!=l?l:l=document.getElementById("status")},get W(){return null!=a?a:a=document.querySelector(".layout__dockl")},get it(){return null!=d?d:d=document.querySelector(".layout__dockr")},get ut(){return null!=f?f:f=document.querySelector(".layout__dockb")},get lt(){return null!=m?m:m=document.getElementById("barSync")},get dt(){return null!=_?_:_=document.getElementById("barForward")},get Mt(){return null!=v?v:v=document.getElementById("toolbarVIP")},get _t(){return null!=b?b:b=document.getElementById("drag")},get St(){return null!=h?h:h=document.getElementById("barPlugins")},get ft(){return null!=p?p:p=document.getElementById("barSearch")},get Ot(){return null!=y?y:y=document.getElementById("barMode")},get Pt(){return null!=w?w:w=document.getElementById("barMore")}},t.P={dn:navigator.platform.indexOf("Mac")>-1,T:navigator.platform.indexOf("Linux")>-1,fn:/Android/.test(e),j:!!document.getElementById("sidebar"),I:!e.startsWith("SiYuan")||e.indexOf("iPad")>-1||/Android/.test(e)&&!/(?:Mobile)/.test(e),ot:document.body.classList.contains("body--window"),mn:(/iOS/i.test(e)||/iPad/i.test(e))&&/AppleWebKit/i.test(e)&&e.startsWith("SiYuan/"),lang:window.siyuan.config.lang,O:CSS.supports("color","oklch(from red calc(l * 0.5) 0 h)"),_n:window.siyuan.config.readonly,B:window.siyuan.config.appearance.mode>0?"dark":"light",vn:/^((?!chrome|android).)*safari/i.test(e)}},216: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.It=t.Hn=void 0,t.qn=s,t.Y=function(n){const t="B"===n?c.U.ut:"L"===n?c.U.W:c.U.it;return!(!t||t.classList.contains("layout--float"))},t.q=function(n){const t="B"===n?c.U.ut:"L"===n?c.U.W:c.U.it;let e;if(!t)return!1;e="B"===n?t.style.height:t.style.width;return!(!e||"0px"===e)},t.ct=function(n="L"){const t="B"===n?c.U.Z:"L"===n?c.U.J:c.U.K;return!(!t||!t.classList.contains("fn__none"))},t.X=function(){return o(this,void 0,void 0,(function*(){return c.U.Z||(yield(0,u.l)(".layout__dockb")),!(!c.U.Z||c.U.Z.classList.contains("fn__none"))}))},t.isFullScreen=function(){return!(!i.remote||!i.remote.getCurrentWindow().isFullScreen())},t.nt=function(){return!(!c.U.status||!c.U.status.classList.contains("fn__none"))},t.kn=function(){return o(this,void 0,void 0,(function*(){return yield(0,u.sn)('.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.U.toolbar&&(t.Hn=(null===(n=c.U.toolbar)||void 0===n?void 0:n.scrollWidth)>c.U.toolbar.clientWidth,(null===(e=c.U.Pt)||void 0===e?void 0:e.classList.contains("fn__none"))||(t.Hn=!0))}t.Hn=!1,t.It=(0,u.k)(s),t.h=document.querySelectorAll('.layout__center [data-type="wnd"]')},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.yn)(),window.destroyTheme=()=>{(0,n.Tn)()}})()})();