/g,">")}function oe(e,t){var n,r,i,o,s,a=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,l=[],u="",c=t||{},f=0;function v(d){var m=Mi[d[1]||""],p=l[l.length-1]==d;return m?m[1]?(p?l.pop():l.push(d),m[0|p]):m[0]:d}function h(){for(var d="";l.length;)d+=v(l[l.length-1]);return d}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(d,m,p){return c[m.toLowerCase()]=p,""}).replace(/^\n+|\n+$/g,"");i=a.exec(e);)r=e.substring(f,i.index),f=a.lastIndex,n=i[0],r.match(/[^\\](\\\\)*\\$/)||((s=i[3]||i[4])?n='
"+Yn(be(s).replace(/^\n+|\n+$/g,""))+"
":(s=i[6])?(s.match(/\./)&&(i[5]=i[5].replace(/^\d+/gm,"")),o=oe(Yn(i[5].replace(/^\s*[>*+.-]/gm,""))),s==">"?s="blockquote":(s=s.match(/\./)?"ol":"ul",o=o.replace(/^(.*)(\n|$)/gm,""+be(i[16])+"
":(i[17]||i[1])&&(n=v(i[17]||"--"))),u+=r,u+=n;return(u+e.substring(f)+h()).replace(/^\n+|\n+$/g,"")}var Mi,Qn=N(()=>{Mi={"":["",""],_:["",""],"*":["",""],"~":["${oe(s)}
`).join(` `).replace(new RegExp(n,"g"),"_").replace(new RegExp(t,"g"),"*").replace(new RegExp(r,"g"),"[[").replace(new RegExp(i,"g"),"]]")}var lt=N(()=>{Qn()});function je(e,t=()=>{}){!confirm("Inserting an image will increase your wiki's file size. Continue?")||Me("image/*",n=>{Hi(n,(r,i,o)=>{if(r){let s=tt(r);e.p.img[s.toString()]={alt:prompt("Set alt text",n.name),size:[i,o],img:r},t({img:r,id:s})}})})}function Ge(e,t,n=()=>{}){e.preventDefault(),document.getElementById("g").close(),n(t)}function Hi(e,t=()=>{}){let n=new FileReader;n.onload=r=>{let i=new Image;i.src=r.target.result,i.onload=()=>{let o=document.createElement("canvas"),s=i.width,a=i.height,l=prompt("Set max width pixels:","400");l=l!=null&&l.length?parseInt(l):400;let u=prompt("Set max height pixels:","350");u=u!=null&&u.length?parseInt(u):350,s>a?s>l&&(a*=l/s,s=l):a>u&&(s*=u/a,a=u),o.width=s,o.height=a,o.getContext("2d").drawImage(i,0,0,s,a),t(o.toDataURL(e.type),s,a)}},n.onerror=r=>{t(null)},n.readAsDataURL(e)}var ut=N(()=>{st();Le()});var nr={};Be(nr,{editor:()=>Ni});var we,Ni,rr=N(()=>{we=x(I(),1);ke();ut();Ni=e=>{let t=i=>e.edits.content=i.target.value,n=we.default``;return[n,we.default``,we.default``,we.default``];function r({id:i}){let o=`![](img:${i}:img)`;if(document.activeElement!==n&&n.focus(),document.selection){let l=document.selection.createRange();l.text=o}else if(n.selectionStart||n.selectionStart===0){var s=n.selectionStart,a=n.selectionEnd;n.value=n.value.substring(0,s)+o+n.value.substring(a,n.value.length),n.selectionStart=s+o.length,n.selectionEnd=s+o.length}else n.value+=o;t({target:n})}}});var or=b((Ue,ir)=>{(function(e,t){typeof Ue=="object"&&typeof ir!="undefined"?t(Ue):typeof define=="function"&&define.amd?define(["exports"],t):t(e.pell={})})(Ue,function(e){"use strict";var t=Object.assign||function(h){for(var d=1;d")}},quote:{icon:"“ ”",title:"Quote",result:function(){return l(r,"
")}},olist:{icon:"#",title:"Ordered List",result:function(){return l("insertOrderedList")}},ulist:{icon:"•",title:"Unordered List",result:function(){return l("insertUnorderedList")}},code:{icon:"</>",title:"Code",result:function(){return l(r,"")}},line:{icon:"―",title:"Horizontal Line",result:function(){return l("insertHorizontalRule")}},link:{icon:"🔗",title:"Link",result:function(){var h=window.prompt("Enter the link URL");h&&l("createLink",h)}},image:{icon:"📷",title:"Image",result:function(){var h=window.prompt("Enter the image URL");h&&l("insertImage",h)}}},c={actionbar:"pell-actionbar",button:"pell-button",content:"pell-content",selected:"pell-button-selected"},f=function(h){var d=h.actions?h.actions.map(function(g){return typeof g=="string"?u[g]:u[g.name]?t({},u[g.name],g):g}):Object.keys(u).map(function(g){return u[g]}),m=t({},c,h.classes),p=h[n]||"div",E=s("div");E.className=m.actionbar,o(h.element,E);var y=h.element.content=s("div");return y.contentEditable=!0,y.className=m.content,y.oninput=function(g){var w=g.target.firstChild;w&&w.nodeType===3?l(r,"<"+p+">"):y.innerHTML==="
"&&(y.innerHTML=""),h.onChange(y.innerHTML)},y.onkeydown=function(g){var w;g.key==="Enter"&&(w=r,document.queryCommandValue(w)==="blockquote")&&setTimeout(function(){return l(r,"<"+p+">")},0)},o(h.element,y),d.forEach(function(g){var w=s("button");if(w.className=m.button,w.innerHTML=g.icon,w.title=g.title,w.setAttribute("type","button"),w.onclick=function(){return g.result()&&y.focus()},g.state){var P=function(){return w.classList[g.state()?"add":"remove"](m.selected)};i(y,"keyup",P),i(y,"mouseup",P),i(w,"click",P)}o(E,w)}),h.styleWithCSS&&l("styleWithCSS"),l(n,p),h.element},v={exec:l,init:f};e.exec=l,e.init=f,e.default=v,Object.defineProperty(e,"__esModule",{value:!0})})});var sr={};Be(sr,{editor:()=>Vi});var Ee,K,Vi,ar=N(()=>{Ee=x(I(),1),K=x(or(),1);ke();Fe();ut();Vi=(e,t)=>{let{src:n,edits:r}=e,{content:i}=r,o=Ne(i,e,!0),s;if(n)s=Ee.default``;else{s=Ee.default``;let u="formatBlock",c=(0,K.init)({element:s,onChange:f=>e.edits.content=f,defaultParagraphSeparator:"p",actions:["bold","italic","underline","strikethrough",{title:"Heading",icon:"H",result:()=>(0,K.exec)(u,"")},{title:"Sub-Heading",icon:"H2",result:()=>(0,K.exec)(u,"
`)}function l(u){u.preventDefault(),e.src=!n,t(e.events.RENDER)}}});var hr=x(cn(),1);Le();var he=-1;function nt(e,t,n){typeof t=="boolean"?(n=t,t=void 0):n=typeof n!="undefined"?n:!1,typeof t=="undefined"&&(he=-1);var r=t||[],i;return rt(e)?(vi(e,r,n),i=e):i=bi(e,r,n),i}function pe(e){var t,n=JSON.parse(JSON.stringify(e));return rt(n)?yi(n):t=wi(n),t?JSON.parse(t):n}function fn(e,t){var n,r=e.length;for(n=0;n")},"paragraph","olist","ulist","quote","line","link",{title:"Link External Image",icon:"\u{1F5BC}\uFE0F",result:()=>{let f=window.prompt("Enter the image URL");f&&(0,K.exec)("insertImage",f)}},{title:"Insert Image from File",icon:"\u{1F4F8}",result:()=>je(e,a)},{title:"Add Existing Image",icon:"\u{1F4CE}",result:()=>document.getElementById("g").showModal()}]});c.content.innerHTML=o}return s.isSameNode=u=>(u==null?void 0:u.nodeName)===(s==null?void 0:s.nodeName)&&i.length,[s,Ee.default`
`,Ee.default``];function a(u){let c=s.children[1];document.activeElement!==c&&c.focus(),(0,K.exec)("insertHTML",`(t[n[0]]=n[1],t),{})}function pn(e,t,n=0){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=_!?()*",i=[],o=e;for(t=t||r.length;o>=t;)i.push(r.charCodeAt(o%t+n)),o=Math.floor(o/t-1);return i.push(r.charCodeAt(o+n)),i.reverse()}function dn(e){return String.fromCharCode.apply(String,e)}function mn(e,t){var n,r,i;for(r in e)typeof e[r]!="undefined"&&(i=e[r],(mi(i)||rt(i))&&(t=t.concat(hn(mn(i,t)))),isNaN(Number(r))&&(fn(t,r)||(he+=1,n=[dn(pn(he)),r],t.push(n))));return t}function gn(e){var t,n=e.length,r={};for(t=0;t {var t,n;e.root=location.pathname,e.root.length<1&&(e.root="/"),e.sb=!1,e.sbTab="Pages",e.recent=[],e.edit=!1,e.edits=null,e.keep=!1,e.src=!1,e.help={find:(r,i="slug")=>e.p.pages.find(o=>o[i]===r),getPage:()=>{let{query:r,help:i,p:o}=e;return!r.page&&o.home?i.find(o.home,"id"):i.find(r.page)},getParent:r=>e.p.pages.find(i=>i.id===(r==null?void 0:r.parent)),getChildren:r=>e.p.pages.filter(i=>i.parent===(r==null?void 0:r.id)),breadcrumb:r=>{let i=[],o=e.help.getParent(r);for(;o;)i.push(o),o=e.help.getParent(o);return i}},e.events=_e(Y({},e.events),{HANDLE_404:"404",CREATE_PAGE:"cp",START_EDIT:"se",UPDATE_PAGE:"up",DELETE_PAGE:"dp",COLLECT_TAGS:"ct",CHECK_CHANGED:"cc",SAVE_WIKI:"sw"}),e.a=document.getElementById("a").innerHTML,e.s=document.getElementById("s").innerHTML,e.c=(n=(t=document.getElementById("c"))==null?void 0:t.innerHTML)!=null?n:"";try{e.p=pe(JSON.parse(document.getElementById("p").innerHTML))}catch(r){e.p={name:"New Wiki",desc:"",pages:[],img:{}}}return e.pg=e.help.getPage(),e.t=[],e.prev=fe(e.p),e.now=e.prev,e.changed=!1,e};function bn(e){let{a:t,s:n,c:r,p:i}=e;return` ${i.name} ${i.desc?``:""} ${r?``:""} JavaScript is required