1!function(){"use strict";if(window.TextEditor)return;const e=e=>document.getElementById(e);function t(e,t){if(window.I18N&&"function"==typeof window.I18N.t){var n=window.I18N.t(e);if(n&&n!==e)return n}return null!=t?t:e}async function n(e){try{return await navigator.clipboard.writeText(String(e)),!0}catch(e){return!1}}let a=null;const l=(e,n)=>e&&e.key?t(e.key,e.fb||n):n,i={};let o="",d=null,r=0,c=[],s=!1,u=[],p=-1,v="snippet";const f=()=>"snippet"!==v;let h="",b="",m=!1,y=!1,g=!1,w="",x=!1,k=0,C=0,E=0;const S=1048576,L=()=>window.I18N&&window.I18N.lang||void 0,M=e=>{try{return Number(e).toLocaleString(L())}catch(t){return String(e)}},T=(e,t)=>String(e).replace(/\{(\w+)\}/g,(e,n)=>n in t?t[n]:e),A=e=>e.split("\n"),B={upper:e=>e.toUpperCase(),lower:e=>e.toLowerCase(),title:e=>e.toLowerCase().replace(/(^|[\s\-_/([{"'â])(\p{L})/gu,(e,t,n)=>t+n.toUpperCase()),sentence:e=>e.toLowerCase().replace(/(^|[.!?]["'â)]?\s+|\n\s*)(\p{L})/gu,(e,t,n)=>t+n.toUpperCase()),sortAsc:e=>A(e).sort((e,t)=>e.localeCompare(t,L())).join("\n"),sortDesc:e=>A(e).sort((e,t)=>t.localeCompare(e,L())).join("\n"),reverse:e=>A(e).reverse().join("\n"),dedupe:e=>{const t=new Set;return A(e).filter(e=>!t.has(e)&&(t.add(e),!0)).join("\n")},rmBlank:e=>A(e).filter(e=>""!==e.trim()).join("\n"),trim:e=>A(e).map(e=>e.trim()).join("\n"),collapse:e=>A(e).map(e=>e.replace(/[ \t]{2,}/g," ")).join("\n"),join:e=>e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).join(" ")},R=[["data-i18n-placeholder","placeholder"],["data-i18n-title","title"],["data-i18n-aria-label","aria-label"]];function _(){const e=document.createElement("div");e.innerHTML='<div class="cled-overlay" id="cled-overlay" hidden>\n <div class="cled-card" id="cled-card" role="dialog" aria-modal="true" aria-labelledby="cled-title" data-edmode="plain" data-edsrc="snippet">\n <div class="cled-head">\n <h2 class="cled-title" id="cled-title"><span class="cled-tlabel" data-i18n="clip.edTitle">Edit text</span><span class="cled-fname" id="cled-fname"></span></h2>\n <div class="cled-seg" role="group" data-i18n-aria-label="clip.edMode" aria-label="Editor mode">\n <button class="cled-seg-btn" id="cled-mode-plain" type="button" aria-pressed="true" data-edmode-set="plain" data-i18n="clip.edModePlain">Plain</button>\n <button class="cled-seg-btn" id="cled-mode-md" type="button" aria-pressed="false" data-edmode-set="md" data-i18n="clip.edModeMd">Markdown</button>\n </div>
1\n <button class="cled-full-btn" id="cled-full" type="button" aria-pressed="false" data-i18n-aria-label="clip.edFull" aria-label="Full window" data-i18n-title="clip.edFull" title="Full window"><svg class="ic-expand" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3"/></svg><svg class="ic-collapse" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3v3a2 2 0 0 1-2 2H3M21 8h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3M16 21v-3a2 2 0 0 1 2-2h3"/></svg></button>\n <button class="cled-close" id="cled-close" type="button" data-i18n-aria-label="clip.edClose" aria-label="Close"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" aria-hidden="true"><path d="M3.5 3.5l9 9M12.5 3.5l-9 9"/></svg></button>\n </div>\n <div class="cled-tools">\n <div class="cled-group">\n <span class="cled-glabel" data-i18n="clip.edGroupCase">Case</span>\n <button class="cled-chip" type="button" data-op="upper" data-i18n="clip.edUpper">UPPERCASE</button>\n <button class="cled-chip" type="button" data-op="lower" data-i18n="clip.edLower">lowercase</button>\n <button class="cled-chip" type="button" data-op="title" data-i18n="clip.edTitleCase">Title Case</button>\n <button class="cled-chip" type="button" data-op="sentence" data-i18n="clip.edSentence">Sentence case</button>\n </div>\n <div class="cled-group">\n <span class="cled-glabel" data-i18n="clip.edGroupLines">Lines</span>\n <button class="cled-chip" type="button" data-op="sortAsc" data-i18n="clip.edSortAsc">Sort AâZ</button>\n <button class="cled-chip" type="button" data-op="sortDesc" data-i18n="clip.edSortDesc">Sort ZâA</button>\n <button class="cled-chip" type="button" data-op="reverse" data-i18n="clip.edReverse">Reverse</button>\n <button class="cled-chip" type="button" data-op="dedupe" data-i18n="clip.edDedupe">Deduplicate</button>\n <button class="cled-chip" type="button" data-op="rmBlank" data-i18n="clip.edRmBlank">Remove blank lines</button>\n </div>\n <div class="cled-group">\n <span class="cled-glabel" data-i18n="clip.edGroupSpace">Spacing</span>\n <button class="cled-chip" type="button" data-op="trim" data-i18n="clip.edTrim">Trim lines</button>\n <button class="cled-chip" type="button" data-op="collapse" data-i18n="clip.edCollapse">Collapse spaces</button>\n <button class="cled-chip" type="button" data-op="join" data-i18n="clip.edJoin">Join lines</button>\n </div>\n </div>\n <div class="cled-bar">\n <div class="cled-mdbar" id="cled-mdbar">\n <button class="cled-mdbtn" type="button" data-md="bold" data-i18n-aria-label="clip.edBold" aria-label="Bold" data-i18n-title="clip.edBold" title="Bold"><b>B</b></button>\n <button class="cled-mdbtn" type="button" data-md="italic" data-i18n-aria-label="clip.edItalic" aria-label="Italic" data-i18n-title="clip.edItalic" title="Italic"><i>I</i></button>\n <button class="cled-mdbtn" type="button" data-md="heading" data-i18n-aria-label="clip.edHeading" aria-label="Heading" data-i18n-title="clip.edHeading" title="Heading">H</button>\n <span class="cled-mdsep" aria-hidden="true"></span>\n <button class="cled-mdbtn" type="button" data-md="quote" data-i18n-aria-label="clip.edQuote" aria-label="Quote" data-i18n-title="clip.edQuote" title="Quote"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 4v8"/><path d="M7 5.5h5M7 8h5M7 10.5h3"/></svg></button>\n <button class="cled-mdbtn" type="button" data-md="ul" data-i18n-aria-label="clip.edUl" aria-label="Bulleted list" data-i18n-title="clip.edUl" title="Bulleted list"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" aria-hidden="true"><path d="M6 4.5h7M6 8h7M6 11.5h7"/><circle cx="3" cy="4.5" r="1" fill="currentColor" stroke="none"/><circle cx="3" cy="8" r="1" fill="currentColor" stroke="none"/><circle cx="3" cy="11.5" r="1" fill="currentColor" stroke="none"/></svg></button>\n <button class="cled-mdbtn" type="button" data-md="ol" data-i18n-aria-label="clip.edOl" aria-label="Numbered list" data-i18n-title="clip.edOl" title="Numbered list">1.</button>\n <button class="cled-mdbtn" type="button" data-md="code" data-i18n-aria-label="clip.edCode" aria-label="Code" data-i18n-title="clip.edCode" title="Code"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 5L3 8l3 3M10 5l3 3-3 3"/></svg></button>\n <button class="cled-mdbtn" type="button" data-md="link" data-i18n-aria-label="clip.edLink" aria-label="Link" data-i18n-title="clip.edLink" title="Link"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 9a3 3 0 0 0 4.2 0l1.6-1.6a3 3 0 0 0-4.2-4.2l-1 1"/><path d="M9 7a3 3 0 0 0-4.2 0L3.2 8.6a3 3 0 0 0 4.2 4.2l1-1"/></svg></button>\n <button class="cled-mdbtn" type="button" data-md="hr" data-i18n-aria-label="clip.edHr" aria-label="Divider" data-i18n-title="clip.edHr" title="Divider"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" aria-hidden="true"><path d="M2.5 8h11"/></svg></button>\n </div>\n <div class="cled-find">\n <div class="cled-fgrp">\n <input class="cled-fi" id="cled-find" type="text" spellcheck="false" autocomplete="off" data-i18n-placeholder="clip.edFindPh" placeholder="Find" data-i18n-aria-label="clip.edFindPh" aria-label="Find">
1\n <span class="cled-find-count" id="cled-count" role="status" aria-live="polite"></span>\n <button class="cled-mini" id="cled-prev" type="button" disabled data-i18n-aria-label="clip.edPrev" aria-label="Previous match"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3.5L5.5 8l4.5 4.5"/></svg></button>\n <button class="cled-mini" id="cled-next" type="button" disabled data-i18n-aria-label="clip.edNext" aria-label="Next match"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.07" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3.5L10.5 8 6 12.5"/></svg></button>\n <button class="cled-toggle" id="cled-case" type="button" aria-pressed="false" data-i18n-title="clip.edCase" data-i18n-aria-label="clip.edCase" title="Match case" aria-label="Match case">Aa</button>\n </div>\n <div class="cled-fgrp">\n <input class="cled-fi" id="cled-replace" type="text" spellcheck="false" autocomplete="off" data-i18n-placeholder="clip.edReplacePh" placeholder="Replace with" data-i18n-aria-label="clip.edReplacePh" aria-label="Replace with">\n <button class="cled-chip" id="cled-rep-one" type="button" data-i18n="clip.edReplace">Replace</button>\n <button class="cled-chip" id="cled-rep-all" type="button" data-i18n="clip.edReplaceAll">Replace all</button>\n </div>\n </div>\n </div>\n <div class="cled-body">\n <textarea class="cled-ta" id="cled-ta" spellcheck="false" aria-describedby="cled-hint cled-stats" data-i18n-aria-label="clip.edTitle" aria-label="Edit text"></textarea>\n <div class="cled-preview" id="cled-preview" data-i18n-aria-label="clip.edPreview" aria-label="Preview"></div>\n </div>\n <div class="cled-stats" id="cled-stats"></div>\n <div class="cled-hint" id="cled-hint" hidden></div>\n <div class="cled-note" id="cled-note" role="status" aria-live="polite" hidden></div>\n <div class="cled-err" id="cled-err" role="alert" hidden></div>\n <div class="cled-foot">\n <button class="tog" id="cled-undo" type="button" disabled data-i18n="clip.edUndo">Undo</button>\n <button class="tog" id="cled-revert" type="button" data-i18n="clip.edRevert">Revert</button>\n <span class="cled-spacer"></span>\n <button class="tog cled-copyrich" id="cled-copyrich" type="button" data-i18n="clip.edCopyRich">
1Copy rich text</button>\n <button class="tog" id="cled-copy" type="button" data-i18n="clip.edCopy">Copy</button>\n <button class="tog cled-fileonly" id="cled-download" type="button" data-i18n="clip.edDownload">Download</button>\n <button class="tog cled-primary cled-fileonly" id="cled-send" type="button" data-i18n="clip.edSend">Send</button>\n <button class="tog cled-hostonly" id="cled-save" type="button">Save</button>\n </div>\n </div>\n</div>';const n=e.firstElementChild;var a;n&&((a=n).querySelectorAll("[data-i18n]").forEach(e=>{e.textContent=t(e.getAttribute("data-i18n"),e.textContent)}),R.forEach(e=>{a.querySelectorAll("["+e[0]+"]").forEach(n=>{n.setAttribute(e[1],t(n.getAttribute(e[0]),n.getAttribute(e[1])||""))})}),document.body.appendChild(n))}function D(){return!!i.overlay||(e("cled-overlay")||_(),i.overlay=e("cled-overlay"),i.card=e("cled-card"),i.ta=e("cled-ta"),i.tools=i.card&&i.card.querySelector(".cled-tools"),i.find=e("cled-find"),i.replace=e("cled-replace"),i.count=e("cled-count"),i.prev=e("cled-prev"),i.next=e("cled-next"),i.caseBtn=e("cled-case"),i.stats=e("cled-stats"),i.err=e("cled-err"),i.note=e("cled-note"),i.undo=e("cled-undo"),i.revert=e("cled-revert"),i.copy=e("cled-copy"),i.save=e("cled-save"),i.close=e("cled-close"),i.repOne=e("cled-rep-one"),i.repAll=e("cled-rep-all"),i.preview=e("cled-preview"),i.mdbar=e("cled-mdbar"),i.copyrich=e("cled-copyrich"),i.modePlain=e("cled-mode-plain"),i.modeMd=e("cled-mode-md"),i.full=e("cled-full"),i.fname=e("cled-fname"),i.download=e("cled-download"),i.send=e("cled-send"),i.hint=e("cled-hint"),i.host=e("cled-host"),i.overlay&&i.ta&&i.tools?(function(){i.close.addEventListener("click",()=>Qe());let e=!1;i.overlay.addEventListener("pointerdown",t=>{e=t.target===i.overlay&&Date.now()-r>300}),i.overlay.addEventListener("click",t=>{t.target===i.overlay&&e&&Qe(),e=!1}),i.tools.addEventListener("click",e=>{const t=e.target.closest("[data-op]");t&&function(e){const t=B[e];if(!t)return;const n=i.ta.value,a=t(n);if(a===n)return;j(n),i.ta.value=a,W()}(t.getAttribute("data-op"))}),i.find.addEventListener("input",()=>Q(!1)),i.find.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),G(e.shiftKey?-1:1))}),i.caseBtn.addEventListener("click",()=>{const e="true"===i.caseBtn.getAttribute("aria-pressed");i.caseBtn.setAttribute("aria-pressed",e?"false":"true"),Q(!1),u.length&&Z()}),i.prev.addEventListener("click",()=>G(-1)),i.next.addEventListener("click",()=>G(1)),i.repOne.addEventListener("click",V),i.repAll.addEventListener("click",J),i.replace.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),V())}),i.ta.addEventListener("beforeinput",()=>{Ke(),i.err&&!i.err.hidden&&Ee(""),f()&&(window.__textEditorDirty=!0),s||(j(i.ta.value),s=!0)}),i.ta.addEventListener("input",()=>{!function(){const e=he()&&pe&&i.ta.value.length>ue?700:140;clearTimeout(E),E=setTimeout(()=>{E=0,i.overlay&&!i.overlay.hidden&&(q(),he()&&fe())},e)}(),Q(!0)}),i.undo.addEventListener("click",X),i.revert.addEventListener("click",Y),i.copy.addEventListener("click",te),i.copyrich.addEventListener("click",Ce),navigator.clipboard&&navigator.clipboard.write&&window.ClipboardItem||(i.copyrich.hidden=!0);i.save.addEventListener("click",Fe),i.download&&i.download.addEventListener("click",je);i.send&&i.send.addEventListener("click",Ie);i.mdbar.addEventListener("click",e=>{const t=e.target.closest("[data-md]");if(t){const e=ke[t.getAttribute("data-md")];e&&e()}}),i.modePlain.addEventListener("click",()=>ye("plain")),i.modeMd.addEventListener("click",()=>ye("md")),i.full&&i.full.addEventListener("click",me);document.addEventListener("keydown",Ze,!0),window.addEventListener("i18n:changed",()=>{i.overlay.hidden||(q(),K(),Ue(),qe(),he()&&fe())})}(),!0):(i.overlay=null,!1))}function j(e){c.push(e),c.length>100&&c.shift(),i.undo.disabled=!1}const I=(e,t)=>{t.lastIndex=0;let n=0;for(;null!==t.exec(e);)n++;return n},F=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,P=/\S+/g,N=e=>e.length-I(e,F),U=e=>I(e,P),$=e=>(new TextEncoder).encode(e).byteLength;function q(){const e=i.ta.value,n=N(e),l=U(e),o=""===e?0:e.split("\n").length;let d=T(t("clip.edStats","{c} chars · {w} words · {l} lines"),{c:M(n),w:M(l),l:M(o)});const r=a&&a.maxBytes;if(r){const t=$(e);d+=" · "+ve(t)+" / "+ve(r),i.stats.classList.toggle("over",t>r)}else i.stats.classList.remove("over");i.stats.textContent=d,Ne()}function H(){E&&(clearTimeout(E),E=0)}const O=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function z(){u=[];const e=i.find.value;if(!e)return;const t="true"===i.caseBtn.getAttribute("aria-pressed");let n;try{n=new RegExp(O(e),t?"g":"gi")}catch(e){return}const a=i.ta.value;let l;for(;null!==(l=n.exec(a));)u.push({start:l.index,end:l.index+l[0].length}),l.index===n.lastIndex&&n.lastIndex++}function K(){const e=u.length,n=e>0;i.prev.disabled=!n,i.next.disabled=!n,i.find.value?i.count.textContent=n?T(t("clip.edMatchPos","{i} / {n}"),{i:M(p+1),n:M(e)}):t("clip.edNoMatch","No matches"):i.count.textContent=""}function Q(e){const t=p>=0&&u[p]?u[p].start:-1;if(z(),u.length)if(e&&t>=0){const e=u.findIndex(e=>e.start>=t);p=-1===e?0:e}else p=0;else p=-1;K()}function Z(){const e=u[p];if(e){i.ta.focus();try{i.ta.setSelectionRange(e.start,e.end)}catch(e){}!function(){const e=i.ta,t=u[p];if(!t)return;const n=e.value.slice(0,t.start).split("\n").length-1,a=parseFloat(getComputedStyle(e).lineHeight)||18;e.scrollTop=Math.max(0,n*a-e.clientHeight/2+a)}(),K()}}function G(e){u.length&&(p=(p+e+u.length)%u.length,Z())}function V(){if(!i.find.value)return;if((!u.length||p<0)&&(Q(!1),!u.length))return;const e=u[p];if(!e)return;const t=i.replace.value,n=i.ta.value;j(n),s=!1,i.ta.value=n.slice(0,e.start)+t+n.slice(e.end),H(),Ke(),q(),he()&&fe(),Je();const a=e.start+t.length;if(z(),u.length){const e=u.findIndex(e=>e.start>=a);p=-1===e?0:e}else p=-1;K(),p>=0&&Z()}function J(){if(!i.find.value)return;if(z(),!u.length)return void K();const e=i.replace.value,t=i.ta.value;j(t);let n="",a=0;for(const l of u)n+=t.slice(a,l.start)+e,a=l.end;n+=t.slice(a),i.ta.value=n,W()}function W(){H(),Ke(),s=!1,q(),Q(!0),he()&&fe(),Je()}
1function X(){c.length&&(i.ta.value=c.pop(),i.undo.disabled=!c.length,W())}function Y(){i.ta.value!==o&&(j(i.ta.value),i.ta.value=o,W())}function ee(e,n,a,l){e&&(e.textContent=n,clearTimeout(e._edT),e._edT=setTimeout(()=>{e.textContent=t(a,l)},1200),e._edRest=()=>{e.textContent=t(a,l)})}async function te(){await n(i.ta.value)&&ee(i.copy,t("clip.edCopied","Copied"),"clip.edCopy","Copy")}const ne="clip.ed-mode";function ae(e){const t=String(e).replace(/[\u0000-\u001F\u007F-\u009F\uE000\uE001]/g,"").trim();return/^(https?:|mailto:|tel:)/i.test(t)||/^data:image\/(png|gif|jpe?g|webp|avif)[;,]/i.test(t)?t:/^[a-z][a-z0-9+.\-]*:/i.test(t)?"#":t}const le=String.fromCharCode(57344),ie=String.fromCharCode(57345),oe=new RegExp(le+"(\\d+)"+ie,"g"),de=new RegExp("["+le+ie+"]","g");function re(e){const t=[],n=e=>le+(t.push(e)-1)+ie;let a;e=(e=(e=(e=(e=(e=e.replace(/`([^`]+)`/g,(e,t)=>n("<code>"+t+"</code>"))).replace(/!\[([^\]]*)\]\(([^)\s]+)\)/g,(e,t,a)=>{const l=ae(a),i=t.replace(de,"");return/^data:image\//i.test(l)?n('<img src="'+l+'" alt="'+i+'">'):n('<span class="cled-pv-img">'+i+"</span>")})).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(e,t,a)=>n('<a href="'+ae(a)+'" target="_blank" rel="noopener nofollow">'+t+"</a>"))).replace(/\*\*(?=\S)([\s\S]*?\S)\*\*/g,"<strong>$1</strong>").replace(/__(?=\S)([\s\S]*?\S)__/g,"<strong>$1</strong>")).replace(/\*(?=\S)([^*\n]*?\S)\*/g,"<em>$1</em>").replace(/(^|[^A-Za-z0-9_])_(?=\S)([^_\n]*?\S)_(?![A-Za-z0-9_])/g,"$1<em>$2</em>")).replace(/~~(?=\S)([\s\S]*?\S)~~/g,"<del>$1</del>");do{a=e,e=e.replace(oe,(e,n)=>null!=t[+n]?t[+n]:"")}while(e!==a);return e}function ce(e,t){t=t||0;const n=e.split("\n");let a="",l=0,i=[];const o=()=>{i.length&&(a+="<p>"+re(i.join("\n")).replace(/\n/g,"<br>")+"</p>",i=[])};for(;l<n.length;){const e=n[l],d=e.match(/^\s{0,3}(`{3,}|~{3,})/);if(d){o();const e=d[1][0],t=d[1].length,i=new RegExp("^\\s{0,3}"+("`"===e?"`":"~")+"{"+t+",}\\s*$"),r=[];for(l++;l<n.length&&!i.test(n[l]);)r.push(n[l]),l++;l++,a+="<pre><code>"+r.join("\n")+"</code></pre>";continue}const r=e.match(/^\s{0,3}(#{1,6})\s+(.*)$/);if(r){o();const e=r[1].length;a+="<h"+e+">"+re(r[2].trim())+"</h"+e+">",l++;continue}if(/^\s{0,3}([-*_])(\s*\1){2,}\s*$/.test(e)){o(),a+="<hr>",l++;continue}if(/^\s{0,3}>/.test(e)){o();const e=[];for(;l<n.length&&/^\s{0,3}>/.test(n[l]);)e.push(n[l].replace(/^\s{0,3}>\s?/,"")),l++;a+="<blockquote>"+(t<12?ce(e.join("\n"),t+1):"<p>"+e.join("<br>")+"</p>")+"</blockquote>";continue}const c=e.match(/^(\s*)[-*+]\s+/),s=e.match(/^(\s*)\d+[.)]\s+/);if(c||s){o();const e=!!s,t=[];for(;l<n.length;){const a=e?n[l].match(/^(\s*)\d+[.)]\s+(.*)$/):n[l].match(/^(\s*)[-*+]\s+(.*)$/);if(!a)break;t.push("<li>"+re(a[2])+"</li>"),l++}a+=(e?"<ol>":"<ul>")+t.join("")+(e?"</ol>":"</ul>");continue}/^\s*$/.test(e)?(o(),l++):(i.push(e),l++)}return o(),a}const se=e=>{return ce((t=String(e).replace(de,""),String(t).replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]))));var t},ue=262144;let pe=!1;function ve(e){const t=e>=1048576;if(!t&&!(!t&&e>=1024))return M(e)+" B";const n=t?Math.round(e/1048576*10)/10:Math.round(e/1024);try{return new Intl.NumberFormat(L(),{style:"unit",unit:t?"megabyte":"kilobyte",unitDisplay:"short"}).format(n)}catch(e){return M(n)+(t?" MB":" KB")}}function fe(){if(!i.preview)return;const e=i.ta.value;if(!e.trim()){i.preview.textContent="";const e=document.createElement("div");return e.className="cled-pv-empty",e.textContent=t("clip.edPreviewEmpty","Nothing to preview"),void i.preview.appendChild(e)}if(e.length>ue&&!pe){i.preview.textContent="";const n=document.createElement("div");n.className="cled-pv-paused";const a=document.createElement("p");let l;try{l=(new TextEncoder).encode(e).byteLength}catch(t){l=e.length}a.textContent=T(t("clip.edPreviewPaused","Large document ({size}) â the preview is paused so editing stays responsive."),{size:ve(l)});const o=document.createElement("button");return o.type="button",o.className="tog",o.textContent=t("clip.edPreviewShow","Render preview"),o.addEventListener("click",()=>{pe=!0,fe()}),n.append(a,o),void i.preview.appendChild(n)}try{i.preview.innerHTML=se(e)}catch(t){i.preview.textContent=e}}function he(){return i.card&&"md"===i.card.getAttribute("data-edmode")}function be(e){i.card.setAttribute("data-full",e?"true":"false"),i.full&&i.full.setAttribute("aria-pressed",e?"true":"false")}function me(){be("true"!==i.card.getAttribute("data-full"))}function ye(e){const t="md"===e;if(i.card.setAttribute("data-edmode",t?"md":"plain"),i.modePlain.setAttribute("aria-pressed",t?"false":"true"),i.modeMd.setAttribute("aria-pressed",t?"true":"false"),"snippet"===v)try{localStorage.setItem(ne,t?"md":"plain")}catch(e){}t&&fe();try{i.ta.focus()}catch(e){}}function ge(e,t){const n=i.ta,a=n.value,l=n.selectionStart,o=n.selectionEnd,d=a.slice(l,o);j(a),s=!1,n.value=a.slice(0,l)+e+d+t+a.slice(o);try{n.focus(),n.setSelectionRange(l+e.length,l+e.length+d.length)}catch(e){}W()}function we(e){const t=i.ta,n=t.value,a=t.selectionStart,l=t.selectionEnd,o=0===a?0:n.lastIndexOf("\n",a-1)+1,d=l>a&&"\n"===n[l-1]?l-1:l;let r=n.indexOf("\n",d);-1===r&&(r=n.length);const c=e(n.slice(o,r).split("\n")).join("\n");j(n),s=!1,t.value=n.slice(0,o)+c+n.slice(r);try{t.focus(),t.setSelectionRange(o,o+c.length)}catch(e){}W()}const xe=e=>{const t=e.match(/^(#{1,6})\s+(.*)$/);return t?t[1].length>=3?t[2]:"#".repeat(t[1].length+1)+" "+t[2]:"# "+e};const ke={bold:()=>ge("**","**"),italic:()=>ge("*","*"),heading:()=>we(e=>e.map(xe)),quote:()=>we(e=>e.map(e=>/^>\s?/.test(e)?e.replace(/^>\s?/,""):"> "+e)),ul:()=>we(e=>{const t=/^[-*+]\s+/.test(e[0]);return e.map(e=>t?e.replace(/^[-*+]\s+/,""):"- "+e)}),ol:()=>we(e=>{const t=/^\d+[.)]\s+/.test(e[0]);return e.map((e,n)=>t?e.replace(/^\d+[.)]\s+/,""):n+1+". "+e)}),code:()=>{const e=i.ta;ge.apply(null,e.value.slice(e.selectionStart,e.selectionEnd).includes("\n")?["```\n","\n```"]:["`","`"])},link:function(){const e=i.ta,n=e.value,a=e.selectionStart,l=e.selectionEnd,o=n.slice(a,l)||t("clip.edLinkText","text"),d=t("clip.edLinkUrl","url");j(n),s=!1;const r="["+o+"]("+d+")";e.value=n.slice(0,a)+r+n.slice(l);const c=a+1+o.length+2;try{e.focus(),e.setSelectionRange(c,c+d.length)}catch(e){}W()},hr:function(){const e=i.ta,t=e.value,n=e.selectionStart;j(t),s=!1;const a=(n>0&&"\n"!==t[n-1]?"\n":"")+"---\n";e.value=t.slice(0,n)+a+t.slice(n);const l=n+a.length;try{e.focus(),e.setSelectionRange(l,l)}catch(e){}W()}};async function Ce(){const e=i.ta.value,a=se(e);try{if(navigator.clipboard&&navigator.clipboard.write&&window.ClipboardItem)return await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([a],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]),void ee(i.copyrich,t("clip.edCopied","Copied"),"clip.edCopyRich","Copy rich text")}catch(e){}await n(e)&&ee(i.copyrich,t("clip.edCopied","Copied"),"clip.edCopyRich","Copy rich text")}function Ee(e){i.err&&(i.err.textContent=e,i.err.hidden=!e)}function Se(e){i.note&&(i.note.textContent=e,i.note.hidden=!e)}function Le(){Ee(l(a&&a.errorLabel,t("clip.errSave","Couldn't save â this browser's storage may be full. Try clearing some snippets.")))}function Me(){Ee(""),Se("")}const Te=/\.(md|markdown|mdown|mkd|mkdn|mdx|rmd|qmd)$/i,Ae=/\.(txt|text|log|nfo|me|readme|asc)$/i;function Be(e,t){return Te.test(e||"")||/^text\/(markdown|x-markdown|x-web-markdown)/i.test(t||"")?"md":"plain"}function Re(e){if(!e)return!1;const t=e.name||"";if(Te.test(t)||Ae.test(t))return!0;const n=String(e.type||"");return/^text\//i.test(n)&&!/^text\/(html|xml)/i.test(n)}function _e(e,t){const n=String(t||"").split(";")[0].trim().toLowerCase();return/^text\//.test(n)?n:Te.test(e||"")?"text/markdown":"text/plain"}const De=()=>i.ta.value!==o;function je(){const e=h||"text.txt";let n="";try{const a=new Blob([i.ta.value],{type:_e(e,b)+";charset=utf-8"});n=URL.createObjectURL(a);const l=document.createElement("a");l.href=n,l.download=e,l.rel="noopener",document.body.appendChild(l),l.click(),l.remove(),ee(i.download,t("clip.edDownloadStarted","Startedâ¦"),"clip.edDownload","Download")}catch(e){Ee(t("clip.edErrDownload","Couldn't save the file."))}n&&setTimeout(()=>{try{URL.revokeObjectURL(n)}catch(e){}},6e4)}async function Ie(){if(m)return;Ke();const e=i.ta.value;if(!e.trim())return void Ee(t("clip.edErrEmpty","Nothing to send â the document is empty."));if((new TextEncoder).encode(e).byteLength>S)return void Ee(T(t("clip.edErrTooBig","Too large to send from the editor (max {max})."),{max:ve(S)}));m=!0,i.send.disabled=!0,Se(t("clip.edSending","Sendingâ¦"));const n=(e,n)=>{Se(""),Ee(t(e,n))};try{const t=h||"text.txt",a=new File([e],t,{type:_e(t,b)});
1let l=document.querySelector("[data-link-root]");if(!l||"function"!=typeof l._linkAppUpload){let e=!1;try{e=!!window.__stage2&&await window.__stage2.loadForTab("link")}catch(e){}l=e?document.querySelector("[data-link-root]"):null}if(!l||"function"!=typeof l._linkAppUpload)return void n("clip.edErrSend","Couldn't reach the Relay tool â try again.");try{"function"==typeof window.activateTab&&window.activateTab("link")}catch(e){}l._linkAppUpload([a]),o=e,Qe()}catch(e){n("clip.edErrSend","Couldn't reach the Relay tool â try again.")}finally{m=!1,i.send&&(i.send.disabled=!1),i.note&&!i.note.hidden&&i.note.textContent===t("clip.edSending","Sendingâ¦")&&Se("")}}function Fe(){if("file"===v)return Ie();if(!a||"function"!=typeof a.onSave)return;if(y)return;const e=Pe();if(e)return void Ee("empty"===e?t("clip.edErrEmpty","Nothing to send â the document is empty."):T(t("clip.edErrTooBig","Too large to send from the editor (max {max})."),{max:ve(a.maxBytes)}));const n=i.ta.value,l=C,d=a;let r;try{r=d.onSave(n)}catch(e){return void Le()}if("error"===r)return void Le();if(!r||"function"!=typeof r.then)return void Qe(r);y=!0,i.save.disabled=!0,Ue();const c=()=>C===l;r.then(()=>{if(c()){if(i.ta.value!==n)return o=n,void Se(t("clip.edSavedStale","Saved â but you kept typing, so these newer edits are not in it yet."));o=i.ta.value,Qe(n)}}).catch(e=>{const n=e&&(e.editorMessage||e.message)||"";c()?Ee(n||t("clip.errSave","Couldn't save â please try again.")):d&&"function"==typeof d.onOrphanError&&d.onOrphanError(n)}).finally(()=>{c()&&(y=!1,Ue(),Ne())})}function Pe(){if(!a)return"";const e=i.ta.value,t=a.requireText;return("trim"===t?e.trim():!t||e.length)?a.maxBytes&&$(e)>a.maxBytes?"too-big":"":"empty"}function Ne(){i.save&&!y&&(i.save.disabled="snippet"!==v&&!!Pe())}function Ue(){i.save&&(i.save.textContent=y?l(a&&a.busyLabel,t("clip.edSaving","Savingâ¦")):l(a&&a.saveLabel,t("clip.edSave","Save")))}function $e(e){C++,window.__textEditorDirty=!1,c=[],u=[],p=-1,s=!1,pe=!1,H(),Ke(),[i.copy,i.copyrich,i.download].forEach(e=>{e&&e._edT&&(clearTimeout(e._edT),e._edT=0,e._edRest&&e._edRest())}),d=a&&a.opener||document.activeElement,Me(),i.ta.value=e,o=i.ta.value,i.find.value="",i.replace.value="",i.caseBtn.setAttribute("aria-pressed","false"),i.undo.disabled=!0,i.send&&(i.send.disabled=!1),m=!1,y=!1,Ue(),qe(),g||(w=document.body.style.overflow,document.body.style.overflow="hidden",g=!0),i.overlay.hidden=!1,r=Date.now()}function qe(){if(!i.hint)return;const e=a&&a.hint?l(a.hint,""):"";i.hint.textContent=e,i.hint.hidden=!e}function He(e){q(),K(),i.ta.focus();try{const t=e?i.ta.value.length:0;i.ta.setSelectionRange(t,t),e||(i.ta.scrollTop=0)}catch(e){}}function Oe(e){v=e,i.card.setAttribute("data-edsrc",e)}function ze(e,t,n){if(!D())return!1;if(!i.overlay.hidden)return!1;a=null,Oe("file"),h=t||"text.txt",b=n||"",i.fname.textContent=h,i.fname.title=h,$e(e);const l=Be(h,b);return be("md"===l),ye(l),He(!1),!0}function Ke(){clearTimeout(k),k=0,x&&(x=!1,Se(""))}function Qe(e){if(!i.overlay||i.overlay.hidden)return;if(f()&&void 0===e&&De()&&!x)return x=!0,Se(t("clip.edDiscard","Unsaved changes â close again to discard them.")),clearTimeout(k),void(k=setTimeout(Ke,5e3));H(),Ke(),i.overlay.hidden=!0,g&&(document.body.style.overflow=w,g=!1,w=""),Me();const n=a;let l=d&&d!==document.body&&document.contains(d)&&d.getClientRects().length>0?d:null;if(l)try{l.focus({preventScroll:!0})}catch(e){}if(d=null,o="",h="",b="",a=null,Oe("snippet"),C++,window.__textEditorDirty=!1,n&&"function"==typeof n.onAfterClose)try{n.onAfterClose(e,!l)}catch(e){}}function Ze(e){if(!i.overlay||i.overlay.hidden)return;if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void("true"===i.card.getAttribute("data-full")?be(!1):Qe());if((e.metaKey||e.ctrlKey)&&"Enter"===e.key)return e.preventDefault(),e.stopPropagation(),void Fe();if("Tab"!==e.key)return;const t=Array.from(i.card.querySelectorAll("button:not([disabled]),input:not([disabled]),textarea:not([disabled])")).filter(e=>e.getClientRects().length>0);if(!t.length)return;const n=t[0],a=t[t.length-1];if(!i.card.contains(document.activeElement))return e.preventDefault(),void n.focus();e.shiftKey&&document.activeElement===n?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a||(e.preventDefault(),n.focus())}async function Ge(e,t){if(t=t||{},!e)return"no-file";if(D()&&!i.overlay.hidden)return"busy";if("string"==typeof e)return!!ze(e,t.name||"text.txt",t.type||"")||"no-editor";if(!Re(e))return"not-text";if(e.size>S)return"too-big";const n=++C;let a;try{a=await e.text()}catch(e){return"read-failed"}return C!==n?"superseded":D()&&!i.overlay.hidden?"busy":(65279===a.charCo
1deAt(0)&&(a=a.slice(1)),a=a.replace(/\r\n?/g,"\n"),!!ze(a,e.name||t.name||"text.txt",e.type||t.type||"")||"no-editor")}const Ve=()=>!(!i.overlay||i.overlay.hidden);function Je(){window.__textEditorDirty=!!(Ve()&&f()&&De())}window.TextEditor={open:function(e){if(e=e||{},!D())return!1;if(!i.overlay.hidden)return!1;const t="relay"===e.src?"relay":"snippet";a=e,Oe(t),h=e.name||"",b=e.type||"",i.fname&&(i.fname.textContent=h,i.fname.title=h),i.save&&i.save.classList.toggle("cled-primary","relay"===t),$e(String(null==e.text?"":e.text));let n=e.mode;if("md"!==n&&"plain"!==n)if(h)n=Be(h,b);else{n="plain";try{"md"===localStorage.getItem(ne)&&(n="md")}catch(e){}}return be(null!=e.full?!!e.full:"relay"===t),ye(n),He("snippet"===t),!0},openFile:Ge,close:Qe,isOpen:Ve,isEditable:Re},window.openTextEditorModal=Ge,window.isTextEditableFile=Re,window.textEditorOpen=Ve,window.__textEditorDirty=!1,window.addEventListener("beforeunload",e=>{if(Je(),window.__textEditorDirty)return e.preventDefault(),e.returnValue="",""})}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.