From 3aa8277530e0de52198061ee39fc4abe4ecd92d6 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 26 Mar 2026 15:11:11 +0100 Subject: [PATCH] Add wallet URI copy and shortlink trust toggle --- app.js | 42 +++++++++++++++++++++++++++++++++--------- app.min.js | 2 +- i18n.js | 21 +++++++++++++++++++++ i18n.min.js | 2 +- index.html | 8 ++++++++ style.css | 27 +++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index 505caa3..c1e8fe7 100644 --- a/app.js +++ b/app.js @@ -35,14 +35,17 @@ const qrContainer = $('#qr'); const uriBox = $('#uri'); const openWalletBtn = $('#openWallet'); + const copyUriBtn = $('#copyUri'); const copyAddrBtn = $('#copyAddr'); const countdownEl = $('#countdown'); const fiatHint = $('#fiatHint'); const toast = $('#toast'); const shareLinkInput = $('#shareLink'); const copyShareLinkBtn = $('#copyShareLink'); + const useShortLinkCheckbox = $('#useShortLink'); const newRequestBtn = $('#newRequest'); const homeLink = $('#homeLink'); + let currentInvoiceHash = null; // TX Proof DOM const proofToggle = $('#proofToggle'); @@ -119,8 +122,12 @@ amountInput.addEventListener('input', updateFiatHint); currencySelect.addEventListener('change', updateFiatHint); generateBtn.addEventListener('click', generate); + copyUriBtn.addEventListener('click', () => copyToClipboard(uriBox.textContent)); copyAddrBtn.addEventListener('click', () => copyToClipboard(addrInput.value.trim())); copyShareLinkBtn.addEventListener('click', () => copyToClipboard(shareLinkInput.value)); + useShortLinkCheckbox.addEventListener('change', function () { + if (currentInvoiceHash) updateShareLink(currentInvoiceHash); + }); qrContainer.addEventListener('click', downloadQR); newRequestBtn.addEventListener('click', resetForm); homeLink.addEventListener('click', function (e) { e.preventDefault(); resetForm(); }); @@ -179,6 +186,8 @@ qrContainer.classList.remove('paid', 'confirming'); uriBox.textContent = ''; shareLinkInput.value = ''; + useShortLinkCheckbox.checked = false; + currentInvoiceHash = null; // Reset proof invoiceCode = null; stopConfirmationPolling(); @@ -326,7 +335,7 @@ buildSummary(xmrAmount, desc, timer); updatePageTitle(xmrAmount, desc); - // Share link — keep existing short URL if present; otherwise shorten new hash + // Share link var deadlineTs = null; if (timer && timer > 0) { if (!deadlineEndMs) { @@ -335,14 +344,8 @@ deadlineTs = Math.floor(deadlineEndMs / 1000); } const hash = buildHash(addr, xmrAmount, desc, timer, deadlineTs); - if (invoiceCode) { - shareLinkInput.value = location.origin + '/s/' + invoiceCode; - } else { - shareLinkInput.value = location.origin + '/#' + hash; - shortenUrl(hash).then(function (shortUrl) { - if (shortUrl) shareLinkInput.value = shortUrl; - }); - } + currentInvoiceHash = hash; + updateShareLink(hash); // QR qrContainer.innerHTML = ''; @@ -410,6 +413,7 @@ const code = params.get('c'); if (code) { invoiceCode = code; + useShortLinkCheckbox.checked = true; // Verify short URL integrity (detect tampering) setTimeout(function () { verifyShortUrlIntegrity(code, hash); @@ -422,6 +426,26 @@ return true; } + function updateShareLink(hash) { + var longUrl = location.origin + '/#' + hash; + shareLinkInput.value = longUrl; + + if (!useShortLinkCheckbox.checked) { + return; + } + + if (invoiceCode) { + shareLinkInput.value = location.origin + '/s/' + invoiceCode; + return; + } + + shortenUrl(hash).then(function (shortUrl) { + if (shortUrl && useShortLinkCheckbox.checked && currentInvoiceHash === hash) { + shareLinkInput.value = shortUrl; + } + }); + } + // Verify that the redirected hash still matches the stored short URL mapping. function verifyShortUrlIntegrity(code, currentHash) { fetch('/api/check-short.php?code=' + encodeURIComponent(code)) diff --git a/app.min.js b/app.min.js index ea13a40..7780646 100644 --- a/app.min.js +++ b/app.min.js @@ -1 +1 @@ -!function(){"use strict";const t=/^[48][1-9A-HJ-NP-Za-km-z]{94}$/,e=/^4[1-9A-HJ-NP-Za-km-z]{105}$/;let n=null,a=0,o=null,r=null,i=!1,s=null,c=null,l=null;const d=t=>document.querySelector(t),u=d("#addr"),f=d("#amount"),p=d("#currency"),m=d("#desc"),v=d("#timerCustom"),h=d("#deadlineBadges");let g=0,y=null;const x=d("#generate"),C=d("#result"),L=d("#qr"),w=d("#uri"),S=d("#openWallet"),_=d("#copyAddr"),I=d("#countdown"),b=d("#fiatHint"),F=d("#toast"),T=d("#shareLink"),E=d("#copyShareLink"),R=d("#newRequest"),k=d("#homeLink"),U=d("#proofToggle"),N=d("#proofPanel"),P=d("#txHash"),H=d("#txKey"),M=d("#verifyProof"),j=d("#proofResult"),X=d("#paymentStatus"),D=d("#paymentSummary"),q=d("#downloadPdf");let A=!1,z=!1,B=null;function O(){u.value="",f.value="",p.value="EUR",m.value="",g=0,y=null,v.value="",h.querySelectorAll(".badge").forEach(function(t){t.classList.remove("active")}),b.textContent="",b.classList.remove("error"),u.classList.remove("valid","invalid"),x.disabled=!0,C.classList.remove("visible"),o&&clearInterval(o),L.innerHTML="",L.classList.remove("paid","confirming"),w.textContent="",T.value="",s=null,it(),N.classList.remove("open"),P.value="",H.value="",M.disabled=!0,j.innerHTML="",j.className="proof-result",X.innerHTML="",X.className="payment-status",D.innerHTML="",document.title="xmrpay.link — Monero Invoice Generator",history.replaceState(null,"",location.pathname),window.scrollTo({top:0,behavior:"smooth"}),u.focus()}function J(n){return t.test(n)||e.test(n)}function W(){const t=u.value.trim();u.classList.remove("valid","invalid"),0!==t.length&&(J(t)?u.classList.add("valid"):t.length>=10&&u.classList.add("invalid"),function(){const t=u.value.trim();x.disabled=!J(t)}())}function K(){const t=parseFloat(f.value),e=p.value;if(!t||t<=0)return b.textContent="",void b.classList.remove("error");if("XMR"!==e&&!n)return b.textContent=i?I18n.t("rates_offline"):"",void b.classList.toggle("error",i);if(b.classList.remove("error"),"XMR"===e)if(n){const e=(t*n.eur).toFixed(2);b.textContent="≈ "+e+" EUR"}else b.textContent="";else{const a=n[e.toLowerCase()];if(a&&a>0){const e=(t/a).toFixed(8);b.textContent="≈ "+e+" XMR"}}}function G(){const t=parseFloat(f.value),e=p.value;if(!t||t<=0)return null;if("XMR"===e)return t;if(n){const a=n[e.toLowerCase()];if(a&&a>0)return t/a}return null}function V(){const t=u.value.trim();if(!J(t))return;const e=G(),n=m.value.trim(),a=g,o=function(t,e,n){let a="monero:"+t;const o=[];return e&&o.push("tx_amount="+e.toFixed(12)),n&&o.push("tx_description="+encodeURIComponent(n)),o.length&&(a+="?"+o.join("&")),a}(t,e,n);C.classList.add("visible"),w.textContent=o,S.onclick=function(){window.location.href=o},Z(e,n,a),$(e,n);var r=null;a&&a>0&&(y||(y=Date.now()+864e5*a),r=Math.floor(y/1e3));const i=function(t,e,n,a,o){const r=new URLSearchParams;return r.set("a",t),e&&r.set("x",e.toFixed(12)),n&&r.set("d",n),a&&r.set("t",a),o&&r.set("te",o),r.toString()}(t,e,n,a,r);s?T.value=location.origin+"/s/"+s:(T.value=location.origin+"/#"+i,async function(t){try{let e=null;g&&g>0&&(e=Math.floor((Date.now()+864e5*g)/1e3));const n=await fetch("/api/shorten.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:t,expiry_ts:e})});if(!n.ok)throw new Error("HTTP "+n.status);const a=await n.json();return s||(s=a.code),location.origin+"/s/"+a.code}catch(t){return console.warn("Short URL failed:",t),null}}(i).then(function(t){t&&(T.value=t)})),L.innerHTML="",new QRCode(L,{text:o,width:256,height:256,colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.M});const c=document.createElement("div");c.className="qr-hint",c.textContent=I18n.t("qr_hint"),L.appendChild(c),Q(),function(t){try{localStorage.setItem("xmrpay_addr",t)}catch(t){}}(t),C.scrollIntoView({behavior:"smooth",block:"start"})}function Z(t,e,n){var a="";if(t){a+='
'+t.toFixed(8)+" XMR
";var o=parseFloat(f.value),r=p.value;"XMR"!==r&&o&&(a+='
≈ '+o.toFixed(2)+" "+r+"
")}e&&(a+='
'+e.replace(/"),D.innerHTML=a,D.classList.remove("paid-confirmed"),function(){var t=document.getElementById("favicon");if(!t)return;t.href=ct()}()}function $(t,e){var n=[];t&&n.push(t.toFixed(4)+" XMR"),e&&n.push(e),n.length&&(document.title=n.join(" — ")+" | xmrpay.link")}function Q(){if(o&&clearInterval(o),I.textContent="",I.className="countdown",(!g||g<=0)&&!y)return;const t=y||Date.now()+864e5*g;function e(){const e=t-Date.now();if(e<=0)return clearInterval(o),I.textContent=I18n.t("countdown_expired"),void(I.className="countdown expired");const n=Math.floor(e/864e5),a=Math.floor(e%864e5/36e5),r=Math.floor(e%36e5/6e4);I.textContent=n>0?I18n.t("countdown_remaining_days").replace("{d}",n).replace("{h}",a):I18n.t("countdown_remaining_hours").replace("{h}",Y(a)).replace("{m}",Y(r))}y=t,I.classList.add("active"),r=e,e(),o=setInterval(e,6e4)}function Y(t){return t<10?"0"+t:""+t}function tt(t){navigator.clipboard.writeText(t).then(()=>{et(I18n.t("toast_copied"))})}function et(t){F.textContent=t,F.classList.add("show"),setTimeout(()=>F.classList.remove("show"),2e3)}function nt(t){return/^[0-9a-fA-F]{64}$/.test(t)}function at(){const t=P.value.trim(),e=H.value.trim();M.disabled=!(nt(t)&&nt(e))}function ot(t){t.verified_at||(t=Object.assign({},t,{verified_at:Math.floor(Date.now()/1e3)})),X.className="payment-status paid",L.classList.add("paid");var e=L.querySelector(".paid-stamp");if(e)e.textContent=I18n.t("status_paid");else{var n=document.createElement("div");n.className="paid-stamp",n.textContent=I18n.t("status_paid"),L.appendChild(n)}var a=L.querySelector(".qr-hint");if(a){var o="";if(t.verified_at)o=" — "+new Date(1e3*t.verified_at).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});a.textContent="TX "+t.tx_hash.substring(0,8)+"..."+o,a.className="qr-hint paid-info"}X.innerHTML="",B=t,D.classList.add("paid-confirmed"),S.style.display="none",document.getElementById("copyAddr").style.display="none";var r=document.getElementById("proofSection");r&&(r.style.display="none"),lt("#4caf50")}function rt(t){var e=t.confirmations||0;X.className="payment-status pending",D.classList.remove("paid-confirmed"),L.classList.add("confirming"),lt("#f59e0b");var n=L.querySelector(".paid-stamp");if(!n){var a=document.createElement("div");a.className="paid-stamp pending-stamp",L.appendChild(a),n=a}n.textContent=0===e?I18n.t("status_pending"):e+"/10";var o=L.querySelector(".qr-hint");o&&(o.textContent="TX "+t.tx_hash.substring(0,8)+"... — "+(0===e?I18n.t("status_pending"):e+"/10"),o.className="qr-hint pending-info")}function it(){c&&(clearInterval(c),c=null),l=null}async function st(){if(l){var t=l.txHash,e=l.xmrAmount;try{var n=await fetch("/api/node.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"gettransactions",params:{txs_hashes:[t]}})}),a=(await n.json()).txs||[];if(0===a.length)return;var o=a[0].confirmations||0;o>=10?(it(),j.className="proof-result active success",j.textContent=I18n.t("proof_verified").replace("{amount}",e.toFixed(6)),s&&await fetch("/api/verify.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,tx_hash:t,amount:e,confirmations:o,status:"paid"})}),ot({amount:e,tx_hash:t,confirmations:o})):(rt({amount:e,tx_hash:t,confirmations:o}),j.className="proof-result active warning",j.textContent=I18n.t("proof_confirmed_pending").replace("{amount}",e.toFixed(6)).replace("{n}",o))}catch(t){}}}function ct(){var t=document.getElementById("favicon");if(!t)return"favicon.svg";var e=t.getAttribute("data-base-href")||t.getAttribute("href")||"favicon.svg";return t.getAttribute("data-base-href")||t.setAttribute("data-base-href",e),e}function lt(t){var e=document.createElement("canvas");e.width=32,e.height=32;var n=e.getContext("2d"),a=new Image;a.onload=function(){n.drawImage(a,0,0,32,32),n.beginPath(),n.arc(25,25,7,0,2*Math.PI),n.fillStyle="#fff",n.fill(),n.beginPath(),n.arc(25,25,5.5,0,2*Math.PI),n.fillStyle=t,n.fill(),document.getElementById("favicon").href=e.toDataURL("image/png")},a.src=ct()}!function(){for(var t={de:"EUR",fr:"EUR",it:"EUR",es:"EUR",pt:"EUR",nl:"EUR","de-CH":"CHF","fr-CH":"CHF","it-CH":"CHF","de-AT":"EUR","en-GB":"GBP","en-US":"USD",en:"USD",ja:"JPY",ru:"RUB","pt-BR":"BRL"},e=navigator.languages||[navigator.language||"en"],n=0;n0){g=parseInt(r);const t=h.querySelector('.badge[data-days="'+g+'"]');t?t.classList.add("active"):v.value=g}const i=parseInt(e.get("te")||"0");i>0&&(y=1e3*i);const l=e.get("c");l&&(s=l,setTimeout(function(){!function(t,e){fetch("/api/check-short.php?code="+encodeURIComponent(t)).then(function(t){if(!t.ok)throw new Error("Integrity check failed");return t.json()}).then(function(n){if(n.hash){n.expiry_ts&&parseInt(n.expiry_ts)>0&&(y=1e3*parseInt(n.expiry_ts),C.classList.contains("visible")&&Q());var a=new URLSearchParams(e);a.delete("c");var o=a.toString();n.hash!==o&&(console.warn("xmrpay: Short URL hash mismatch detected for code",t),et(I18n.t("toast_integrity_warning")))}}).catch(function(t){console.warn("xmrpay: Could not verify short URL integrity:",t)})}(l,t),function(t){fetch("/api/verify.php?code="+encodeURIComponent(t)).then(function(t){return t.json()}).then(function(e){e.verified&&("pending"===e.status?(rt(e),c=setInterval(function(){fetch("/api/verify.php?code="+encodeURIComponent(t)).then(function(t){return t.json()}).then(function(t){t.verified&&("paid"===t.status?(it(),ot(t)):rt(t))}).catch(function(){})},6e4)):ot(e))}).catch(function(){})}(l)},200));return setTimeout(V,100),!0}()||function(){try{const t=localStorage.getItem("xmrpay_addr");t&&(u.value=t,W())}catch(t){}}(),"serviceWorker"in navigator&&navigator.serviceWorker.register("sw.js").catch(function(){}),I18n.onChange(function(){var t=L.querySelector(".qr-hint");t&&(t.textContent=I18n.t("qr_hint"));var e=L.querySelector(".paid-stamp");if(e&&(e.textContent=I18n.t("status_paid")),B&&ot(B),C.classList.contains("visible")){var n=G(),a=m.value.trim();Z(n,a,g),$(n,a)}r&&r()}),u.addEventListener("input",W),f.addEventListener("input",K),p.addEventListener("change",K),x.addEventListener("click",V),_.addEventListener("click",()=>tt(u.value.trim())),E.addEventListener("click",()=>tt(T.value)),L.addEventListener("click",function(){const t=L.querySelector("canvas");if(!t)return;const e=document.createElement("a");e.download="xmrpay-qr.png",e.href=t.toDataURL("image/png"),e.click()}),R.addEventListener("click",O),k.addEventListener("click",function(t){t.preventDefault(),O()}),h.querySelectorAll(".badge").forEach(function(t){t.addEventListener("click",function(){const e=parseInt(t.getAttribute("data-days"));t.classList.contains("active")?(t.classList.remove("active"),g=0,y=null,v.value=""):(h.querySelectorAll(".badge").forEach(function(t){t.classList.remove("active")}),t.classList.add("active"),g=e,y=null,v.value="")})}),v.addEventListener("input",function(){h.querySelectorAll(".badge").forEach(function(t){t.classList.remove("active")}),g=parseInt(v.value)||0,y=null}),q.addEventListener("click",async function(){await new Promise(function(t,e){if(window.jspdf)t();else{var n=document.createElement("script");n.src="lib/jspdf.min.js",n.onload=function(){z=!0,t()},n.onerror=function(){e(new Error("Failed to load jsPDF"))},document.head.appendChild(n)}});var t=new(0,window.jspdf.jsPDF)({orientation:"portrait",unit:"mm",format:"a4"}),e=u.value.trim(),n=G(),a=m.value.trim(),o=parseFloat(f.value),r=p.value,i=t.internal.pageSize.getWidth(),s=20,c=i-40,l=s;t.setFillColor(242,104,33),t.rect(0,0,i,8,"F"),l=22,t.setFont("helvetica","bold"),t.setFontSize(22),t.setTextColor(242,104,33),t.text(I18n.t("pdf_title"),s,l),t.setFont("helvetica","normal"),t.setFontSize(10),t.setTextColor(120,120,120);var d=(new Date).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});t.text(I18n.t("pdf_date")+": "+d,i-s,l,{align:"right"}),l+=6,t.setDrawColor(220,220,220),t.setLineWidth(.3),t.line(s,l,i-s,l);var v=L.querySelector("canvas"),h=50,y=i-s-h,x=l+6;if(v){var C=v.toDataURL("image/png");t.addImage(C,"PNG",y,x,h,h),t.setFontSize(7),t.setTextColor(150,150,150),t.text(I18n.t("pdf_scan_qr"),y+25,x+h+4,{align:"center"})}var S=y-s-10;function _(e,n){t.setFont("helvetica","normal"),t.setFontSize(9),t.setTextColor(150,150,150),t.text(e,20,l),l+=5,t.setFont("helvetica","bold"),t.setFontSize(11),t.setTextColor(40,40,40);var a=t.splitTextToSize(n,S);t.text(a,20,l),l+=5*a.length+4}if(l+=14,n){var I=n.toFixed(8)+" XMR";"XMR"!==r&&o&&(I+=" (~ "+o.toFixed(2)+" "+r+")"),_(I18n.t("pdf_amount"),I)}a&&_(I18n.t("pdf_desc"),a);if(g>0){var b=new Date(Date.now()+864e5*g).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});_(I18n.t("pdf_deadline"),b+" ("+I18n.t("pdf_deadline_days").replace("{d}",g)+")")}l=Math.max(l,x+h+12),t.setFont("helvetica","normal"),t.setFontSize(9),t.setTextColor(150,150,150),t.text(I18n.t("pdf_address"),s,l),l+=5,t.setFillColor(245,245,245),t.roundedRect(s,l-3.5,c,10,2,2,"F"),t.setFont("courier","normal"),t.setFontSize(8),t.setTextColor(60,60,60),t.text(e,23,l+2.5),l+=14;var F=w.textContent;if(F){t.setFillColor(245,245,245),t.roundedRect(s,l-3.5,c,10,2,2,"F"),t.setFont("courier","normal"),t.setFontSize(6.5),t.setTextColor(100,100,100);var E=t.splitTextToSize(F,c-6);t.text(E,23,l+2),l+=3*E.length+10}if(B){l+=4;var R="";if(B.verified_at)R=new Date(1e3*B.verified_at).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});var k=B.amount.toFixed(6)+" XMR — TX "+B.tx_hash.substring(0,8)+"..."+(R?" — "+R:"");t.setFillColor(76,175,80),t.roundedRect(s,l-4,c,16,2,2,"F"),t.setFont("helvetica","bold"),t.setFontSize(12),t.setTextColor(255,255,255),t.text(I18n.t("status_paid").toUpperCase(),s+c/2,l+1,{align:"center"}),t.setFont("helvetica","normal"),t.setFontSize(7.5),t.text(k,s+c/2,l+7,{align:"center"}),l+=22}t.setDrawColor(220,220,220),t.setLineWidth(.3);var U=t.internal.pageSize.getHeight()-15;t.line(s,U,i-s,U),t.setFont("helvetica","normal"),t.setFontSize(7),t.setTextColor(180,180,180),t.text(I18n.t("pdf_footer"),i/2,U+5,{align:"center"});var N=T.value;N&&t.text(N,i/2,U+9,{align:"center"});var P="xmrpay-"+(a?a.replace(/[^a-zA-Z0-9]/g,"-").substring(0,30):"invoice")+".pdf";t.save(P)}),U.addEventListener("click",function(){if(N.classList.contains("open"))return void N.classList.remove("open");if(!A&&!window.XmrCrypto)return void new Promise(function(t,e){if(window.XmrCrypto)return void t();const n=document.createElement("script");n.src="lib/xmr-crypto.bundle.js",n.onload=t,n.onerror=function(){e(new Error("Failed to load crypto module"))},document.head.appendChild(n)}).then(function(){A=!0,N.classList.add("open"),P.focus()});N.classList.add("open"),P.focus()}),P.addEventListener("input",at),H.addEventListener("input",at),M.addEventListener("click",async function(){const t=P.value.trim(),e=H.value.trim(),n=u.value.trim();if(!nt(t)||!nt(e)||!J(n))return;M.disabled=!0,j.className="proof-result active",j.textContent=I18n.t("proof_verifying");try{var a=await fetch("/api/node.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"gettransactions",params:{txs_hashes:[t],decode_as_json:!0}})}),o=(await a.json()).txs||[];if(0===o.length)return j.className="proof-result active error",j.textContent=I18n.t("proof_tx_not_found"),void(M.disabled=!1);for(var r=o[0],i=JSON.parse(r.as_json),d=XmrCrypto.getKeysFromAddress(n),f=d.publicViewKey,p=d.publicSpendKey,m=XmrCrypto.bytesToScalar(XmrCrypto.hexToBytes(e)),v=XmrCrypto.Point.fromHex(f).multiply(m).multiply(8n).toBytes(),h=XmrCrypto.Point.fromHex(p),g=i.vout||[],y=i.rct_signatures&&i.rct_signatures.ecdhInfo||[],x=0n,C=!1,L=0;L=10?(j.className="proof-result active success",j.textContent=I18n.t("proof_verified").replace("{amount}",T.toFixed(6)),s&&await fetch("/api/verify.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,tx_hash:t,amount:T,confirmations:E,status:"paid"})}),ot({amount:T,tx_hash:t,confirmations:E})):(j.className="proof-result active warning",j.textContent=I18n.t("proof_confirmed_pending").replace("{amount}",T.toFixed(6)).replace("{n}",E),s&&await fetch("/api/verify.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,tx_hash:t,amount:T,confirmations:E,status:"pending"})}),rt({amount:T,tx_hash:t,confirmations:E}),function(t,e){it(),l={txHash:t,xmrAmount:e},c=setInterval(st,6e4)}(t,T))}else j.className="proof-result active error",j.textContent=I18n.t("proof_no_match")}catch(t){j.className="proof-result active error",j.textContent=I18n.t("proof_error")}M.disabled=!1})}(); \ No newline at end of file +!function(){"use strict";const t=/^[48][1-9A-HJ-NP-Za-km-z]{94}$/,e=/^4[1-9A-HJ-NP-Za-km-z]{105}$/;let n=null,a=0,o=null,r=null,i=!1,s=null,c=null,l=null;const d=t=>document.querySelector(t),u=d("#addr"),f=d("#amount"),p=d("#currency"),m=d("#desc"),v=d("#timerCustom"),h=d("#deadlineBadges");let g=0,y=null;const x=d("#generate"),C=d("#result"),L=d("#qr"),w=d("#uri"),S=d("#openWallet"),_=d("#copyUri"),I=d("#copyAddr"),b=d("#countdown"),F=d("#fiatHint"),T=d("#toast"),E=d("#shareLink"),R=d("#copyShareLink"),k=d("#useShortLink"),U=d("#newRequest"),N=d("#homeLink");let P=null;const H=d("#proofToggle"),M=d("#proofPanel"),j=d("#txHash"),X=d("#txKey"),D=d("#verifyProof"),q=d("#proofResult"),A=d("#paymentStatus"),z=d("#paymentSummary"),B=d("#downloadPdf");let O=!1,J=!1,W=null;function K(){u.value="",f.value="",p.value="EUR",m.value="",g=0,y=null,v.value="",h.querySelectorAll(".badge").forEach(function(t){t.classList.remove("active")}),F.textContent="",F.classList.remove("error"),u.classList.remove("valid","invalid"),x.disabled=!0,C.classList.remove("visible"),o&&clearInterval(o),L.innerHTML="",L.classList.remove("paid","confirming"),w.textContent="",E.value="",k.checked=!1,P=null,s=null,dt(),M.classList.remove("open"),j.value="",X.value="",D.disabled=!0,q.innerHTML="",q.className="proof-result",A.innerHTML="",A.className="payment-status",z.innerHTML="",document.title="xmrpay.link — Monero Invoice Generator",history.replaceState(null,"",location.pathname),window.scrollTo({top:0,behavior:"smooth"}),u.focus()}function G(n){return t.test(n)||e.test(n)}function V(){const t=u.value.trim();u.classList.remove("valid","invalid"),0!==t.length&&(G(t)?u.classList.add("valid"):t.length>=10&&u.classList.add("invalid"),function(){const t=u.value.trim();x.disabled=!G(t)}())}function Z(){const t=parseFloat(f.value),e=p.value;if(!t||t<=0)return F.textContent="",void F.classList.remove("error");if("XMR"!==e&&!n)return F.textContent=i?I18n.t("rates_offline"):"",void F.classList.toggle("error",i);if(F.classList.remove("error"),"XMR"===e)if(n){const e=(t*n.eur).toFixed(2);F.textContent="≈ "+e+" EUR"}else F.textContent="";else{const a=n[e.toLowerCase()];if(a&&a>0){const e=(t/a).toFixed(8);F.textContent="≈ "+e+" XMR"}}}function $(){const t=parseFloat(f.value),e=p.value;if(!t||t<=0)return null;if("XMR"===e)return t;if(n){const a=n[e.toLowerCase()];if(a&&a>0)return t/a}return null}function Q(){const t=u.value.trim();if(!G(t))return;const e=$(),n=m.value.trim(),a=g,o=function(t,e,n){let a="monero:"+t;const o=[];return e&&o.push("tx_amount="+e.toFixed(12)),n&&o.push("tx_description="+encodeURIComponent(n)),o.length&&(a+="?"+o.join("&")),a}(t,e,n);C.classList.add("visible"),w.textContent=o,S.onclick=function(){window.location.href=o},tt(e,n,a),et(e,n);var r=null;a&&a>0&&(y||(y=Date.now()+864e5*a),r=Math.floor(y/1e3));const i=function(t,e,n,a,o){const r=new URLSearchParams;return r.set("a",t),e&&r.set("x",e.toFixed(12)),n&&r.set("d",n),a&&r.set("t",a),o&&r.set("te",o),r.toString()}(t,e,n,a,r);P=i,Y(i),L.innerHTML="",new QRCode(L,{text:o,width:256,height:256,colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.M});const s=document.createElement("div");s.className="qr-hint",s.textContent=I18n.t("qr_hint"),L.appendChild(s),nt(),function(t){try{localStorage.setItem("xmrpay_addr",t)}catch(t){}}(t),C.scrollIntoView({behavior:"smooth",block:"start"})}function Y(t){var e=location.origin+"/#"+t;E.value=e,k.checked&&(s?E.value=location.origin+"/s/"+s:async function(t){try{let e=null;g&&g>0&&(e=Math.floor((Date.now()+864e5*g)/1e3));const n=await fetch("/api/shorten.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:t,expiry_ts:e})});if(!n.ok)throw new Error("HTTP "+n.status);const a=await n.json();return s||(s=a.code),location.origin+"/s/"+a.code}catch(t){return console.warn("Short URL failed:",t),null}}(t).then(function(e){e&&k.checked&&P===t&&(E.value=e)}))}function tt(t,e,n){var a="";if(t){a+='
'+t.toFixed(8)+" XMR
";var o=parseFloat(f.value),r=p.value;"XMR"!==r&&o&&(a+='
≈ '+o.toFixed(2)+" "+r+"
")}e&&(a+='
'+e.replace(/"),z.innerHTML=a,z.classList.remove("paid-confirmed"),function(){var t=document.getElementById("favicon");if(!t)return;t.href=ft()}()}function et(t,e){var n=[];t&&n.push(t.toFixed(4)+" XMR"),e&&n.push(e),n.length&&(document.title=n.join(" — ")+" | xmrpay.link")}function nt(){if(o&&clearInterval(o),b.textContent="",b.className="countdown",(!g||g<=0)&&!y)return;const t=y||Date.now()+864e5*g;function e(){const e=t-Date.now();if(e<=0)return clearInterval(o),b.textContent=I18n.t("countdown_expired"),void(b.className="countdown expired");const n=Math.floor(e/864e5),a=Math.floor(e%864e5/36e5),r=Math.floor(e%36e5/6e4);b.textContent=n>0?I18n.t("countdown_remaining_days").replace("{d}",n).replace("{h}",a):I18n.t("countdown_remaining_hours").replace("{h}",at(a)).replace("{m}",at(r))}y=t,b.classList.add("active"),r=e,e(),o=setInterval(e,6e4)}function at(t){return t<10?"0"+t:""+t}function ot(t){navigator.clipboard.writeText(t).then(()=>{rt(I18n.t("toast_copied"))})}function rt(t){T.textContent=t,T.classList.add("show"),setTimeout(()=>T.classList.remove("show"),2e3)}function it(t){return/^[0-9a-fA-F]{64}$/.test(t)}function st(){const t=j.value.trim(),e=X.value.trim();D.disabled=!(it(t)&&it(e))}function ct(t){t.verified_at||(t=Object.assign({},t,{verified_at:Math.floor(Date.now()/1e3)})),A.className="payment-status paid",L.classList.add("paid");var e=L.querySelector(".paid-stamp");if(e)e.textContent=I18n.t("status_paid");else{var n=document.createElement("div");n.className="paid-stamp",n.textContent=I18n.t("status_paid"),L.appendChild(n)}var a=L.querySelector(".qr-hint");if(a){var o="";if(t.verified_at)o=" — "+new Date(1e3*t.verified_at).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});a.textContent="TX "+t.tx_hash.substring(0,8)+"..."+o,a.className="qr-hint paid-info"}A.innerHTML="",W=t,z.classList.add("paid-confirmed"),S.style.display="none",document.getElementById("copyAddr").style.display="none";var r=document.getElementById("proofSection");r&&(r.style.display="none"),pt("#4caf50")}function lt(t){var e=t.confirmations||0;A.className="payment-status pending",z.classList.remove("paid-confirmed"),L.classList.add("confirming"),pt("#f59e0b");var n=L.querySelector(".paid-stamp");if(!n){var a=document.createElement("div");a.className="paid-stamp pending-stamp",L.appendChild(a),n=a}n.textContent=0===e?I18n.t("status_pending"):e+"/10";var o=L.querySelector(".qr-hint");o&&(o.textContent="TX "+t.tx_hash.substring(0,8)+"... — "+(0===e?I18n.t("status_pending"):e+"/10"),o.className="qr-hint pending-info")}function dt(){c&&(clearInterval(c),c=null),l=null}async function ut(){if(l){var t=l.txHash,e=l.xmrAmount;try{var n=await fetch("/api/node.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"gettransactions",params:{txs_hashes:[t]}})}),a=(await n.json()).txs||[];if(0===a.length)return;var o=a[0].confirmations||0;o>=10?(dt(),q.className="proof-result active success",q.textContent=I18n.t("proof_verified").replace("{amount}",e.toFixed(6)),s&&await fetch("/api/verify.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,tx_hash:t,amount:e,confirmations:o,status:"paid"})}),ct({amount:e,tx_hash:t,confirmations:o})):(lt({amount:e,tx_hash:t,confirmations:o}),q.className="proof-result active warning",q.textContent=I18n.t("proof_confirmed_pending").replace("{amount}",e.toFixed(6)).replace("{n}",o))}catch(t){}}}function ft(){var t=document.getElementById("favicon");if(!t)return"favicon.svg";var e=t.getAttribute("data-base-href")||t.getAttribute("href")||"favicon.svg";return t.getAttribute("data-base-href")||t.setAttribute("data-base-href",e),e}function pt(t){var e=document.createElement("canvas");e.width=32,e.height=32;var n=e.getContext("2d"),a=new Image;a.onload=function(){n.drawImage(a,0,0,32,32),n.beginPath(),n.arc(25,25,7,0,2*Math.PI),n.fillStyle="#fff",n.fill(),n.beginPath(),n.arc(25,25,5.5,0,2*Math.PI),n.fillStyle=t,n.fill(),document.getElementById("favicon").href=e.toDataURL("image/png")},a.src=ft()}!function(){for(var t={de:"EUR",fr:"EUR",it:"EUR",es:"EUR",pt:"EUR",nl:"EUR","de-CH":"CHF","fr-CH":"CHF","it-CH":"CHF","de-AT":"EUR","en-GB":"GBP","en-US":"USD",en:"USD",ja:"JPY",ru:"RUB","pt-BR":"BRL"},e=navigator.languages||[navigator.language||"en"],n=0;n0){g=parseInt(r);const t=h.querySelector('.badge[data-days="'+g+'"]');t?t.classList.add("active"):v.value=g}const i=parseInt(e.get("te")||"0");i>0&&(y=1e3*i);const l=e.get("c");l&&(s=l,k.checked=!0,setTimeout(function(){!function(t,e){fetch("/api/check-short.php?code="+encodeURIComponent(t)).then(function(t){if(!t.ok)throw new Error("Integrity check failed");return t.json()}).then(function(n){if(n.hash){n.expiry_ts&&parseInt(n.expiry_ts)>0&&(y=1e3*parseInt(n.expiry_ts),C.classList.contains("visible")&&nt());var a=new URLSearchParams(e);a.delete("c");var o=a.toString();n.hash!==o&&(console.warn("xmrpay: Short URL hash mismatch detected for code",t),rt(I18n.t("toast_integrity_warning")))}}).catch(function(t){console.warn("xmrpay: Could not verify short URL integrity:",t)})}(l,t),function(t){fetch("/api/verify.php?code="+encodeURIComponent(t)).then(function(t){return t.json()}).then(function(e){e.verified&&("pending"===e.status?(lt(e),c=setInterval(function(){fetch("/api/verify.php?code="+encodeURIComponent(t)).then(function(t){return t.json()}).then(function(t){t.verified&&("paid"===t.status?(dt(),ct(t)):lt(t))}).catch(function(){})},6e4)):ct(e))}).catch(function(){})}(l)},200));return setTimeout(Q,100),!0}()||function(){try{const t=localStorage.getItem("xmrpay_addr");t&&(u.value=t,V())}catch(t){}}(),"serviceWorker"in navigator&&navigator.serviceWorker.register("sw.js").catch(function(){}),I18n.onChange(function(){var t=L.querySelector(".qr-hint");t&&(t.textContent=I18n.t("qr_hint"));var e=L.querySelector(".paid-stamp");if(e&&(e.textContent=I18n.t("status_paid")),W&&ct(W),C.classList.contains("visible")){var n=$(),a=m.value.trim();tt(n,a,g),et(n,a)}r&&r()}),u.addEventListener("input",V),f.addEventListener("input",Z),p.addEventListener("change",Z),x.addEventListener("click",Q),_.addEventListener("click",()=>ot(w.textContent)),I.addEventListener("click",()=>ot(u.value.trim())),R.addEventListener("click",()=>ot(E.value)),k.addEventListener("change",function(){P&&Y(P)}),L.addEventListener("click",function(){const t=L.querySelector("canvas");if(!t)return;const e=document.createElement("a");e.download="xmrpay-qr.png",e.href=t.toDataURL("image/png"),e.click()}),U.addEventListener("click",K),N.addEventListener("click",function(t){t.preventDefault(),K()}),h.querySelectorAll(".badge").forEach(function(t){t.addEventListener("click",function(){const e=parseInt(t.getAttribute("data-days"));t.classList.contains("active")?(t.classList.remove("active"),g=0,y=null,v.value=""):(h.querySelectorAll(".badge").forEach(function(t){t.classList.remove("active")}),t.classList.add("active"),g=e,y=null,v.value="")})}),v.addEventListener("input",function(){h.querySelectorAll(".badge").forEach(function(t){t.classList.remove("active")}),g=parseInt(v.value)||0,y=null}),B.addEventListener("click",async function(){await new Promise(function(t,e){if(window.jspdf)t();else{var n=document.createElement("script");n.src="lib/jspdf.min.js",n.onload=function(){J=!0,t()},n.onerror=function(){e(new Error("Failed to load jsPDF"))},document.head.appendChild(n)}});var t=new(0,window.jspdf.jsPDF)({orientation:"portrait",unit:"mm",format:"a4"}),e=u.value.trim(),n=$(),a=m.value.trim(),o=parseFloat(f.value),r=p.value,i=t.internal.pageSize.getWidth(),s=20,c=i-40,l=s;t.setFillColor(242,104,33),t.rect(0,0,i,8,"F"),l=22,t.setFont("helvetica","bold"),t.setFontSize(22),t.setTextColor(242,104,33),t.text(I18n.t("pdf_title"),s,l),t.setFont("helvetica","normal"),t.setFontSize(10),t.setTextColor(120,120,120);var d=(new Date).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});t.text(I18n.t("pdf_date")+": "+d,i-s,l,{align:"right"}),l+=6,t.setDrawColor(220,220,220),t.setLineWidth(.3),t.line(s,l,i-s,l);var v=L.querySelector("canvas"),h=50,y=i-s-h,x=l+6;if(v){var C=v.toDataURL("image/png");t.addImage(C,"PNG",y,x,h,h),t.setFontSize(7),t.setTextColor(150,150,150),t.text(I18n.t("pdf_scan_qr"),y+25,x+h+4,{align:"center"})}var S=y-s-10;function _(e,n){t.setFont("helvetica","normal"),t.setFontSize(9),t.setTextColor(150,150,150),t.text(e,20,l),l+=5,t.setFont("helvetica","bold"),t.setFontSize(11),t.setTextColor(40,40,40);var a=t.splitTextToSize(n,S);t.text(a,20,l),l+=5*a.length+4}if(l+=14,n){var I=n.toFixed(8)+" XMR";"XMR"!==r&&o&&(I+=" (~ "+o.toFixed(2)+" "+r+")"),_(I18n.t("pdf_amount"),I)}a&&_(I18n.t("pdf_desc"),a);if(g>0){var b=new Date(Date.now()+864e5*g).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});_(I18n.t("pdf_deadline"),b+" ("+I18n.t("pdf_deadline_days").replace("{d}",g)+")")}l=Math.max(l,x+h+12),t.setFont("helvetica","normal"),t.setFontSize(9),t.setTextColor(150,150,150),t.text(I18n.t("pdf_address"),s,l),l+=5,t.setFillColor(245,245,245),t.roundedRect(s,l-3.5,c,10,2,2,"F"),t.setFont("courier","normal"),t.setFontSize(8),t.setTextColor(60,60,60),t.text(e,23,l+2.5),l+=14;var F=w.textContent;if(F){t.setFillColor(245,245,245),t.roundedRect(s,l-3.5,c,10,2,2,"F"),t.setFont("courier","normal"),t.setFontSize(6.5),t.setTextColor(100,100,100);var T=t.splitTextToSize(F,c-6);t.text(T,23,l+2),l+=3*T.length+10}if(W){l+=4;var R="";if(W.verified_at)R=new Date(1e3*W.verified_at).toLocaleDateString("de"===I18n.getLang()?"de-CH":"en-US",{year:"numeric",month:"long",day:"numeric"});var k=W.amount.toFixed(6)+" XMR — TX "+W.tx_hash.substring(0,8)+"..."+(R?" — "+R:"");t.setFillColor(76,175,80),t.roundedRect(s,l-4,c,16,2,2,"F"),t.setFont("helvetica","bold"),t.setFontSize(12),t.setTextColor(255,255,255),t.text(I18n.t("status_paid").toUpperCase(),s+c/2,l+1,{align:"center"}),t.setFont("helvetica","normal"),t.setFontSize(7.5),t.text(k,s+c/2,l+7,{align:"center"}),l+=22}t.setDrawColor(220,220,220),t.setLineWidth(.3);var U=t.internal.pageSize.getHeight()-15;t.line(s,U,i-s,U),t.setFont("helvetica","normal"),t.setFontSize(7),t.setTextColor(180,180,180),t.text(I18n.t("pdf_footer"),i/2,U+5,{align:"center"});var N=E.value;N&&t.text(N,i/2,U+9,{align:"center"});var P="xmrpay-"+(a?a.replace(/[^a-zA-Z0-9]/g,"-").substring(0,30):"invoice")+".pdf";t.save(P)}),H.addEventListener("click",function(){if(M.classList.contains("open"))return void M.classList.remove("open");if(!O&&!window.XmrCrypto)return void new Promise(function(t,e){if(window.XmrCrypto)return void t();const n=document.createElement("script");n.src="lib/xmr-crypto.bundle.js",n.onload=t,n.onerror=function(){e(new Error("Failed to load crypto module"))},document.head.appendChild(n)}).then(function(){O=!0,M.classList.add("open"),j.focus()});M.classList.add("open"),j.focus()}),j.addEventListener("input",st),X.addEventListener("input",st),D.addEventListener("click",async function(){const t=j.value.trim(),e=X.value.trim(),n=u.value.trim();if(!it(t)||!it(e)||!G(n))return;D.disabled=!0,q.className="proof-result active",q.textContent=I18n.t("proof_verifying");try{var a=await fetch("/api/node.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"gettransactions",params:{txs_hashes:[t],decode_as_json:!0}})}),o=(await a.json()).txs||[];if(0===o.length)return q.className="proof-result active error",q.textContent=I18n.t("proof_tx_not_found"),void(D.disabled=!1);for(var r=o[0],i=JSON.parse(r.as_json),d=XmrCrypto.getKeysFromAddress(n),f=d.publicViewKey,p=d.publicSpendKey,m=XmrCrypto.bytesToScalar(XmrCrypto.hexToBytes(e)),v=XmrCrypto.Point.fromHex(f).multiply(m).multiply(8n).toBytes(),h=XmrCrypto.Point.fromHex(p),g=i.vout||[],y=i.rct_signatures&&i.rct_signatures.ecdhInfo||[],x=0n,C=!1,L=0;L=10?(q.className="proof-result active success",q.textContent=I18n.t("proof_verified").replace("{amount}",T.toFixed(6)),s&&await fetch("/api/verify.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,tx_hash:t,amount:T,confirmations:E,status:"paid"})}),ct({amount:T,tx_hash:t,confirmations:E})):(q.className="proof-result active warning",q.textContent=I18n.t("proof_confirmed_pending").replace("{amount}",T.toFixed(6)).replace("{n}",E),s&&await fetch("/api/verify.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,tx_hash:t,amount:T,confirmations:E,status:"pending"})}),lt({amount:T,tx_hash:t,confirmations:E}),function(t,e){dt(),l={txHash:t,xmrAmount:e},c=setInterval(ut,6e4)}(t,T))}else q.className="proof-result active error",q.textContent=I18n.t("proof_no_match")}catch(t){q.className="proof-result active error",q.textContent=I18n.t("proof_error")}D.disabled=!1})}(); \ No newline at end of file diff --git a/i18n.js b/i18n.js index 23706f1..f868924 100644 --- a/i18n.js +++ b/i18n.js @@ -26,6 +26,7 @@ var I18n = (function () { placeholder_timer_custom: 'Days', btn_generate: 'Create payment request', btn_open_wallet: 'Open in wallet', + btn_copy_uri: 'Copy payment URI', btn_copy_addr: 'Copy address', btn_download_pdf: 'PDF Invoice', pdf_title: 'Payment Request', @@ -41,6 +42,8 @@ var I18n = (function () { footer: footer, aria_currency: 'Currency', label_share_link: 'Shareable link', + shortlink_toggle_label: 'Use short link (requires server trust)', + shortlink_toggle_hint: 'Trade-off: short links are convenient, but a compromised server could swap invoice data on first access.', btn_new_request: 'New payment request', toast_copied: 'Copied!', countdown_expired: 'Payment deadline expired', @@ -75,6 +78,7 @@ var I18n = (function () { placeholder_timer_custom: 'Tage', btn_generate: 'Zahlungsanforderung erstellen', btn_open_wallet: 'In Wallet öffnen', + btn_copy_uri: 'Zahlungs-URI kopieren', btn_copy_addr: 'Adresse kopieren', btn_download_pdf: 'PDF Rechnung', pdf_title: 'Zahlungsanforderung', @@ -90,6 +94,8 @@ var I18n = (function () { footer: footer, aria_currency: 'Währung', label_share_link: 'Teilbarer Link', + shortlink_toggle_label: 'Kurzlink verwenden (Server-Vertrauen erforderlich)', + shortlink_toggle_hint: 'Trade-off: Kurzlinks sind bequem, aber ein kompromittierter Server könnte Rechnungsdaten beim ersten Aufruf austauschen.', btn_new_request: 'Neue Zahlungsanforderung', toast_copied: 'Kopiert!', countdown_expired: 'Zahlungsfrist abgelaufen', @@ -124,6 +130,7 @@ var I18n = (function () { placeholder_timer_custom: 'Jours', btn_generate: 'Créer une demande de paiement', btn_open_wallet: 'Ouvrir dans le wallet', + btn_copy_uri: 'Copier l\'URI de paiement', btn_copy_addr: 'Copier l\'adresse', btn_download_pdf: 'Facture PDF', pdf_title: 'Demande de paiement', @@ -139,6 +146,8 @@ var I18n = (function () { footer: footer, aria_currency: 'Devise', label_share_link: 'Lien partageable', + shortlink_toggle_label: 'Utiliser un lien court (confiance serveur requise)', + shortlink_toggle_hint: 'Compromis: les liens courts sont pratiques, mais un serveur compromis pourrait remplacer les donnees de facture au premier acces.', btn_new_request: 'Nouvelle demande de paiement', toast_copied: 'Copié !', countdown_expired: 'Délai de paiement expiré', @@ -173,6 +182,7 @@ var I18n = (function () { placeholder_timer_custom: 'Giorni', btn_generate: 'Crea richiesta di pagamento', btn_open_wallet: 'Apri nel wallet', + btn_copy_uri: 'Copia URI pagamento', btn_copy_addr: 'Copia indirizzo', btn_download_pdf: 'Fattura PDF', pdf_title: 'Richiesta di pagamento', @@ -188,6 +198,8 @@ var I18n = (function () { footer: footer, aria_currency: 'Valuta', label_share_link: 'Link condivisibile', + shortlink_toggle_label: 'Usa link breve (richiede fiducia nel server)', + shortlink_toggle_hint: 'Compromesso: i link brevi sono comodi, ma un server compromesso potrebbe sostituire i dati fattura al primo accesso.', btn_new_request: 'Nuova richiesta di pagamento', toast_copied: 'Copiato!', countdown_expired: 'Scadenza pagamento superata', @@ -222,6 +234,7 @@ var I18n = (function () { placeholder_timer_custom: 'Días', btn_generate: 'Crear solicitud de pago', btn_open_wallet: 'Abrir en wallet', + btn_copy_uri: 'Copiar URI de pago', btn_copy_addr: 'Copiar dirección', btn_download_pdf: 'Factura PDF', pdf_title: 'Solicitud de pago', @@ -237,6 +250,8 @@ var I18n = (function () { footer: footer, aria_currency: 'Moneda', label_share_link: 'Enlace compartible', + shortlink_toggle_label: 'Usar enlace corto (requiere confiar en el servidor)', + shortlink_toggle_hint: 'Compromiso: los enlaces cortos son comodos, pero un servidor comprometido podria cambiar los datos de la factura en el primer acceso.', btn_new_request: 'Nueva solicitud de pago', toast_copied: '¡Copiado!', countdown_expired: 'Plazo de pago vencido', @@ -271,6 +286,7 @@ var I18n = (function () { placeholder_timer_custom: 'Dias', btn_generate: 'Criar pedido de pagamento', btn_open_wallet: 'Abrir na wallet', + btn_copy_uri: 'Copiar URI de pagamento', btn_copy_addr: 'Copiar endereço', btn_download_pdf: 'Fatura PDF', pdf_title: 'Pedido de pagamento', @@ -286,6 +302,8 @@ var I18n = (function () { footer: footer, aria_currency: 'Moeda', label_share_link: 'Link partilhável', + shortlink_toggle_label: 'Usar link curto (requer confianca no servidor)', + shortlink_toggle_hint: 'Compromisso: links curtos sao praticos, mas um servidor comprometido pode trocar os dados da fatura no primeiro acesso.', btn_new_request: 'Novo pedido de pagamento', toast_copied: 'Copiado!', countdown_expired: 'Prazo de pagamento expirado', @@ -320,6 +338,7 @@ var I18n = (function () { placeholder_timer_custom: 'Дней', btn_generate: 'Создать запрос на оплату', btn_open_wallet: 'Открыть в кошельке', + btn_copy_uri: 'Копировать платежный URI', btn_copy_addr: 'Копировать адрес', btn_download_pdf: 'PDF счёт', pdf_title: 'Запрос на оплату', @@ -335,6 +354,8 @@ var I18n = (function () { footer: footer, aria_currency: 'Валюта', label_share_link: 'Ссылка для отправки', + shortlink_toggle_label: 'Использовать короткую ссылку (нужно доверять серверу)', + shortlink_toggle_hint: 'Компромисс: короткие ссылки удобны, но скомпрометированный сервер может подменить данные счета при первом открытии.', btn_new_request: 'Новый запрос на оплату', toast_copied: 'Скопировано!', countdown_expired: 'Срок оплаты истёк', diff --git a/i18n.min.js b/i18n.min.js index 49a8965..0a54850 100644 --- a/i18n.min.js +++ b/i18n.min.js @@ -1 +1 @@ -var I18n=function(){"use strict";var e={en:{name:"English"},de:{name:"Deutsch"},fr:{name:"Français"},it:{name:"Italiano"},es:{name:"Español"},pt:{name:"Português"},ru:{name:"Русский"}},a='Open Source · No Tracking · No KYC · Source · Onion · Privacy & Terms',n={en:{subtitle:"Monero payment request in seconds",label_addr:"XMR Address",placeholder_addr:"8...",label_amount:"Amount",label_desc:"Description (optional)",placeholder_desc:"e.g. Invoice #42, freelance work...",label_timer:"Payment deadline (optional)",days:"days",placeholder_timer_custom:"Days",btn_generate:"Create payment request",btn_open_wallet:"Open in wallet",btn_copy_addr:"Copy address",btn_download_pdf:"PDF Invoice",pdf_title:"Payment Request",pdf_address:"XMR Address",pdf_amount:"Amount",pdf_desc:"Description",pdf_deadline:"Payment deadline",pdf_deadline_days:"{d} days",pdf_date:"Date",pdf_scan_qr:"Scan QR code to pay",pdf_footer:"Created with xmrpay.link",qr_hint:"Click QR to save",footer:a,aria_currency:"Currency",label_share_link:"Shareable link",btn_new_request:"New payment request",toast_copied:"Copied!",countdown_expired:"Payment deadline expired",countdown_remaining_days:"Deadline: {d} days, {h} hrs",countdown_remaining_hours:"Deadline: {h}:{m} hrs",rates_offline:"Rates unavailable — XMR amount only",btn_prove_payment:"Prove payment",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 hex characters...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 hex characters...",btn_verify_proof:"Verify payment",proof_verifying:"Verifying...",proof_verified:"Payment confirmed: {amount} XMR",proof_no_match:"No matching output — TX key or address mismatch",proof_tx_not_found:"Transaction not found",proof_error:"Verification error",status_paid:"Paid",status_pending:"Pending",proof_confirmed_pending:"Output found: {amount} XMR — {n}/10 confirmations. Auto-refreshing…",toast_integrity_warning:"Warning: signature mismatch detected"},de:{subtitle:"Monero-Zahlungsanforderung in Sekunden",label_addr:"XMR-Adresse",placeholder_addr:"8...",label_amount:"Betrag",label_desc:"Beschreibung (optional)",placeholder_desc:"z.B. Rechnung #42, Freelance-Arbeit...",label_timer:"Zahlungsfrist (optional)",days:"Tage",placeholder_timer_custom:"Tage",btn_generate:"Zahlungsanforderung erstellen",btn_open_wallet:"In Wallet öffnen",btn_copy_addr:"Adresse kopieren",btn_download_pdf:"PDF Rechnung",pdf_title:"Zahlungsanforderung",pdf_address:"XMR-Adresse",pdf_amount:"Betrag",pdf_desc:"Beschreibung",pdf_deadline:"Zahlungsfrist",pdf_deadline_days:"{d} Tage",pdf_date:"Datum",pdf_scan_qr:"QR-Code scannen zum Bezahlen",pdf_footer:"Erstellt mit xmrpay.link",qr_hint:"Klick auf QR zum Speichern",footer:a,aria_currency:"Währung",label_share_link:"Teilbarer Link",btn_new_request:"Neue Zahlungsanforderung",toast_copied:"Kopiert!",countdown_expired:"Zahlungsfrist abgelaufen",countdown_remaining_days:"Zahlungsfrist: {d} Tage, {h} Std.",countdown_remaining_hours:"Zahlungsfrist: {h}:{m} Std.",rates_offline:"Kurse nicht verfügbar — nur XMR-Betrag möglich",btn_prove_payment:"Zahlung nachweisen",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 Hex-Zeichen...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 Hex-Zeichen...",btn_verify_proof:"Zahlung verifizieren",proof_verifying:"Verifiziere...",proof_verified:"Zahlung bestätigt: {amount} XMR",proof_no_match:"Kein passender Output — TX Key oder Adresse stimmt nicht",proof_tx_not_found:"Transaktion nicht gefunden",proof_error:"Fehler bei der Verifizierung",status_paid:"Bezahlt",status_pending:"Ausstehend",proof_confirmed_pending:"Output gefunden: {amount} XMR — {n}/10 Bestätigungen. Wird aktualisiert…",toast_integrity_warning:"Warnung: Signatur-Nichtübereinstimmung erkannt"},fr:{subtitle:"Demande de paiement Monero en quelques secondes",label_addr:"Adresse XMR",placeholder_addr:"8...",label_amount:"Montant",label_desc:"Description (facultatif)",placeholder_desc:"ex. Facture #42, travail freelance...",label_timer:"Date limite de paiement (facultatif)",days:"jours",placeholder_timer_custom:"Jours",btn_generate:"Créer une demande de paiement",btn_open_wallet:"Ouvrir dans le wallet",btn_copy_addr:"Copier l'adresse",btn_download_pdf:"Facture PDF",pdf_title:"Demande de paiement",pdf_address:"Adresse XMR",pdf_amount:"Montant",pdf_desc:"Description",pdf_deadline:"Date limite de paiement",pdf_deadline_days:"{d} jours",pdf_date:"Date",pdf_scan_qr:"Scanner le QR code pour payer",pdf_footer:"Créé avec xmrpay.link",qr_hint:"Cliquez sur le QR pour enregistrer",footer:a,aria_currency:"Devise",label_share_link:"Lien partageable",btn_new_request:"Nouvelle demande de paiement",toast_copied:"Copié !",countdown_expired:"Délai de paiement expiré",countdown_remaining_days:"Délai : {d} jours, {h} h",countdown_remaining_hours:"Délai : {h}:{m} h",rates_offline:"Taux indisponibles — montant en XMR uniquement",btn_prove_payment:"Prouver le paiement",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caractères hexadécimaux...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caractères hexadécimaux...",btn_verify_proof:"Vérifier le paiement",proof_verifying:"Vérification...",proof_verified:"Paiement confirmé : {amount} XMR",proof_no_match:"Aucun output correspondant — TX Key ou adresse incorrecte",proof_tx_not_found:"Transaction introuvable",proof_error:"Erreur de vérification",status_paid:"Payé",status_pending:"En attente",proof_confirmed_pending:"Sortie trouvée : {amount} XMR — {n}/10 confirmations. Actualisation automatique…",toast_integrity_warning:"Avertissement : détection d'une non-concordance de signature"},it:{subtitle:"Richiesta di pagamento Monero in pochi secondi",label_addr:"Indirizzo XMR",placeholder_addr:"8...",label_amount:"Importo",label_desc:"Descrizione (facoltativo)",placeholder_desc:"es. Fattura #42, lavoro freelance...",label_timer:"Scadenza pagamento (facoltativo)",days:"giorni",placeholder_timer_custom:"Giorni",btn_generate:"Crea richiesta di pagamento",btn_open_wallet:"Apri nel wallet",btn_copy_addr:"Copia indirizzo",btn_download_pdf:"Fattura PDF",pdf_title:"Richiesta di pagamento",pdf_address:"Indirizzo XMR",pdf_amount:"Importo",pdf_desc:"Descrizione",pdf_deadline:"Scadenza pagamento",pdf_deadline_days:"{d} giorni",pdf_date:"Data",pdf_scan_qr:"Scansiona il QR per pagare",pdf_footer:"Creato con xmrpay.link",qr_hint:"Clicca sul QR per salvare",footer:a,aria_currency:"Valuta",label_share_link:"Link condivisibile",btn_new_request:"Nuova richiesta di pagamento",toast_copied:"Copiato!",countdown_expired:"Scadenza pagamento superata",countdown_remaining_days:"Scadenza: {d} giorni, {h} ore",countdown_remaining_hours:"Scadenza: {h}:{m} ore",rates_offline:"Tassi non disponibili — solo importo in XMR",btn_prove_payment:"Dimostra pagamento",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caratteri esadecimali...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caratteri esadecimali...",btn_verify_proof:"Verifica pagamento",proof_verifying:"Verifica in corso...",proof_verified:"Pagamento confermato: {amount} XMR",proof_no_match:"Nessun output corrispondente — TX Key o indirizzo errato",proof_tx_not_found:"Transazione non trovata",proof_error:"Errore di verifica",status_paid:"Pagato",status_pending:"In attesa",proof_confirmed_pending:"Output trovato: {amount} XMR — {n}/10 conferme. Aggiornamento automatico…",toast_integrity_warning:"Avviso: rilevata mancata corrispondenza della firma"},es:{subtitle:"Solicitud de pago Monero en segundos",label_addr:"Dirección XMR",placeholder_addr:"8...",label_amount:"Monto",label_desc:"Descripción (opcional)",placeholder_desc:"ej. Factura #42, trabajo freelance...",label_timer:"Plazo de pago (opcional)",days:"días",placeholder_timer_custom:"Días",btn_generate:"Crear solicitud de pago",btn_open_wallet:"Abrir en wallet",btn_copy_addr:"Copiar dirección",btn_download_pdf:"Factura PDF",pdf_title:"Solicitud de pago",pdf_address:"Dirección XMR",pdf_amount:"Monto",pdf_desc:"Descripción",pdf_deadline:"Plazo de pago",pdf_deadline_days:"{d} días",pdf_date:"Fecha",pdf_scan_qr:"Escanear QR para pagar",pdf_footer:"Creado con xmrpay.link",qr_hint:"Clic en QR para guardar",footer:a,aria_currency:"Moneda",label_share_link:"Enlace compartible",btn_new_request:"Nueva solicitud de pago",toast_copied:"¡Copiado!",countdown_expired:"Plazo de pago vencido",countdown_remaining_days:"Plazo: {d} días, {h} h",countdown_remaining_hours:"Plazo: {h}:{m} h",rates_offline:"Tasas no disponibles — solo monto en XMR",btn_prove_payment:"Demostrar pago",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caracteres hexadecimales...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caracteres hexadecimales...",btn_verify_proof:"Verificar pago",proof_verifying:"Verificando...",proof_verified:"Pago confirmado: {amount} XMR",proof_no_match:"Ningún output coincidente — TX Key o dirección incorrecta",proof_tx_not_found:"Transacción no encontrada",proof_error:"Error de verificación",status_paid:"Pagado",status_pending:"Pendiente",proof_confirmed_pending:"Output encontrado: {amount} XMR — {n}/10 confirmaciones. Actualización automática…",toast_integrity_warning:"Advertencia: desajuste de firma detectado"},pt:{subtitle:"Pedido de pagamento Monero em segundos",label_addr:"Endereço XMR",placeholder_addr:"8...",label_amount:"Valor",label_desc:"Descrição (opcional)",placeholder_desc:"ex. Fatura #42, trabalho freelance...",label_timer:"Prazo de pagamento (opcional)",days:"dias",placeholder_timer_custom:"Dias",btn_generate:"Criar pedido de pagamento",btn_open_wallet:"Abrir na wallet",btn_copy_addr:"Copiar endereço",btn_download_pdf:"Fatura PDF",pdf_title:"Pedido de pagamento",pdf_address:"Endereço XMR",pdf_amount:"Valor",pdf_desc:"Descrição",pdf_deadline:"Prazo de pagamento",pdf_deadline_days:"{d} dias",pdf_date:"Data",pdf_scan_qr:"Digitalizar QR para pagar",pdf_footer:"Criado com xmrpay.link",qr_hint:"Clique no QR para guardar",footer:a,aria_currency:"Moeda",label_share_link:"Link partilhável",btn_new_request:"Novo pedido de pagamento",toast_copied:"Copiado!",countdown_expired:"Prazo de pagamento expirado",countdown_remaining_days:"Prazo: {d} dias, {h} h",countdown_remaining_hours:"Prazo: {h}:{m} h",rates_offline:"Taxas indisponíveis — apenas valor em XMR",btn_prove_payment:"Comprovar pagamento",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caracteres hexadecimais...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caracteres hexadecimais...",btn_verify_proof:"Verificar pagamento",proof_verifying:"A verificar...",proof_verified:"Pagamento confirmado: {amount} XMR",proof_no_match:"Nenhum output correspondente — TX Key ou endereço incorreto",proof_tx_not_found:"Transação não encontrada",proof_error:"Erro de verificação",status_paid:"Pago",status_pending:"Pendente",proof_confirmed_pending:"Output encontrado: {amount} XMR — {n}/10 confirmações. Atualização automática…",toast_integrity_warning:"Aviso: incompatibilidade de assinatura detectada"},ru:{subtitle:"Запрос на оплату Monero за секунды",label_addr:"Адрес XMR",placeholder_addr:"8...",label_amount:"Сумма",label_desc:"Описание (необязательно)",placeholder_desc:"напр. Счёт #42, фриланс...",label_timer:"Срок оплаты (необязательно)",days:"дней",placeholder_timer_custom:"Дней",btn_generate:"Создать запрос на оплату",btn_open_wallet:"Открыть в кошельке",btn_copy_addr:"Копировать адрес",btn_download_pdf:"PDF счёт",pdf_title:"Запрос на оплату",pdf_address:"Адрес XMR",pdf_amount:"Сумма",pdf_desc:"Описание",pdf_deadline:"Срок оплаты",pdf_deadline_days:"{d} дней",pdf_date:"Дата",pdf_scan_qr:"Сканируйте QR для оплаты",pdf_footer:"Создано с помощью xmrpay.link",qr_hint:"Нажмите на QR для сохранения",footer:a,aria_currency:"Валюта",label_share_link:"Ссылка для отправки",btn_new_request:"Новый запрос на оплату",toast_copied:"Скопировано!",countdown_expired:"Срок оплаты истёк",countdown_remaining_days:"Срок: {d} дней, {h} ч",countdown_remaining_hours:"Срок: {h}:{m} ч",rates_offline:"Курсы недоступны — только сумма в XMR",btn_prove_payment:"Подтвердить оплату",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 шестнадцатеричных символа...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 шестнадцатеричных символа...",btn_verify_proof:"Проверить оплату",proof_verifying:"Проверка...",proof_verified:"Оплата подтверждена: {amount} XMR",proof_no_match:"Соответствующий выход не найден — неверный TX Key или адрес",proof_tx_not_found:"Транзакция не найдена",proof_error:"Ошибка проверки",status_paid:"Оплачено",status_pending:"Ожидание",proof_confirmed_pending:"Выход найден: {amount} XMR — {n}/10 подтверждений. Авт. обновление…",toast_integrity_warning:"Предупреждение: обнаружено несоответствие подписи"}},t="en";function o(e){t=e;var a=n[e];document.documentElement.lang=e;try{localStorage.setItem("xmrpay_lang",e)}catch(e){}!function(e){document.querySelectorAll("[data-i18n]").forEach(function(a){a.textContent=e[a.getAttribute("data-i18n")]||""}),document.querySelectorAll("[data-i18n-placeholder]").forEach(function(a){a.placeholder=e[a.getAttribute("data-i18n-placeholder")]||""}),document.querySelectorAll("[data-i18n-html]").forEach(function(a){a.innerHTML=e[a.getAttribute("data-i18n-html")]||""}),document.querySelectorAll("[data-i18n-aria]").forEach(function(a){a.setAttribute("aria-label",e[a.getAttribute("data-i18n-aria")]||"")})}(a),document.querySelectorAll(".lang-option").forEach(function(a){a.classList.toggle("active",a.getAttribute("data-lang")===e)});for(var o=0;oSource · Onion · Privacy & Terms',n={en:{subtitle:"Monero payment request in seconds",label_addr:"XMR Address",placeholder_addr:"8...",label_amount:"Amount",label_desc:"Description (optional)",placeholder_desc:"e.g. Invoice #42, freelance work...",label_timer:"Payment deadline (optional)",days:"days",placeholder_timer_custom:"Days",btn_generate:"Create payment request",btn_open_wallet:"Open in wallet",btn_copy_uri:"Copy payment URI",btn_copy_addr:"Copy address",btn_download_pdf:"PDF Invoice",pdf_title:"Payment Request",pdf_address:"XMR Address",pdf_amount:"Amount",pdf_desc:"Description",pdf_deadline:"Payment deadline",pdf_deadline_days:"{d} days",pdf_date:"Date",pdf_scan_qr:"Scan QR code to pay",pdf_footer:"Created with xmrpay.link",qr_hint:"Click QR to save",footer:a,aria_currency:"Currency",label_share_link:"Shareable link",shortlink_toggle_label:"Use short link (requires server trust)",shortlink_toggle_hint:"Trade-off: short links are convenient, but a compromised server could swap invoice data on first access.",btn_new_request:"New payment request",toast_copied:"Copied!",countdown_expired:"Payment deadline expired",countdown_remaining_days:"Deadline: {d} days, {h} hrs",countdown_remaining_hours:"Deadline: {h}:{m} hrs",rates_offline:"Rates unavailable — XMR amount only",btn_prove_payment:"Prove payment",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 hex characters...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 hex characters...",btn_verify_proof:"Verify payment",proof_verifying:"Verifying...",proof_verified:"Payment confirmed: {amount} XMR",proof_no_match:"No matching output — TX key or address mismatch",proof_tx_not_found:"Transaction not found",proof_error:"Verification error",status_paid:"Paid",status_pending:"Pending",proof_confirmed_pending:"Output found: {amount} XMR — {n}/10 confirmations. Auto-refreshing…",toast_integrity_warning:"Warning: signature mismatch detected"},de:{subtitle:"Monero-Zahlungsanforderung in Sekunden",label_addr:"XMR-Adresse",placeholder_addr:"8...",label_amount:"Betrag",label_desc:"Beschreibung (optional)",placeholder_desc:"z.B. Rechnung #42, Freelance-Arbeit...",label_timer:"Zahlungsfrist (optional)",days:"Tage",placeholder_timer_custom:"Tage",btn_generate:"Zahlungsanforderung erstellen",btn_open_wallet:"In Wallet öffnen",btn_copy_uri:"Zahlungs-URI kopieren",btn_copy_addr:"Adresse kopieren",btn_download_pdf:"PDF Rechnung",pdf_title:"Zahlungsanforderung",pdf_address:"XMR-Adresse",pdf_amount:"Betrag",pdf_desc:"Beschreibung",pdf_deadline:"Zahlungsfrist",pdf_deadline_days:"{d} Tage",pdf_date:"Datum",pdf_scan_qr:"QR-Code scannen zum Bezahlen",pdf_footer:"Erstellt mit xmrpay.link",qr_hint:"Klick auf QR zum Speichern",footer:a,aria_currency:"Währung",label_share_link:"Teilbarer Link",shortlink_toggle_label:"Kurzlink verwenden (Server-Vertrauen erforderlich)",shortlink_toggle_hint:"Trade-off: Kurzlinks sind bequem, aber ein kompromittierter Server könnte Rechnungsdaten beim ersten Aufruf austauschen.",btn_new_request:"Neue Zahlungsanforderung",toast_copied:"Kopiert!",countdown_expired:"Zahlungsfrist abgelaufen",countdown_remaining_days:"Zahlungsfrist: {d} Tage, {h} Std.",countdown_remaining_hours:"Zahlungsfrist: {h}:{m} Std.",rates_offline:"Kurse nicht verfügbar — nur XMR-Betrag möglich",btn_prove_payment:"Zahlung nachweisen",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 Hex-Zeichen...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 Hex-Zeichen...",btn_verify_proof:"Zahlung verifizieren",proof_verifying:"Verifiziere...",proof_verified:"Zahlung bestätigt: {amount} XMR",proof_no_match:"Kein passender Output — TX Key oder Adresse stimmt nicht",proof_tx_not_found:"Transaktion nicht gefunden",proof_error:"Fehler bei der Verifizierung",status_paid:"Bezahlt",status_pending:"Ausstehend",proof_confirmed_pending:"Output gefunden: {amount} XMR — {n}/10 Bestätigungen. Wird aktualisiert…",toast_integrity_warning:"Warnung: Signatur-Nichtübereinstimmung erkannt"},fr:{subtitle:"Demande de paiement Monero en quelques secondes",label_addr:"Adresse XMR",placeholder_addr:"8...",label_amount:"Montant",label_desc:"Description (facultatif)",placeholder_desc:"ex. Facture #42, travail freelance...",label_timer:"Date limite de paiement (facultatif)",days:"jours",placeholder_timer_custom:"Jours",btn_generate:"Créer une demande de paiement",btn_open_wallet:"Ouvrir dans le wallet",btn_copy_uri:"Copier l'URI de paiement",btn_copy_addr:"Copier l'adresse",btn_download_pdf:"Facture PDF",pdf_title:"Demande de paiement",pdf_address:"Adresse XMR",pdf_amount:"Montant",pdf_desc:"Description",pdf_deadline:"Date limite de paiement",pdf_deadline_days:"{d} jours",pdf_date:"Date",pdf_scan_qr:"Scanner le QR code pour payer",pdf_footer:"Créé avec xmrpay.link",qr_hint:"Cliquez sur le QR pour enregistrer",footer:a,aria_currency:"Devise",label_share_link:"Lien partageable",shortlink_toggle_label:"Utiliser un lien court (confiance serveur requise)",shortlink_toggle_hint:"Compromis: les liens courts sont pratiques, mais un serveur compromis pourrait remplacer les donnees de facture au premier acces.",btn_new_request:"Nouvelle demande de paiement",toast_copied:"Copié !",countdown_expired:"Délai de paiement expiré",countdown_remaining_days:"Délai : {d} jours, {h} h",countdown_remaining_hours:"Délai : {h}:{m} h",rates_offline:"Taux indisponibles — montant en XMR uniquement",btn_prove_payment:"Prouver le paiement",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caractères hexadécimaux...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caractères hexadécimaux...",btn_verify_proof:"Vérifier le paiement",proof_verifying:"Vérification...",proof_verified:"Paiement confirmé : {amount} XMR",proof_no_match:"Aucun output correspondant — TX Key ou adresse incorrecte",proof_tx_not_found:"Transaction introuvable",proof_error:"Erreur de vérification",status_paid:"Payé",status_pending:"En attente",proof_confirmed_pending:"Sortie trouvée : {amount} XMR — {n}/10 confirmations. Actualisation automatique…",toast_integrity_warning:"Avertissement : détection d'une non-concordance de signature"},it:{subtitle:"Richiesta di pagamento Monero in pochi secondi",label_addr:"Indirizzo XMR",placeholder_addr:"8...",label_amount:"Importo",label_desc:"Descrizione (facoltativo)",placeholder_desc:"es. Fattura #42, lavoro freelance...",label_timer:"Scadenza pagamento (facoltativo)",days:"giorni",placeholder_timer_custom:"Giorni",btn_generate:"Crea richiesta di pagamento",btn_open_wallet:"Apri nel wallet",btn_copy_uri:"Copia URI pagamento",btn_copy_addr:"Copia indirizzo",btn_download_pdf:"Fattura PDF",pdf_title:"Richiesta di pagamento",pdf_address:"Indirizzo XMR",pdf_amount:"Importo",pdf_desc:"Descrizione",pdf_deadline:"Scadenza pagamento",pdf_deadline_days:"{d} giorni",pdf_date:"Data",pdf_scan_qr:"Scansiona il QR per pagare",pdf_footer:"Creato con xmrpay.link",qr_hint:"Clicca sul QR per salvare",footer:a,aria_currency:"Valuta",label_share_link:"Link condivisibile",shortlink_toggle_label:"Usa link breve (richiede fiducia nel server)",shortlink_toggle_hint:"Compromesso: i link brevi sono comodi, ma un server compromesso potrebbe sostituire i dati fattura al primo accesso.",btn_new_request:"Nuova richiesta di pagamento",toast_copied:"Copiato!",countdown_expired:"Scadenza pagamento superata",countdown_remaining_days:"Scadenza: {d} giorni, {h} ore",countdown_remaining_hours:"Scadenza: {h}:{m} ore",rates_offline:"Tassi non disponibili — solo importo in XMR",btn_prove_payment:"Dimostra pagamento",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caratteri esadecimali...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caratteri esadecimali...",btn_verify_proof:"Verifica pagamento",proof_verifying:"Verifica in corso...",proof_verified:"Pagamento confermato: {amount} XMR",proof_no_match:"Nessun output corrispondente — TX Key o indirizzo errato",proof_tx_not_found:"Transazione non trovata",proof_error:"Errore di verifica",status_paid:"Pagato",status_pending:"In attesa",proof_confirmed_pending:"Output trovato: {amount} XMR — {n}/10 conferme. Aggiornamento automatico…",toast_integrity_warning:"Avviso: rilevata mancata corrispondenza della firma"},es:{subtitle:"Solicitud de pago Monero en segundos",label_addr:"Dirección XMR",placeholder_addr:"8...",label_amount:"Monto",label_desc:"Descripción (opcional)",placeholder_desc:"ej. Factura #42, trabajo freelance...",label_timer:"Plazo de pago (opcional)",days:"días",placeholder_timer_custom:"Días",btn_generate:"Crear solicitud de pago",btn_open_wallet:"Abrir en wallet",btn_copy_uri:"Copiar URI de pago",btn_copy_addr:"Copiar dirección",btn_download_pdf:"Factura PDF",pdf_title:"Solicitud de pago",pdf_address:"Dirección XMR",pdf_amount:"Monto",pdf_desc:"Descripción",pdf_deadline:"Plazo de pago",pdf_deadline_days:"{d} días",pdf_date:"Fecha",pdf_scan_qr:"Escanear QR para pagar",pdf_footer:"Creado con xmrpay.link",qr_hint:"Clic en QR para guardar",footer:a,aria_currency:"Moneda",label_share_link:"Enlace compartible",shortlink_toggle_label:"Usar enlace corto (requiere confiar en el servidor)",shortlink_toggle_hint:"Compromiso: los enlaces cortos son comodos, pero un servidor comprometido podria cambiar los datos de la factura en el primer acceso.",btn_new_request:"Nueva solicitud de pago",toast_copied:"¡Copiado!",countdown_expired:"Plazo de pago vencido",countdown_remaining_days:"Plazo: {d} días, {h} h",countdown_remaining_hours:"Plazo: {h}:{m} h",rates_offline:"Tasas no disponibles — solo monto en XMR",btn_prove_payment:"Demostrar pago",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caracteres hexadecimales...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caracteres hexadecimales...",btn_verify_proof:"Verificar pago",proof_verifying:"Verificando...",proof_verified:"Pago confirmado: {amount} XMR",proof_no_match:"Ningún output coincidente — TX Key o dirección incorrecta",proof_tx_not_found:"Transacción no encontrada",proof_error:"Error de verificación",status_paid:"Pagado",status_pending:"Pendiente",proof_confirmed_pending:"Output encontrado: {amount} XMR — {n}/10 confirmaciones. Actualización automática…",toast_integrity_warning:"Advertencia: desajuste de firma detectado"},pt:{subtitle:"Pedido de pagamento Monero em segundos",label_addr:"Endereço XMR",placeholder_addr:"8...",label_amount:"Valor",label_desc:"Descrição (opcional)",placeholder_desc:"ex. Fatura #42, trabalho freelance...",label_timer:"Prazo de pagamento (opcional)",days:"dias",placeholder_timer_custom:"Dias",btn_generate:"Criar pedido de pagamento",btn_open_wallet:"Abrir na wallet",btn_copy_uri:"Copiar URI de pagamento",btn_copy_addr:"Copiar endereço",btn_download_pdf:"Fatura PDF",pdf_title:"Pedido de pagamento",pdf_address:"Endereço XMR",pdf_amount:"Valor",pdf_desc:"Descrição",pdf_deadline:"Prazo de pagamento",pdf_deadline_days:"{d} dias",pdf_date:"Data",pdf_scan_qr:"Digitalizar QR para pagar",pdf_footer:"Criado com xmrpay.link",qr_hint:"Clique no QR para guardar",footer:a,aria_currency:"Moeda",label_share_link:"Link partilhável",shortlink_toggle_label:"Usar link curto (requer confianca no servidor)",shortlink_toggle_hint:"Compromisso: links curtos sao praticos, mas um servidor comprometido pode trocar os dados da fatura no primeiro acesso.",btn_new_request:"Novo pedido de pagamento",toast_copied:"Copiado!",countdown_expired:"Prazo de pagamento expirado",countdown_remaining_days:"Prazo: {d} dias, {h} h",countdown_remaining_hours:"Prazo: {h}:{m} h",rates_offline:"Taxas indisponíveis — apenas valor em XMR",btn_prove_payment:"Comprovar pagamento",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 caracteres hexadecimais...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 caracteres hexadecimais...",btn_verify_proof:"Verificar pagamento",proof_verifying:"A verificar...",proof_verified:"Pagamento confirmado: {amount} XMR",proof_no_match:"Nenhum output correspondente — TX Key ou endereço incorreto",proof_tx_not_found:"Transação não encontrada",proof_error:"Erro de verificação",status_paid:"Pago",status_pending:"Pendente",proof_confirmed_pending:"Output encontrado: {amount} XMR — {n}/10 confirmações. Atualização automática…",toast_integrity_warning:"Aviso: incompatibilidade de assinatura detectada"},ru:{subtitle:"Запрос на оплату Monero за секунды",label_addr:"Адрес XMR",placeholder_addr:"8...",label_amount:"Сумма",label_desc:"Описание (необязательно)",placeholder_desc:"напр. Счёт #42, фриланс...",label_timer:"Срок оплаты (необязательно)",days:"дней",placeholder_timer_custom:"Дней",btn_generate:"Создать запрос на оплату",btn_open_wallet:"Открыть в кошельке",btn_copy_uri:"Копировать платежный URI",btn_copy_addr:"Копировать адрес",btn_download_pdf:"PDF счёт",pdf_title:"Запрос на оплату",pdf_address:"Адрес XMR",pdf_amount:"Сумма",pdf_desc:"Описание",pdf_deadline:"Срок оплаты",pdf_deadline_days:"{d} дней",pdf_date:"Дата",pdf_scan_qr:"Сканируйте QR для оплаты",pdf_footer:"Создано с помощью xmrpay.link",qr_hint:"Нажмите на QR для сохранения",footer:a,aria_currency:"Валюта",label_share_link:"Ссылка для отправки",shortlink_toggle_label:"Использовать короткую ссылку (нужно доверять серверу)",shortlink_toggle_hint:"Компромисс: короткие ссылки удобны, но скомпрометированный сервер может подменить данные счета при первом открытии.",btn_new_request:"Новый запрос на оплату",toast_copied:"Скопировано!",countdown_expired:"Срок оплаты истёк",countdown_remaining_days:"Срок: {d} дней, {h} ч",countdown_remaining_hours:"Срок: {h}:{m} ч",rates_offline:"Курсы недоступны — только сумма в XMR",btn_prove_payment:"Подтвердить оплату",label_tx_hash:"Transaction ID (TX Hash)",placeholder_tx_hash:"64 шестнадцатеричных символа...",label_tx_key:"Transaction Key (TX Key)",placeholder_tx_key:"64 шестнадцатеричных символа...",btn_verify_proof:"Проверить оплату",proof_verifying:"Проверка...",proof_verified:"Оплата подтверждена: {amount} XMR",proof_no_match:"Соответствующий выход не найден — неверный TX Key или адрес",proof_tx_not_found:"Транзакция не найдена",proof_error:"Ошибка проверки",status_paid:"Оплачено",status_pending:"Ожидание",proof_confirmed_pending:"Выход найден: {amount} XMR — {n}/10 подтверждений. Авт. обновление…",toast_integrity_warning:"Предупреждение: обнаружено несоответствие подписи"}},o="en";function t(e){o=e;var a=n[e];document.documentElement.lang=e;try{localStorage.setItem("xmrpay_lang",e)}catch(e){}!function(e){document.querySelectorAll("[data-i18n]").forEach(function(a){a.textContent=e[a.getAttribute("data-i18n")]||""}),document.querySelectorAll("[data-i18n-placeholder]").forEach(function(a){a.placeholder=e[a.getAttribute("data-i18n-placeholder")]||""}),document.querySelectorAll("[data-i18n-html]").forEach(function(a){a.innerHTML=e[a.getAttribute("data-i18n-html")]||""}),document.querySelectorAll("[data-i18n-aria]").forEach(function(a){a.setAttribute("aria-label",e[a.getAttribute("data-i18n-aria")]||"")})}(a),document.querySelectorAll(".lang-option").forEach(function(a){a.classList.toggle("active",a.getAttribute("data-lang")===e)});for(var t=0;t