diff --git a/css/configuracoesleitor.min.css b/css/configuracoesleitor.min.css index c351ef6..626fb34 100644 --- a/css/configuracoesleitor.min.css +++ b/css/configuracoesleitor.min.css @@ -1,3 +1 @@ -main{position:relative}#papel{padding:18px;box-sizing:border-box;border-radius:5px;margin-top:45px}.page-navigation{margin-bottom:30px}object pre{font-size:18px}.referencias_capitulo{width:266px;display:flex;font-size:15px;flex-direction:row;justify-content:space-between;align-items:center;height:35px;background-color:#f8f9fa;color:#fff;text-align:center;color:#444;box-shadow:0 1px 3px #ababab;position:fixed;bottom:0;border-radius:5px 5px 0 0;left:50%;transform:translateX(-50%);border-width:1px 1px 0;border-style:solid;border-color:#dedfe0}.referencias_capitulo span{margin:5px}.referencias_capitulo input{border:1px solid #dedede;height:25px;width:103px;border-radius:5px;margin-right:4px;font-size:12px;color:#999;background-size:15px 15px}.referencias_capitulo input::placeholder{color:#999;font-size:12.5px}.referencias_capitulo .cont_ref{width:160px;display:flex;flex-direction:row;justify-content:center;align-items:center}.pegarLink{border:none;font-size:11px;height:30px;background-color:#e4e4e4;border-radius:3px;margin-left:2px;padding:0} -.pegarLink span{margin-top:0;margin-bottom:0}.pegarLink span img{height:18px;width:auto;margin-bottom:-5px}.pegarLink:hover{background-color:#ddedfd}.modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5)}.modal-content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#fff;padding:20px;min-width:260px;max-width:400px;border-radius:3px;font-size:14px}.modal-content p{margin-bottom:0}.modal-content div{margin-bottom:1rem}#qrcode_container{margin:13px auto 5px auto}.close{position:absolute;top:0;right:0;padding:0 15px;cursor:pointer;background-color:#d3d3d3;border-radius:3px}.close:hover{background-color:#d15e5e}#moan-menu-texto{position:absolute;right:0}#moan-menu-texto img{width:16px;height:auto}#moan-menu-texto button{background:#fff;border:1px solid #ccc;border-radius:5px;padding:4px 9px;margin:3px;cursor:pointer}#moan-menu-texto button:hover{box-shadow:0 0 5px rgba(0,0,0,.5)}.luz_apagada{background-color:#444 !important} -h1{font-size:2em}h2{font-size:1.5em}h3,h4{font-size:1.3em}h5,h6{font-size:1.02em}.callout.callout-style-default>div.callout-header{font-size:.88em}.callout.callout-style-default .callout-body{font-size:.88em}@media only screen and (max-width:767px){#quarto-content{display:block !important}#moan-menu-texto{top:-34px}}@media only screen and (max-width:500px){#moan-menu-texto{left:50%;transform:translate(-50%,-50%)}#papel{margin-top:90px}} \ No newline at end of file +main{position:relative}#papel{padding:18px;box-sizing:border-box;border-radius:5px;margin-top:45px}.page-navigation{margin-bottom:30px}object pre{font-size:18px}.referencias_capitulo{width:266px;display:flex;font-size:15px;flex-direction:row;justify-content:space-between;align-items:center;height:35px;background-color:#f8f9fa;color:#fff;text-align:center;color:#444;box-shadow:0 1px 3px #ababab;position:fixed;bottom:0;border-radius:5px 5px 0 0;left:50%;transform:translateX(-50%);border-width:1px 1px 0 1px;border-style:solid;border-color:#dedfe0}.referencias_capitulo span{margin:5px}.referencias_capitulo input{border:1px solid #dedede;height:25px;width:103px;border-radius:5px;margin-right:4px;font-size:12px;color:#999;background-size:15px 15px}.referencias_capitulo input::placeholder{color:#999;font-size:12.5px}.referencias_capitulo .cont_ref{width:160px;display:flex;flex-direction:row;justify-content:center;align-items:center}.pegarLink{border:none;font-size:11px;height:30px;background-color:#e4e4e4;border-radius:3px;margin-left:2px;padding:0}.pegarLink span{margin-top:0;margin-bottom:0}.pegarLink span img{height:18px;width:auto;margin-bottom:-5px}.pegarLink:hover{background-color:#ddedfd}.modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5)}.modal-content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#fff;padding:20px;min-width:260px;max-width:400px;border-radius:3px;font-size:14px}.modal-content p{margin-bottom:0}.modal-content div{margin-bottom:1rem}#qrcode_container{margin:13px auto 20px auto}.close{position:absolute;top:0;right:0;padding:0 15px;cursor:pointer;background-color:#d3d3d3;border-radius:3px}.close:hover{background-color:#d15e5e}#moan-menu-texto{position:absolute;right:0}#moan-menu-texto img{width:16px;height:auto}#moan-menu-texto button{background:#fff;border:1px solid #ccc;border-radius:5px;padding:4px 9px;margin:3px;cursor:pointer}#moan-menu-texto button:hover{box-shadow:0 0 5px rgba(0,0,0,.5)}.luz_apagada{background-color:#444!important}h1{font-size:2em}h2{font-size:1.5em}h3,h4{font-size:1.3em}h5,h6{font-size:1.02em}.callout.callout-style-default>div.callout-header{font-size:.88em}.callout.callout-style-default .callout-body{font-size:.88em}.versao-impressa-compre{font-size:.85em}.versao-impressa-compre h2{border:none;color:#a0a5a7;margin-bottom:0}.versao-impressa-compre ul{margin-top:10px}@media only screen and (max-width:767px){#quarto-content{display:block!important}#moan-menu-texto{top:-34px}}@media only screen and (max-width:500px){#moan-menu-texto{left:50%;transform:translate(-50%,-50%)}#papel{margin-top:90px}} \ No newline at end of file diff --git a/leitor-web.min.js b/leitor-web.min.js index 44f018e..adb0227 100644 --- a/leitor-web.min.js +++ b/leitor-web.min.js @@ -1 +1 @@ -var observer,elementosNaPagina=[];let ref_cap_busca={};window.onload=e=>{let t=new Audio("https://js.livro.online/moan-quarto/Interruptor.mp3"),n=metadados.livroUrl,a=["#fff","antiquewhite","url('https://js.livro.online/moan-quarto/olga-thelavart-HZm2XR0whdw-unsplash_P.jpg')","url('https://js.livro.online/moan-quarto/paper-g5d2cae661_1280_Pixabay_user_geralt.jpg')"],o=0,l=document.querySelector("body"),r=document.getElementById("quarto-content"),i=document.querySelector(".page-navigation"),s=document.getElementById("quarto-sidebar"),c=document.getElementById("quarto-margin-sidebar"),d=document.querySelectorAll(".sidebar-item-container"),p=document.querySelectorAll("span.chapter-number"),f=document.getElementById("toc-title"),u=!1,g=document.querySelector("#papel"),m=document.querySelector("main");var y=document.createElement("div");function h(e,t){let n=document.createElement("button"),a=document.createElement("img");return a.src=e,n.appendChild(a),n.addEventListener("click",function(){t()}),n}y.id="moan-menu-texto";let v=document.querySelector("header"),$=window.getComputedStyle(g,null).getPropertyValue("font-size"),b=$.split("p"),E=b[0];function L(){let e=localStorage.getItem("livro.online@"+n+".config"),t=localStorage.getItem("quarto-color-scheme"),l=!1;l="default"!=t;let r=JSON.parse(e);e&&(r[0]&&A(r[0]),r[1]&&(o=r[1],g.style.background=a[r[1]],u&&!l&&i&&(i.style.background=a[r[1]]),l&&g.style.removeProperty("background")),r[2]&&(u=r[2])&&!l&&F())}function C(e,t){let a=localStorage.getItem("livro.online@"+n+".config");if(a){let o=JSON.parse(a),l;switch(e){case"fonte":o[0]=t,l=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",l);break;case"papel":o[1]=t,l=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",l);break;case"luz_apagada":o[2]=t,l=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",l)}}else{let r=[],i;switch(e){case"fonte":r[0]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+n+".config",i);break;case"papel":r[1]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+n+".config",i);break;case"fundo":r[2]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+n+".config",i)}}}L();let z=document.createElement("script");z.src="https://js.livro.online/bibliotecas_de_terceiros/qrcode.min.js",document.body.appendChild(z);let S=document.createElement("div");S.id="modal",S.className="modal",S.style.display="none";let k=document.createElement("div");k.className="modal-content";let q=document.createElement("span");q.className="close",q.innerHTML="×",q.style.fontSize="20px";let I=document.createElement("div"),P=document.createElement("p");P.innerHTML="Refer\xeancia";let _=document.createElement("span");_.id="ref",I.appendChild(P),I.appendChild(_);let x=document.createElement("div"),N=document.createElement("p");N.innerHTML="Link";let w=document.createElement("span");w.id="link",x.appendChild(N),x.appendChild(w);let j=document.createElement("p");j.innerHTML="QR Code";let R=document.createElement("div");function H(){let e=window.getComputedStyle(y,null).getPropertyValue("font-size"),t=window.getComputedStyle(v,null).getPropertyValue("font-size"),n=parseInt(window.getComputedStyle(g,null).getPropertyValue("font-size").split("p")[0])-2;g.style.fontSize=`${n}px`,y.style.fontSize=e,v.style.fontSize=t,C("fonte",n)}function A(e){let t=window.getComputedStyle(y,null).getPropertyValue("font-size"),n=window.getComputedStyle(v,null).getPropertyValue("font-size");if(void 0!==e)g.style.fontSize=`${e}px`,y.style.fontSize=t,v.style.fontSize=n;else{let a=parseInt(window.getComputedStyle(g,null).getPropertyValue("font-size").split("p")[0])+2;g.style.fontSize=`${a}px`,y.style.fontSize=t,v.style.fontSize=n,C("fonte",a)}}function B(){g.style.fontSize=E+"px",C("fonte",E)}function V(){if(l.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para poder alterar o papel.");return}(o+=1)>a.length-1&&(o=0),g.style.background=a[o],C("papel",o),u&&i&&(i.style.background=a[o])}function D(){r.classList.remove("luz_apagada"),i&&i.style.removeProperty("background"),s.style.removeProperty("color"),s.classList.remove("luz_apagada"),d.forEach(e=>{e.style.removeProperty("color")}),p.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||e.style.removeProperty("color")}),c.style.removeProperty("color"),f&&f.style.removeProperty("color"),u=!1}function F(){r.classList.add("luz_apagada"),i&&(i.style.backgroundColor=a[o]),g.style.background=a[o],s.style.color="#fff",s.classList.add("luz_apagada"),d.forEach(e=>{e.style.color="#fff"}),p.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||(e.style.color="#fff")}),c.style.color="#fff",f&&(f.style.color="#fff"),u=!0}function M(){if(l.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para o estado da luz de fundo.");return}u?(g.style.background=a[o],t.play(),D(),C("luz_apagada",!1)):(g.style.background=a[o],t.play(),F(),C("luz_apagada",!0))}R.id="qrcode_container",k.appendChild(q),k.appendChild(I),k.appendChild(x),k.appendChild(j),k.appendChild(R),S.appendChild(k),document.body.appendChild(S),y.appendChild(h("https://js.livro.online/moan-quarto/text_decrease_FILL0_wght400_GRAD0_opsz24.svg",H)),y.appendChild(h("https://js.livro.online/moan-quarto/text_increase_FILL0_wght400_GRAD0_opsz24.svg",A)),y.appendChild(h("https://js.livro.online/moan-quarto/format_clear_FILL0_wght400_GRAD0_opsz24.svg",B)),y.appendChild(h("https://js.livro.online/moan-quarto/note_FILL0_wght400_GRAD0_opsz24.svg",V)),y.appendChild(h("https://js.livro.online/moan-quarto/emoji_objects_FILL0_wght400_GRAD0_opsz24.svg",M)),m.insertBefore(y,m.firstChild);let T={attributes:!0,attributeFilter:["class"]};function G(e,t){for(let n of e)"attributes"===n.type&&"class"===n.attributeName&&(l.classList.contains("quarto-dark")?(D(),g.style.removeProperty("background")):L())}let U=new MutationObserver(G);U.observe(l,T);var O=document.createElement("div");O.className="referencias_capitulo";var J=document.createElement("div");J.className="cont_ref";var Q=document.createElement("span");Q.id="Paginacao",J.appendChild(Q),O.appendChild(J);var X=document.createElement("input");X.id="busca_ref",X.className="buscar_ref",X.setAttribute("placeholder","Refer\xeancia..."),X.style.backgroundImage='url("https://js.livro.online/moan-quarto/search_FILL0_wght400_GRAD0_opsz24.svg")',X.style.backgroundRepeat="no-repeat",X.style.backgroundPosition="5px center",X.style.paddingLeft="25px",O.appendChild(X);let Z=document.createElement("button");Z.className="pegarLink";let K=document.createElement("span");K.style.display="flex",K.style.flexDirection="column",K.style.alignItems="center";let W=document.createElement("img");W.src="https://js.livro.online/moan-quarto/link_FILL0_wght400_GRAD0_opsz24.svg",K.appendChild(W);let Y=document.createTextNode("link");K.appendChild(Y),Z.appendChild(K),O.appendChild(Z),Z.addEventListener("click",ei),document.body.appendChild(O);let ee=document.getElementById("busca_ref");function et(e){let t=e.length,n=0,a=new Promise(a=>{0===t&&a("lista vazia"),e.forEach(e=>{n++,e.isIntersecting&&elementosNaPagina.push(e),n===t&&0!=elementosNaPagina.length&&a("lista pronta")})}),o=new Promise(e=>{e(elementosNaPagina.sort(function(e,t){let n=e.target.id.split("P"),a=t.target.id.split("P");return parseInt(n[1])parseInt(a[1])?1:void 0}))});a.then(e=>{"lista pronta"===e?o.then(e=>{let t=e.length-1;e[0].target.id===e[t].target.id?Q.innerHTML=`${e[0].target.id}`:Q.innerHTML=`${e[0].target.id} a ${e[t].target.id}`}).catch(e=>console.log("Erro na lista: "+e)):"lista vazia"===e&&(console.log("N\xe3o tenho Unidade"),Q.innerHTML="...")}).catch(e=>console.log("Erro: "+e))}window.addEventListener("scroll",()=>{elementosNaPagina=[],ea(),console.log("Observador ativado")});let en={root:null,rootMargin:"0px",threshold:.01,delay:1e3,trackVisibility:!0};function ea(){observer&&observer.disconnect();var e=Array.from(g.querySelectorAll(".unidade"));0!==e.length&&(observer=new IntersectionObserver(et,en),e.map(e=>observer.observe(e)))}function eo(){let e=ee.value,t=e.toUpperCase(),n=t.split("P"),a=n[0],o=ref_cap_busca[a];if(!o){console.log("Refer\xeancia n\xe3o encontrada"),alert("Refer\xeancia que come\xe7a com "+a+" \xe9 inv\xe1lida neste livro.");return}window.location.href="/"+o+"#"+t}function el(e,t){document.getElementById("ref").textContent=e,document.getElementById("link").textContent=t;let n=document.getElementById("modal");n.style.display="block";let a=document.getElementById("qrcode_container");a.innerHTML="";let o=t.match(/:\/\/([^/]+)\/(.+)/),l=o[2];console.log("Verificando: "+l),l="https://livro.online/qr-code/?livro="+(l=(l=l.replace(/\//g,"--")).replace(/#/g,"__")),new QRCode(a,{text:l,colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H})}function er(e){let t=0;for(;t<10;t++){if(e&&(e.classList.contains("unidade")||e.classList.contains("unidade_silenciosa")))return e.id;e=e.parentElement?e.parentElement:e}}function ei(){let e;if(window.getSelection?e=window.getSelection():document.selection&&(e=document.selection.createRange()),""===e.toString()){alert("Selecione um texto primeiro...");return}let t=window.getSelection().anchorNode.parentElement,n=window.getSelection().focusNode.parentElement;if(t&&n){let a=er(t),o=er(n),l=window.location.href,r=new URL(l);r.search="",r.hash="";let i=r.href;if(a===o){let s=`${i}${a?"#"+a:""}`,c=a;c&&""!==c.trim()?_.style.fontSize="30px":(c="Elemento sem refer\xeancia direta",_.style.fontSize="14px"),el(c,s)}else if(a{fetch("ref_capitulos.json").then(e=>{if(!e.ok)throw Error("N\xe3o foi poss\xedvel carregar o arquivo JSON.");return e.json()}).then(e=>{console.log(e),ref_cap_busca=e}).catch(e=>{console.error(e)})}),ee.addEventListener("keydown",e=>{("Enter"===e.key||13===e.keyCode)&&(e.preventDefault(),eo())}),document.querySelector(".close").addEventListener("click",function(){let e=document.getElementById("modal");e.style.display="none"})}; \ No newline at end of file +var observer,elementosNaPagina=[];let ref_cap_busca={};window.onload=e=>{let t=new Audio("https://js.livro.online/moan-quarto/Interruptor.mp3"),n=metadados.livroUrl,a=["#fff","antiquewhite","url('https://js.livro.online/moan-quarto/olga-thelavart-HZm2XR0whdw-unsplash_P.jpg')","url('https://js.livro.online/moan-quarto/paper-g5d2cae661_1280_Pixabay_user_geralt.jpg')"],o=0,r=document.querySelector("body"),l=document.getElementById("quarto-content"),i=document.querySelector(".page-navigation"),s=document.getElementById("quarto-sidebar"),c=document.getElementById("quarto-margin-sidebar"),p=document.querySelectorAll(".sidebar-item-container"),d=document.querySelectorAll("span.chapter-number"),m=document.getElementById("toc-title"),f=document.querySelector(".quarto-navbar-tools"),g=!1,u=document.querySelector("#papel"),h=document.querySelector("main");var y=document.createElement("div");function v(e,t){let n=document.createElement("button"),a=document.createElement("img");return a.src=e,n.appendChild(a),n.addEventListener("click",function(){t()}),n}y.id="moan-menu-texto";let $=document.querySelector("header"),E=window.getComputedStyle(u,null).getPropertyValue("font-size"),C=E.split("p"),b=C[0];function L(){let e=localStorage.getItem("livro.online@"+n+".config"),t=localStorage.getItem("quarto-color-scheme"),r=!1;r="default"!=t;let l=JSON.parse(e);e&&(l[0]&&G(l[0]),l[1]&&(o=l[1],u.style.background=a[l[1]],g&&!r&&i&&(i.style.background=a[l[1]]),r&&u.style.removeProperty("background")),l[2]&&(g=l[2])&&!r&&Q())}function q(e,t){let a=localStorage.getItem("livro.online@"+n+".config");if(a){let o=JSON.parse(a),r;switch(e){case"fonte":o[0]=t,r=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",r);break;case"papel":o[1]=t,r=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",r);break;case"luz_apagada":o[2]=t,r=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",r)}}else{let l=[],i;switch(e){case"fonte":l[0]=t,i=JSON.stringify(l),localStorage.setItem("livro.online@"+n+".config",i);break;case"papel":l[1]=t,i=JSON.stringify(l),localStorage.setItem("livro.online@"+n+".config",i);break;case"fundo":l[2]=t,i=JSON.stringify(l),localStorage.setItem("livro.online@"+n+".config",i)}}}L();let z=document.createElement("script");z.src="https://js.livro.online/bibliotecas_de_terceiros/qrcode.min.js",document.body.appendChild(z);let S=document.createElement("div");S.id="modal",S.className="modal",S.style.display="none";let k=document.createElement("div");k.className="modal-content";let I=document.createElement("span");I.className="close",I.innerHTML="×",I.style.fontSize="20px";let x=document.createElement("div"),_=document.createElement("p");_.innerHTML="Refer\xeancia";let P=document.createElement("span");P.id="ref",x.appendChild(_),x.appendChild(P);let N=document.createElement("div"),j=document.createElement("p");j.innerHTML="Link";let w=document.createElement("span");w.id="link",N.appendChild(j),N.appendChild(w);let R=document.createElement("p");R.innerHTML="QR Code";let H=document.createElement("div");H.id="qrcode_container";let M=document.createElement("div"),A=document.createElement("p");A.innerHTML="Como Citar";let T=document.createElement("span");T.innerHTML="Veja aqui como citar este livro.",M.appendChild(A),M.appendChild(T);let V=document.createElement("div"),B=document.createElement("p");B.innerHTML="Vers\xe3o Impressa";let D=document.createElement("span");function F(){let e=window.getComputedStyle(y,null).getPropertyValue("font-size"),t=window.getComputedStyle($,null).getPropertyValue("font-size"),n=parseInt(window.getComputedStyle(u,null).getPropertyValue("font-size").split("p")[0])-2;u.style.fontSize=`${n}px`,y.style.fontSize=e,$.style.fontSize=t,q("fonte",n)}function G(e){let t=window.getComputedStyle(y,null).getPropertyValue("font-size"),n=window.getComputedStyle($,null).getPropertyValue("font-size");if(void 0!==e)u.style.fontSize=`${e}px`,y.style.fontSize=t,$.style.fontSize=n;else{let a=parseInt(window.getComputedStyle(u,null).getPropertyValue("font-size").split("p")[0])+2;u.style.fontSize=`${a}px`,y.style.fontSize=t,$.style.fontSize=n,q("fonte",a)}}function U(){u.style.fontSize=b+"px",q("fonte",b)}function O(){if(r.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para poder alterar o papel.");return}(o+=1)>a.length-1&&(o=0),u.style.background=a[o],q("papel",o),g&&i&&(i.style.background=a[o])}function J(){l.classList.remove("luz_apagada"),i&&i.style.removeProperty("background"),s.style.removeProperty("color"),s.classList.remove("luz_apagada"),p.forEach(e=>{e.style.removeProperty("color")}),d.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||e.style.removeProperty("color")}),c.style.removeProperty("color"),m&&m.style.removeProperty("color"),g=!1}function Q(){l.classList.add("luz_apagada"),i&&(i.style.backgroundColor=a[o]),u.style.background=a[o],s.style.color="#fff",s.classList.add("luz_apagada"),p.forEach(e=>{e.style.color="#fff"}),d.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||(e.style.color="#fff")}),c.style.color="#fff",m&&(m.style.color="#fff"),g=!0}function X(){if(r.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para o estado da luz de fundo.");return}g?(u.style.background=a[o],t.play(),J(),q("luz_apagada",!1)):(u.style.background=a[o],t.play(),Q(),q("luz_apagada",!0))}D.innerHTML="Veja aqui onde comprar.",V.appendChild(B),V.appendChild(D),k.appendChild(I),k.appendChild(x),k.appendChild(N),k.appendChild(R),k.appendChild(H),k.appendChild(M),k.appendChild(V),S.appendChild(k),document.body.appendChild(S),y.appendChild(v("https://js.livro.online/moan-quarto/text_decrease_FILL0_wght400_GRAD0_opsz24.svg",F)),y.appendChild(v("https://js.livro.online/moan-quarto/text_increase_FILL0_wght400_GRAD0_opsz24.svg",G)),y.appendChild(v("https://js.livro.online/moan-quarto/format_clear_FILL0_wght400_GRAD0_opsz24.svg",U)),y.appendChild(v("https://js.livro.online/moan-quarto/note_FILL0_wght400_GRAD0_opsz24.svg",O)),y.appendChild(v("https://js.livro.online/moan-quarto/emoji_objects_FILL0_wght400_GRAD0_opsz24.svg",X)),h.insertBefore(y,h.firstChild);let Z={attributes:!0,attributeFilter:["class"]};function K(e,t){for(let n of e)"attributes"===n.type&&"class"===n.attributeName&&(r.classList.contains("quarto-dark")?(J(),u.style.removeProperty("background")):L())}let W=new MutationObserver(K);W.observe(r,Z);var Y=document.createElement("div");Y.className="referencias_capitulo";var ee=document.createElement("div");ee.className="cont_ref";var et=document.createElement("span");et.id="Paginacao",ee.appendChild(et),Y.appendChild(ee);var en=document.createElement("input");en.id="busca_ref",en.className="buscar_ref",en.setAttribute("placeholder","Refer\xeancia..."),en.style.backgroundImage='url("https://js.livro.online/moan-quarto/search_FILL0_wght400_GRAD0_opsz24.svg")',en.style.backgroundRepeat="no-repeat",en.style.backgroundPosition="5px center",en.style.paddingLeft="25px",Y.appendChild(en);let ea=document.createElement("button");ea.className="pegarLink";let eo=document.createElement("span");eo.style.display="flex",eo.style.flexDirection="column",eo.style.alignItems="center";let er=document.createElement("img");er.src="https://js.livro.online/moan-quarto/link_FILL0_wght400_GRAD0_opsz24.svg",eo.appendChild(er);let el=document.createTextNode("link");eo.appendChild(el),ea.appendChild(eo),Y.appendChild(ea),ea.addEventListener("click",e$),document.body.appendChild(Y);let ei=document.getElementById("busca_ref");if(f){var es=document.createElement("a");es.className="quarto-navigation-tool px-1",es.href="https://editora.livro.online",es.title="Editora Moan";var ec=document.createElement("img");ec.src="https://js.livro.online/moan-quarto/LogoRegistroALTII_min.png",ec.alt="Editora",es.appendChild(ec);var ep=document.createElement("a");ep.className="quarto-navigation-tool px-1",ep.href="https://livro.online/livros",ep.title="Mais livros gratuitos...";var ed=document.createElement("img");ed.src="https://js.livro.online/moan-quarto/import_contacts_FILL0_wght400_GRAD0_opsz24.svg",ed.alt="Livros",ed.width=28,ed.height=28,ep.appendChild(ed),f.insertBefore(ep,f.firstChild),f.insertBefore(es,f.firstChild)}function em(e){let t=e.length,n=0,a=new Promise(a=>{0===t&&a("lista vazia"),e.forEach(e=>{n++,e.isIntersecting&&elementosNaPagina.push(e),n===t&&0!=elementosNaPagina.length&&a("lista pronta")})}),o=new Promise(e=>{e(elementosNaPagina.sort(function(e,t){let n=e.target.id.split("P"),a=t.target.id.split("P");return parseInt(n[1])parseInt(a[1])?1:void 0}))});a.then(e=>{"lista pronta"===e?o.then(e=>{let t=e.length-1;e[0].target.id===e[t].target.id?et.innerHTML=`${e[0].target.id}`:et.innerHTML=`${e[0].target.id} a ${e[t].target.id}`}).catch(e=>console.log("Erro na lista: "+e)):"lista vazia"===e&&(console.log("N\xe3o tenho Unidade"),et.innerHTML="...")}).catch(e=>console.log("Erro: "+e))}window.addEventListener("scroll",()=>{elementosNaPagina=[],eg(),console.log("Observador ativado")});let ef={root:null,rootMargin:"0px",threshold:.01,delay:1e3,trackVisibility:!0};function eg(){observer&&observer.disconnect();var e=Array.from(u.querySelectorAll(".unidade"));0!==e.length&&(observer=new IntersectionObserver(em,ef),e.map(e=>observer.observe(e)))}function eu(e){return e.replace(/[&<>"']/g,"")}function eh(){let e=eu(ei.value),t=e.toUpperCase(),n=t.split("P"),a=n[0],o=ref_cap_busca[a];if(!o){console.log("Refer\xeancia n\xe3o encontrada"),alert("Refer\xeancia que come\xe7a com "+a+" \xe9 inv\xe1lida neste livro.");return}window.location.href="/"+o+"#"+t}function ey(e,t){document.getElementById("ref").textContent=e,document.getElementById("link").textContent=t;let n=document.getElementById("modal");n.style.display="block";let a=document.getElementById("qrcode_container");a.innerHTML="";let o=t.match(/:\/\/([^/]+)\/(.+)/),r=o[2];console.log("Verificando: "+r),r="https://livro.online/qr-code/?livro="+(r=(r=r.replace(/\//g,"--")).replace(/#/g,"__")),new QRCode(a,{text:r,colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H})}function ev(e){let t=0;for(;t<10;t++){if(e&&(e.classList.contains("unidade")||e.classList.contains("unidade_silenciosa")))return e.id;e=e.parentElement?e.parentElement:e}}function e$(){let e;if(window.getSelection?e=window.getSelection():document.selection&&(e=document.selection.createRange()),""===e.toString()){alert("Selecione um texto primeiro...");return}let t=window.getSelection().anchorNode.parentElement,n=window.getSelection().focusNode.parentElement;if(t&&n){let a=ev(t),o=ev(n),r=window.location.href,l=new URL(r);l.search="",l.hash="";let i=l.href;if(a===o){let s=`${i}${a?"#"+a:""}`,c=a;c&&""!==c.trim()?P.style.fontSize="30px":(c="Elemento sem refer\xeancia direta",P.style.fontSize="14px"),ey(c,s)}else if(a{fetch("ref_capitulos.json").then(e=>{if(!e.ok)throw Error("N\xe3o foi poss\xedvel carregar o arquivo JSON.");return e.json()}).then(e=>{console.log(e),ref_cap_busca=e}).catch(e=>{console.error(e)})}),ei.addEventListener("keydown",e=>{("Enter"===e.key||13===e.keyCode)&&(e.preventDefault(),eh())}),document.querySelector(".close").addEventListener("click",function(){let e=document.getElementById("modal");e.style.display="none"});let eE=/Ainda não disponível/i;fetch("/postos-de-venda.json").then(e=>e.json()).then(e=>{if(!eE.test(Object.keys(e)[0])){let t=document.createElement("div");t.className="versao-impressa-compre";let n=document.createElement("h2");n.textContent="Est\xe1 gostando?",t.appendChild(n);let a=document.createElement("span");a.textContent="Considere ajudar, comprando uma c\xf3pia f\xedsica deste livro.",t.appendChild(a);let o=document.createElement("ul"),r=/não disponível/i;for(let l in e)if(!r.test(l)){let i=document.createElement("li"),s=document.createElement("a");s.href=e[l],s.textContent=l,i.appendChild(s),o.appendChild(i)}t.appendChild(o),c.appendChild(t)}}).catch(e=>{console.error("Erro ao carregar o arquivo postos-de-venda.json:",e)})}; \ No newline at end of file