js html sanitize, updated config, gravatar support, layout change

This commit is contained in:
Matthew Scragg 2013-10-03 20:19:33 -05:00
parent afa4da4869
commit 27ced9d90e
12 changed files with 234 additions and 21 deletions

4
app.py
View file

@ -1,8 +1,8 @@
from gevent import monkey, pywsgi
monkey.patch_all()
import logging
from realms import app
from realms import app, config
if __name__ == '__main__':
app.logger.setLevel(logging.INFO)
pywsgi.WSGIServer(('', 10000), app).serve_forever()
pywsgi.WSGIServer(('', config.port), app).serve_forever()

View file

@ -11,10 +11,10 @@ from flask.ext.assets import Environment
from recaptcha.client import captcha
from werkzeug.routing import BaseConverter
import config
from session import RedisSessionInterface
import config
from wiki import Wiki
from util import to_canonical, remove_ext, mkdir_safe
from util import to_canonical, remove_ext, mkdir_safe, gravatar_url
class RegexConverter(BaseConverter):
@ -61,6 +61,7 @@ from models import Site, User, CurrentUser
def load_user(user_id):
return CurrentUser(user_id)
w = Wiki(main_repo_dir)
@ -97,10 +98,28 @@ def root():
return render('home')
#return redirect('/home')
@app.route("/account/")
def account():
return render_template('account/index.html')
@app.route("/_new/", methods=['GET', 'POST'])
def new_wiki():
if request.method == 'POST':
# TODO validate wiki name
wiki_name = request.form['name']
s = Site()
if s.get_by_name(wiki_name):
flash("Site already exists")
return redirect(redirect_url())
else:
Wiki(repo_dir + "/" + wiki_name)
return redirect('http://%s.%s' % (wiki_name, config.hostname))
else:
return render_template('_new/index.html')
@app.route("/logout/")
def logout():
logout_user()
@ -135,11 +154,13 @@ def register():
flash('Username is already taken')
return redirect('/register')
email = request.form['email'].lower()
# Create user and login
u = User.create(email=request.form['email'].lower(),
u = User.create(email=email,
username=request.form['username'],
password=bcrypt.generate_password_hash(request.form['password']))
login_user(u)
password=bcrypt.generate_password_hash(request.form['password']),
avatar=gravatar_url(email))
login_user(CurrentUser(u.id))
return redirect("/")
else:
return render_template('account/register.html')

View file

@ -36,6 +36,9 @@ class BaseModel(RethinkModel):
class Site(BaseModel):
table = 'sites'
def get_by_name(self, name):
return to_dict(self.get_one(name, 'name'), True)
class CurrentUser():
id = None

View file

@ -1,8 +1,16 @@
body {
padding-top: 50px;
padding-top: 43px;
background-color:#eee;
}
.navbar {
min-height: inherit;
}
.navbar .container a {
padding-top: 10px;
padding-bottom: 10px;
}
#main-body {
background-color: #fff;
padding: 20px;
@ -11,6 +19,7 @@ body {
border-radius: 0 0 6px 6px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
box-shadow: 0 1px 2px rgba(0,0,0,.15);
padding-top: 10px;
}
.checkbox-cell {
@ -80,8 +89,8 @@ body {
}
.user-avatar a img {
width: 32px;
height: 32px;
width: 24px;
height: 24px;
-webkit-box-shadow: 0 1px 3px #1e1e1e;
-moz-box-shadow: 0 1px 3px #1e1e1e;
box-shadow: 0 1px 3px #1e1e1e;
@ -94,7 +103,7 @@ body {
.navbar-nav .user-avatar a {
line-height: 30px;
}
.navbar-nav>li.user-avatar a {

View file

@ -532,11 +532,11 @@ $(function(){
function previewMd(){
var unmd = editor.getSession().getValue()
, md = converter(unmd)
, md = converter(unmd);
$preview
.html('') // unnecessary?
.html(md)
.html(html_sanitize(md));
refreshWordCount();
}

View file

@ -0,0 +1,91 @@
(function(){var c=void 0,m=!0,r=null,w=!1,H,K=["aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow,yellowgreen".split(","),
"all-scroll,col-resize,crosshair,default,e-resize,hand,help,move,n-resize,ne-resize,no-drop,not-allowed,nw-resize,pointer,progress,row-resize,s-resize,se-resize,sw-resize,text,vertical-text,w-resize,wait".split(","),"armenian,decimal,decimal-leading-zero,disc,georgian,lower-alpha,lower-greek,lower-latin,lower-roman,square,upper-alpha,upper-latin,upper-roman".split(","),"100,200,300,400,500,600,700,800,900,bold,bolder,lighter".split(","),"block-level,inline-level,table-caption,table-cell,table-column,table-column-group,table-footer-group,table-header-group,table-row,table-row-group".split(","),
"condensed,expanded,extra-condensed,extra-expanded,narrower,semi-condensed,semi-expanded,ultra-condensed,ultra-expanded,wider".split(","),"inherit,inline,inline-block,inline-box,inline-flex,inline-grid,inline-list-item,inline-stack,inline-table,run-in".split(","),"behind,center-left,center-right,far-left,far-right,left-side,leftwards,right-side,rightwards".split(","),"large,larger,small,smaller,x-large,x-small,xx-large,xx-small".split(","),"dashed,dotted,double,groove,outset,ridge,solid".split(","),
"ease,ease-in,ease-in-out,ease-out,linear,step-end,step-start".split(","),"at,closest-corner,closest-side,ellipse,farthest-corner,farthest-side".split(","),"baseline,middle,sub,super,text-bottom,text-top".split(","),"caption,icon,menu,message-box,small-caption,status-bar".split(","),"fast,faster,slow,slower,x-fast,x-slow".split(","),["above","below","higher","level","lower"],["cursive","fantasy","monospace","sans-serif","serif"],["loud","silent","soft","x-loud","x-soft"],["no-repeat","repeat-x","repeat-y",
"round","space"],["blink","line-through","overline","underline"],["block","flex","grid","table"],["high","low","x-high","x-low"],["nowrap","pre","pre-line","pre-wrap"],["absolute","relative","static"],["alternate","alternate-reverse","reverse"],["border-box","content-box","padding-box"],["capitalize","lowercase","uppercase"],["child","female","male"],["=","opacity"],["backwards","forwards"],["bidi-override","embed"],["bottom","top"],["break-all","keep-all"],["clip","ellipsis"],["contain","cover"],
["continuous","digits"],["end","start"],["flat","preserve-3d"],["hide","show"],["inside","outside"],["italic","oblique"],["left","right"],["ltr","rtl"],["no-content","no-display"],["paused","running"],["suppress","unrestricted"],["thick","thin"],[","],["/"],["all"],["always"],["auto"],["avoid"],["both"],["break-word"],["center"],["circle"],["code"],["collapse"],["contents"],["fixed"],["hidden"],["infinite"],["inset"],["invert"],["justify"],["list-item"],["local"],["medium"],["mix"],["none"],["normal"],
["once"],["repeat"],["scroll"],["separate"],["small-caps"],["spell-out"],["to"],["transparent"],["visible"]],T={animation:{cssPropBits:517,cssLitGroup:[K[10],K[24],K[29],K[44],K[47],K[53],K[62],K[70],K[71]],cssFns:["cubic-bezier()","steps()"]},"animation-delay":{cssPropBits:5,cssLitGroup:[K[47]],cssFns:[]},"animation-direction":{cssPropBits:0,cssLitGroup:[K[24],K[47],K[71]],cssFns:[]},"animation-duration":"animation-delay","animation-fill-mode":{cssPropBits:0,cssLitGroup:[K[29],K[47],K[53],K[70]],
cssFns:[]},"animation-iteration-count":{cssPropBits:5,cssLitGroup:[K[47],K[62]],cssFns:[]},"animation-name":{cssPropBits:512,cssLitGroup:[K[47],K[70]],cssFns:[]},"animation-play-state":{cssPropBits:0,cssLitGroup:[K[44],K[47]],cssFns:[]},"animation-timing-function":{cssPropBits:0,cssLitGroup:[K[10],K[47]],cssFns:["cubic-bezier()","steps()"]},azimuth:{cssPropBits:5,cssLitGroup:[K[7],K[41],K[55]],cssFns:[]},"backface-visibility":{cssPropBits:0,cssLitGroup:[K[58],K[61],K[80]],cssFns:[]},background:{cssPropBits:23,
cssLitGroup:[K[0],K[18],K[25],K[31],K[34],K[41],K[47],K[48],K[51],K[55],K[60],K[67],K[70],K[73],K[74],K[79]],cssFns:"image(),linear-gradient(),radial-gradient(),repeating-linear-gradient(),repeating-radial-gradient(),rgb(),rgba()".split(",")},"background-attachment":{cssPropBits:0,cssLitGroup:[K[47],K[60],K[67],K[74]],cssFns:[]},"background-color":{cssPropBits:258,cssLitGroup:[K[0],K[79]],cssFns:["rgb()","rgba()"]},"background-image":{cssPropBits:16,cssLitGroup:[K[47],K[70]],cssFns:["image()","linear-gradient()",
"radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"background-position":{cssPropBits:5,cssLitGroup:[K[31],K[41],K[47],K[55]],cssFns:[]},"background-repeat":{cssPropBits:0,cssLitGroup:[K[18],K[47],K[73]],cssFns:[]},border:{cssPropBits:7,cssLitGroup:[K[0],K[9],K[46],K[61],K[63],K[68],K[70],K[79]],cssFns:["rgb()","rgba()"]},"border-bottom":"border","border-bottom-color":{cssPropBits:2,cssLitGroup:[K[0],K[79]],cssFns:["rgb()","rgba()"]},"border-bottom-left-radius":{cssPropBits:5,
cssFns:[]},"border-bottom-right-radius":"border-bottom-left-radius","border-bottom-style":{cssPropBits:0,cssLitGroup:[K[9],K[61],K[63],K[70]],cssFns:[]},"border-bottom-width":{cssPropBits:5,cssLitGroup:[K[46],K[68]],cssFns:[]},"border-collapse":{cssPropBits:0,cssLitGroup:[K[58],K[75]],cssFns:[]},"border-color":"border-bottom-color","border-left":"border","border-left-color":"border-bottom-color","border-left-style":"border-bottom-style","border-left-width":"border-bottom-width","border-radius":{cssPropBits:5,
cssLitGroup:[K[48]],cssFns:[]},"border-right":"border","border-right-color":"border-bottom-color","border-right-style":"border-bottom-style","border-right-width":"border-bottom-width","border-spacing":"border-bottom-left-radius","border-style":"border-bottom-style","border-top":"border","border-top-color":"border-bottom-color","border-top-left-radius":"border-bottom-left-radius","border-top-right-radius":"border-bottom-left-radius","border-top-style":"border-bottom-style","border-top-width":"border-bottom-width",
"border-width":"border-bottom-width",bottom:{cssPropBits:5,cssLitGroup:[K[51]],cssFns:[]},box:{cssPropBits:0,cssLitGroup:[K[59],K[70],K[71]],cssFns:[]},"box-shadow":{cssPropBits:7,cssLitGroup:[K[0],K[47],K[63],K[70]],cssFns:["rgb()","rgba()"]},"box-sizing":{cssPropBits:0,cssLitGroup:[K[25]],cssFns:[]},"caption-side":{cssPropBits:0,cssLitGroup:[K[31]],cssFns:[]},clear:{cssPropBits:0,cssLitGroup:[K[41],K[53],K[70]],cssFns:[]},clip:{cssPropBits:0,cssLitGroup:[K[51]],cssFns:["rect()"]},color:{cssPropBits:258,
cssLitGroup:[K[0]],cssFns:["rgb()","rgba()"]},content:{cssPropBits:8,cssLitGroup:[K[70],K[71]],cssFns:[]},cue:{cssPropBits:16,cssLitGroup:[K[70]],cssFns:[]},"cue-after":"cue","cue-before":"cue",cursor:{cssPropBits:272,cssLitGroup:[K[1],K[47],K[51]],cssFns:[]},direction:{cssPropBits:0,cssLitGroup:[K[42]],cssFns:[]},display:{cssPropBits:32,cssLitGroup:[K[4],K[6],K[20],K[51],K[66],K[70]],cssFns:[]},"display-extras":{cssPropBits:0,cssLitGroup:[K[66],K[70]],cssFns:[]},"display-inside":{cssPropBits:0,cssLitGroup:[K[20],
K[51]],cssFns:[]},"display-outside":{cssPropBits:0,cssLitGroup:[K[4],K[70]],cssFns:[]},elevation:{cssPropBits:5,cssLitGroup:[K[15]],cssFns:[]},"empty-cells":{cssPropBits:0,cssLitGroup:[K[38]],cssFns:[]},filter:{cssPropBits:32,cssFns:["alpha()"]},"float":{cssPropBits:32,cssLitGroup:[K[41],K[70]],cssFns:[]},font:{cssPropBits:73,cssLitGroup:[K[3],K[8],K[13],K[16],K[40],K[47],K[48],K[68],K[71],K[76]],cssFns:[]},"font-family":{cssPropBits:72,cssLitGroup:[K[16],K[47]],cssFns:[]},"font-size":{cssPropBits:1,
cssLitGroup:[K[8],K[68]],cssFns:[]},"font-stretch":{cssPropBits:0,cssLitGroup:[K[5],K[71]],cssFns:[]},"font-style":{cssPropBits:0,cssLitGroup:[K[40],K[71]],cssFns:[]},"font-variant":{cssPropBits:0,cssLitGroup:[K[71],K[76]],cssFns:[]},"font-weight":{cssPropBits:0,cssLitGroup:[K[3],K[71]],cssFns:[]},height:{cssPropBits:37,cssLitGroup:[K[51]],cssFns:[]},left:"height","letter-spacing":{cssPropBits:5,cssLitGroup:[K[71]],cssFns:[]},"line-height":{cssPropBits:1,cssLitGroup:[K[71]],cssFns:[]},"list-style":{cssPropBits:16,
cssLitGroup:[K[2],K[39],K[56],K[70]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"list-style-image":{cssPropBits:16,cssLitGroup:[K[70]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"list-style-position":{cssPropBits:0,cssLitGroup:[K[39]],cssFns:[]},"list-style-type":{cssPropBits:0,cssLitGroup:[K[2],K[56],K[70]],cssFns:[]},margin:"bottom","margin-bottom":"bottom",
"margin-left":"bottom","margin-right":"bottom","margin-top":"bottom","max-height":{cssPropBits:1,cssLitGroup:[K[51],K[70]],cssFns:[]},"max-width":"max-height","min-height":{cssPropBits:1,cssLitGroup:[K[51]],cssFns:[]},"min-width":"min-height",opacity:{cssPropBits:33,cssFns:[]},outline:{cssPropBits:7,cssLitGroup:[K[0],K[9],K[46],K[61],K[63],K[64],K[68],K[70]],cssFns:["rgb()","rgba()"]},"outline-color":{cssPropBits:2,cssLitGroup:[K[0],K[64]],cssFns:["rgb()","rgba()"]},"outline-style":"border-bottom-style",
"outline-width":"border-bottom-width",overflow:{cssPropBits:32,cssLitGroup:[K[51],K[61],K[74],K[80]],cssFns:[]},"overflow-wrap":{cssPropBits:0,cssLitGroup:[K[54],K[71]],cssFns:[]},"overflow-x":{cssPropBits:0,cssLitGroup:[K[43],K[51],K[61],K[74],K[80]],cssFns:[]},"overflow-y":"overflow-x",padding:{cssPropBits:1,cssFns:[]},"padding-bottom":"opacity","padding-left":"opacity","padding-right":"opacity","padding-top":"opacity","page-break-after":{cssPropBits:0,cssLitGroup:[K[41],K[50],K[51],K[52]],cssFns:[]},
"page-break-before":"page-break-after","page-break-inside":{cssPropBits:0,cssLitGroup:[K[51],K[52]],cssFns:[]},pause:"border-bottom-left-radius","pause-after":"border-bottom-left-radius","pause-before":"border-bottom-left-radius",perspective:{cssPropBits:5,cssLitGroup:[K[70]],cssFns:[]},"perspective-origin":{cssPropBits:5,cssLitGroup:[K[31],K[41],K[55]],cssFns:[]},pitch:{cssPropBits:5,cssLitGroup:[K[21],K[68]],cssFns:[]},"pitch-range":"border-bottom-left-radius","play-during":{cssPropBits:16,cssLitGroup:[K[51],
K[69],K[70],K[73]],cssFns:[]},position:{cssPropBits:32,cssLitGroup:[K[23]],cssFns:[]},quotes:{cssPropBits:8,cssLitGroup:[K[70]],cssFns:[]},richness:"border-bottom-left-radius",right:"height",speak:{cssPropBits:0,cssLitGroup:[K[70],K[71],K[77]],cssFns:[]},"speak-header":{cssPropBits:0,cssLitGroup:[K[50],K[72]],cssFns:[]},"speak-numeral":{cssPropBits:0,cssLitGroup:[K[35]],cssFns:[]},"speak-punctuation":{cssPropBits:0,cssLitGroup:[K[57],K[70]],cssFns:[]},"speech-rate":{cssPropBits:5,cssLitGroup:[K[14],
K[68]],cssFns:[]},stress:"border-bottom-left-radius","table-layout":{cssPropBits:0,cssLitGroup:[K[51],K[60]],cssFns:[]},"text-align":{cssPropBits:0,cssLitGroup:[K[41],K[55],K[65]],cssFns:[]},"text-decoration":{cssPropBits:0,cssLitGroup:[K[19],K[70]],cssFns:[]},"text-indent":"border-bottom-left-radius","text-overflow":{cssPropBits:0,cssLitGroup:[K[33]],cssFns:[]},"text-shadow":"box-shadow","text-transform":{cssPropBits:0,cssLitGroup:[K[26],K[70]],cssFns:[]},"text-wrap":{cssPropBits:0,cssLitGroup:[K[45],
K[70],K[71]],cssFns:[]},top:"height",transform:{cssPropBits:0,cssLitGroup:[K[70]],cssFns:"matrix(),perspective(),rotate(),rotate3d(),rotatex(),rotatey(),rotatez(),scale(),scale3d(),scalex(),scaley(),scalez(),skew(),skewx(),skewy(),translate(),translate3d(),translatex(),translatey(),translatez()".split(",")},"transform-origin":"perspective-origin","transform-style":{cssPropBits:0,cssLitGroup:[K[37]],cssFns:[]},transition:{cssPropBits:1029,cssLitGroup:[K[10],K[47],K[49],K[70]],cssFns:["cubic-bezier()",
"steps()"]},"transition-delay":"animation-delay","transition-duration":"animation-delay","transition-property":{cssPropBits:1024,cssLitGroup:[K[47],K[49]],cssFns:[]},"transition-timing-function":"animation-timing-function","unicode-bidi":{cssPropBits:0,cssLitGroup:[K[30],K[71]],cssFns:[]},"vertical-align":{cssPropBits:5,cssLitGroup:[K[12],K[31]],cssFns:[]},visibility:{cssPropBits:32,cssLitGroup:[K[58],K[61],K[80]],cssFns:[]},"voice-family":{cssPropBits:8,cssLitGroup:[K[27],K[47]],cssFns:[]},volume:{cssPropBits:1,
cssLitGroup:[K[17],K[68]],cssFns:[]},"white-space":{cssPropBits:0,cssLitGroup:[K[22],K[71]],cssFns:[]},width:{cssPropBits:33,cssLitGroup:[K[51]],cssFns:[]},"word-break":{cssPropBits:0,cssLitGroup:[K[32],K[71]],cssFns:[]},"word-spacing":"letter-spacing","word-wrap":"overflow-wrap","z-index":"bottom",zoom:"line-height","cubic-bezier()":"animation-delay","steps()":{cssPropBits:5,cssLitGroup:[K[36],K[47]],cssFns:[]},"image()":{cssPropBits:18,cssLitGroup:[K[0],K[47]],cssFns:["rgb()","rgba()"]},"linear-gradient()":{cssPropBits:7,
cssLitGroup:[K[0],K[31],K[41],K[47],K[78]],cssFns:["rgb()","rgba()"]},"radial-gradient()":{cssPropBits:7,cssLitGroup:[K[0],K[11],K[31],K[41],K[47],K[55],K[56]],cssFns:["rgb()","rgba()"]},"repeating-linear-gradient()":"linear-gradient()","repeating-radial-gradient()":"radial-gradient()","rgb()":{cssPropBits:1,cssLitGroup:[K[47]],cssFns:[]},"rgba()":"rgb()","rect()":{cssPropBits:5,cssLitGroup:[K[47],K[51]],cssFns:[]},"alpha()":{cssPropBits:1,cssLitGroup:[K[28]],cssFns:[]},"matrix()":"animation-delay",
"perspective()":"border-bottom-left-radius","rotate()":"border-bottom-left-radius","rotate3d()":"animation-delay","rotatex()":"border-bottom-left-radius","rotatey()":"border-bottom-left-radius","rotatez()":"border-bottom-left-radius","scale()":"animation-delay","scale3d()":"animation-delay","scalex()":"border-bottom-left-radius","scaley()":"border-bottom-left-radius","scalez()":"border-bottom-left-radius","skew()":"animation-delay","skewx()":"border-bottom-left-radius","skewy()":"border-bottom-left-radius",
"translate()":"animation-delay","translate3d()":"animation-delay","translatex()":"border-bottom-left-radius","translatey()":"border-bottom-left-radius","translatez()":"border-bottom-left-radius"},X;for(X in T)"string"===typeof T[X]&&Object.hasOwnProperty.call(T,X)&&(T[X]=T[T[X]]);H=T;"undefined"!==typeof window&&(window.cssSchema=H);var aa,ba;
(function(){function g(b){var d=parseInt(b.substring(1),16);return 65535<d?(d-=65536,String.fromCharCode(55296+(d>>10),56320+(d&1023))):d==d?String.fromCharCode(d):" ">b[1]?"":b[1]}function N(b,d){return'"'+b.replace(/[\u0000-\u001f\\\"<>]/g,d)+'"'}function O(b){return G[b]||(G[b]="\\"+b.charCodeAt(0).toString(16)+" ")}function A(b){return f[b]||(f[b]=("\u0010">b?"%0":"%")+b.charCodeAt(0).toString(16))}var G={"\\":"\\\\"},f={"\\":"%5c"},j=RegExp("\\uFEFF|U[+][0-9A-F?]{1,6}(?:-[0-9A-F]{1,6})?|url[(][\\t\\n\\f ]*(?:\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|(?:[\\t\\x21\\x23-\\x26\\x28-\\x5b\\x5d-\\x7e]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)[\\t\\n\\f ]*[)]|(?!url[(])-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*[(]|(?:@?-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))|#)(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*|\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|[-+]?(?:[0-9]+(?:[.][0-9]+)?|[.][0-9]+)(?:%|-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)?|<\!--|--\>|[\\t\\n\\f ]+|/(?:[*][^*]*[*]+(?:[^/][^*]*[*]+)*/|/[^\\n\\f]*)|[~|^$*]=|[^\"'\\\\/]|/(?![/*])","gi"),
d=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),b=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");ba=function(b){return b.replace(d,g)};aa=function(d){for(var d=(""+d).replace(/\r\n?/g,"\n").match(j)||[],g=0,e=" ",a=0,L=d.length;a<L;++a){var l=ba(d[a]),p=l.length,U=l.charCodeAt(0),l=34==U||39==U?N(l.substring(1,p-1),O):47==U&&1<p||"\\"==l||"--\>"==l||"<\!--"==l||"\ufeff"==l||32>=
U?" ":/url\(/i.test(l)?"url("+N(l.replace(b,""),A)+")":l;if(e!=l||" "!=l)d[g++]=e=l}d.length=g;return d}})();"undefined"!==typeof window&&(window.lexCss=aa,window.decodeCss=ba);var ca=function(){function g(a){a=(""+a).match(I);return!a?r:new f(j(a[1]),j(a[2]),j(a[3]),j(a[4]),j(a[5]),j(a[6]),j(a[7]))}function N(a,b){return"string"==typeof a?encodeURI(a).replace(b,O):r}function O(a){a=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function A(a){if(a===r)return r;for(var a=a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/"),b=d,l;(l=a.replace(b,"$1"))!=a;a=l);return a}function G(a,d){var l=a.U(),p=d.L();p?l.ka(d.j):p=d.Z();
p?l.ha(d.n):p=d.$();p?l.ia(d.k):p=d.ba();var g=d.g,e=A(g);if(p)l.ga(d.X()),e=e&&e.replace(b,"");else if(p=!!g){if(47!==e.charCodeAt(0))var e=A(l.g||"").replace(b,""),h=e.lastIndexOf("/")+1,e=A((h?e.substring(0,h):"")+A(g)).replace(b,"")}else e=e&&e.replace(b,""),e!==g&&l.G(e);p?l.G(e):p=d.ca();p?l.P(d.l):p=d.aa();p&&l.ja(d.o);return l}function f(a,b,d,e,g,h,I){this.j=a;this.n=b;this.k=d;this.h=e;this.g=g;this.l=h;this.o=I}function j(a){return"string"==typeof a&&0<a.length?a:r}var d=RegExp(/(\/|^)(?:[^./][^/]*|\.{2,}(?:[^./][^/]*)|\.{3,}[^/]*)\/\.\.(?:\/|$)/),
b=/^(?:\.\.\/)*(?:\.\.$)?/;f.prototype.toString=function(){var a=[];r!==this.j&&a.push(this.j,":");r!==this.k&&(a.push("//"),r!==this.n&&a.push(this.n,"@"),a.push(this.k),r!==this.h&&a.push(":",this.h.toString()));r!==this.g&&a.push(this.g);r!==this.l&&a.push("?",this.l);r!==this.o&&a.push("#",this.o);return a.join("")};f.prototype.U=function(){return new f(this.j,this.n,this.k,this.h,this.g,this.l,this.o)};f.prototype.Y=function(){return this.j&&decodeURIComponent(this.j).toLowerCase()};f.prototype.ka=
function(a){this.j=a?a:r};f.prototype.L=function(){return r!==this.j};f.prototype.ha=function(a){this.n=a?a:r};f.prototype.Z=function(){return r!==this.n};f.prototype.ia=function(a){this.k=a?a:r;this.G(this.g)};f.prototype.$=function(){return r!==this.k};f.prototype.X=function(){return this.h&&decodeURIComponent(this.h)};f.prototype.ga=function(a){if(a){a=Number(a);if(a!==(a&65535))throw Error("Bad port number "+a);this.h=""+a}else this.h=r};f.prototype.ba=function(){return r!==this.h};f.prototype.W=
function(){return this.g&&decodeURIComponent(this.g)};f.prototype.G=function(a){a?(a=""+a,this.g=!this.k||/^\//.test(a)?a:"/"+a):this.g=r};f.prototype.P=function(a){this.l=a?a:r};f.prototype.ca=function(){return r!==this.l};f.prototype.fa=function(a){if("object"===typeof a&&!(a instanceof Array)&&(a instanceof Object||"[object Array]"!==Object.prototype.toString.call(a))){var b=[],d=-1,e;for(e in a){var g=a[e];"string"===typeof g&&(b[++d]=e,b[++d]=g)}a=b}for(var b=[],d="",h=0;h<a.length;)e=a[h++],
g=a[h++],b.push(d,encodeURIComponent(e.toString())),d="&",g&&b.push("=",encodeURIComponent(g.toString()));this.l=b.join("")};f.prototype.ja=function(a){this.o=a?a:r};f.prototype.aa=function(){return r!==this.o};var I=/^(?:([^:/?#]+):)?(?:\/\/(?:([^/?#]*)@)?([^/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,h=/[#\/\?@]/g,e=/[\#\?]/g;f.parse=g;f.create=function(a,b,d,g,I,Q,Y){a=new f(N(a,h),N(b,h),"string"==typeof d?encodeURIComponent(d):r,0<g?g.toString():r,N(I,e),r,"string"==typeof Y?
encodeURIComponent(Y):r);Q&&("string"===typeof Q?a.P(Q.replace(/[^?&=0-9A-Za-z_\-~.%]/g,O)):a.fa(Q));return a};f.O=G;f.qa=A;f.la={xa:function(a){return/\.html$/.test(g(a).W())?"text/html":"application/javascript"},O:function(a,b){return a?G(g(a),g(b)).toString():""+b}};return f}();"undefined"!==typeof window&&(window.URI=ca);var fa=c,ga=c,ha=c,ia=c;
(function(){function g(a){return"string"===typeof a?'url("'+a.replace(f,N)+'")':'url("about:blank")'}function N(a){return j[a]}function O(a,b){return a?ca.la.O(a,b):b}function A(a,e,g){if(!g)return r;var h=(""+a).match(d);return h&&(!h[1]||b.test(h[1]))?g(a,e):r}function G(a){return a.replace(/^-(?:apple|css|epub|khtml|moz|mso?|o|rim|wap|webkit|xv)-(?=[a-z])/,"")}var f=/[\n\f\r\"\'()*<>]/g,j={"\n":"%0a","\u000c":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a","<":"%3c",">":"%3e"},
d=/^(?:([^:/?# ]+):)?/,b=/^(?:https?|mailto)$/i;fa=function(){var a={};return function l(b,d,e,h,I){var b=G(b),f=H[b];if(!f||"object"!==typeof f)d.length=0;else{for(var o=f.cssPropBits,n=o&80,k=o&1536,s=NaN,B=0,x=0;B<d.length;++B){var i=d[B].toLowerCase(),y=i.charCodeAt(0),V,D,R,j,z,da;if(32===y)i="";else if(34===y)i=16===n?e?g(A(O(h,ba(d[B].substring(1,i.length-1))),b,e)):"":o&8&&!(n&n-1)?i:"";else if("inherit"!==i){if(z=f.cssLitGroup){var F;if(!(F=f.cssLitMap)){F={};for(var v=z.length;0<=--v;)for(var P=
z[v],ea=P.length;0<=--ea;)F[P[ea]]=a;F=f.cssLitMap=F}z=F}else z=a;if(!(da=z,da[G(i)]===a))if(35===y&&/^#(?:[0-9a-f]{3}){1,2}$/.test(i))i=o&2?i:"";else if(48<=y&&57>=y)i=o&1?i:"";else if(V=i.charCodeAt(1),D=i.charCodeAt(2),R=48<=V&&57>=V,j=48<=D&&57>=D,43===y&&(R||46===V&&j))i=o&1?(R?"":"0")+i.substring(1):"";else if(45===y&&(R||46===V&&j))i=o&4?(R?"-":"-0")+i.substring(1):o&1?"0":"";else if(46===y&&R)i=o&1?"0"+i:"";else if('url("'===i.substring(0,5))i=e&&o&16?g(A(O(h,d[B].substring(5,i.length-2)),
b,e)):"";else if("("===i.charAt(i.length-1))a:{z=d;F=B;i=1;v=F+1;for(y=z.length;v<y&&i;)P=z[v++],i+=")"===P?-1:/^[^"']*\($/.test(P);if(!i){i=z[F].toLowerCase();y=G(i);z=z.splice(F,v-F,"");F=f.cssFns;v=0;for(P=F.length;v<P;++v)if(F[v].substring(0,y.length)==y){z[0]=z[z.length-1]="";l(F[v],z,e,h);i=i+z.join(" ")+")";break a}}i=""}else i=k&&/^-?[a-z_][\w\-]*$/.test(i)&&!/__$/.test(i)?I&&512===k?d[B]+I:1024===k&&H[i]&&"number"===typeof H[i].V?i:"":/^\w+$/.test(i)&&64===n&&o&8?s+1===x?(d[s]=d[s].substring(0,
d[s].length-1)+" "+i+'"',""):(s=x,'"'+i+'"'):""}i&&(d[x++]=i)}1===x&&'url("about:blank")'===d[0]&&(x=0);d.length=x}}}();var I=RegExp("^(active|after|before|blank|checked|default|disabled|drop|empty|enabled|first|first-child|first-letter|first-line|first-of-type|fullscreen|focus|hover|in-range|indeterminate|invalid|last-child|last-of-type|left|link|only-child|only-of-type|optional|out-of-range|placeholder-shown|read-only|read-write|required|right|root|scope|user-error|valid)$"),h=/^(link|visited)$/,
e={};e[">"]=e["+"]=e["~"]=e;ga=function(a,b,d){function g(p,k){function i(d,e,g){var i,l,f,W,t,J=m;i="";if(d<e)if(t=a[d],"*"===t)++d,i=t;else if(/^[a-zA-Z]/.test(t)&&(l=j(t.toLowerCase(),[])))"tagName"in l&&(t=l.tagName),++d,i=t;for(W=f=l="";J&&d<e;++d)if(t=a[d],"#"===t.charAt(0))/^#_|__$|[^\w#:\-]/.test(t)?J=w:l+=t+Q;else if("."===t)++d<e&&/^[0-9A-Za-z:_\-]+$/.test(t=a[d])&&!/^_|__$/.test(t)?l+="."+t:J=w;else if(d+1<e&&"["===a[d]){++d;var M=a[d++].toLowerCase();t=$.m[i+"::"+M];t!==+t&&(t=$.m["*::"+
M]);var q;b.ma?(q=b.ma(i,M),"string"!==typeof q&&(J=w,q=M),J&&t!==+t&&(t=$.d.NONE)):(q=M,t!==+t&&(J=w));var E=M="",u=w;/^[~^$*|]?=$/.test(a[d])&&(M=a[d++],E=a[d++],/^[0-9A-Za-z:_\-]+$/.test(E)?E='"'+E+'"':"]"===E&&(E='""',--d),/^"([^\"\\]|\\.)*"$/.test(E)||(J=w),(u="i"===a[d])&&++d);"]"!==a[d]&&(++d,J=w);switch(t){case $.d.CLASSES:case $.d.LOCAL_NAME:case $.d.NONE:break;case $.d.GLOBAL_NAME:case $.d.ID:case $.d.IDREF:("="===M||"~="===M||"$="===M)&&'""'!=E&&!u?E='"'+E.substring(1,E.length-1)+Q+'"':
"|="===M||""===M||(J=w);break;case $.d.URI:case $.d.URI_FRAGMENT:""!==M&&(J=w);break;default:J=w}J&&(f+="["+q.replace(/[^\w-]/g,"\\$&")+M+E+(u?" i]":"]"))}else if(d<e&&":"===a[d])if(t=a[++d],h.test(t))/^[a*]?$/.test(i)||(J=w),y=m,W=":"+t,i="a";else if(I.test(t))y=w,W=":"+t;else break;else break;d!==e&&(J=w);J&&(d=(i+l).replace(/[^ .*#\w-]/g,"\\$&")+f+W+g)&&n.push(d);return J}var y=w;" "===a[p]&&++p;k-1!==p&&" "===a[k]&&--k;for(var n=[],D=p,o=m,s=p;o&&s<k;++s){var z=a[s];if(e[z]===e||" "===z)i(D,s,
z)?D=s+1:o=w}i(D,k,"")||(o=w);return o?(n.length&&(D=n.join(""),f!==r&&(D="."+f+" "+D),(y?A:Z).push(D)),m):!d||d(a.slice(p,k))}var f=b.ra,Q=b.M,j=b.Da,A=[],Z=[],o=0,n,k=0,s;for(n=0;n<a.length;++n)if(s=a[n],"("==s||"["==s?(++k,m):")"==s||"]"==s?(k&&--k,m):!(" "==a[n]&&(k||e[a[n-1]]===e||e[a[n+1]]===e)))a[o++]=a[n];a.length=o;o=a.length;for(n=k=0;n<o;++n)if(","===a[n]){if(!g(k,n))return r;k=n+1}return!g(k,o)?r:[Z,A]};(function(){var a=/^\w/,d=RegExp("^(?:(?:(?:(?:only|not) )?(?:all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)|\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))(?: and ?\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))*)(?: , (?:(?:(?:(?:only|not) )?(?:all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)|\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))(?: and ?\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))*))*$",
"i");ia=function(b){for(var b=b.slice(),e=b.length,g=0,h=0;h<e;++h){var f=b[h];" "!=f&&(b[g++]=f)}b.length=g;b=b.join(" ");return b=!b.length?"":!d.test(b)?"not all":a.test(b)?b:"not all , "+b}})();(function(){function a(a){for(var b=w,d=0,e=a.length;d<e-1;++d){var g=a[d];":"===a[d+1]&&(b=!(H[g].V&256));b&&(a[d]="");";"===g&&(b=w)}return a.join("")}function b(a){var d=/^\s*[']([^']*)[']\s*$/,e=/^\s*url\s*[(]["]([^"]*)["][)]\s*$/,g=/^\s*url\s*[(][']([^']*)['][)]\s*$/,h=/^\s*url\s*[(]([^)]*)[)]\s*$/,
f;return(f=/^\s*["]([^"]*)["]\s*$/.exec(a))||(f=d.exec(a))||(f=e.exec(a))||(f=g.exec(a))||(f=h.exec(a))?f[1]:r}function d(e,g,h,f,I,j,o){function n(){x=B.length&&B[B.length-1]===r}var k=c,s=o||[0],B=[],x=w;ja(g,{startStylesheet:function(){k=[]},endStylesheet:function(){},startAtrule:function(a,g){if(x)a=r;else if("@media"===a)k.push("@media"," ",ia(g));else if("@keyframes"===a||"@-webkit-keyframes"===a){var n=g[0];1===g.length&&!/__$|[^\w\-]/.test(n)?(k.push(a," ",n+h.M),a="@keyframes"):a=r}else if("@import"===
a&&0<g.length)if(a=r,"function"===typeof j){var D=ia(g.slice(1));if("not all"!==D){++s[0];var o=[];k.push(o);var G=A(O(e,b(g[0])),function(a){var b=d(G,a.ta,h,f,I,j,s);--s[0];a=D?{toString:function(){return"@media "+D+" {"+b.result+"}"}}:b.result;o[0]=a;j(a,!!s[0])},I)}}else window.console&&window.console.log("@import "+g.join(" ")+" elided");x=!a;B.push(a)},endAtrule:function(){B.pop();x||k.push(";");n()},startBlock:function(){x||k.push("{")},endBlock:function(){x||(k.push("}"),x=m)},startRuleset:function(a){var b=
c,d=w;if(!x){var e=c;"@keyframes"===B[B.length-1]?(e=a.join(" ").match(/^ *(?:from|to|\d+(?:\.\d+)?%) *(?:, *(?:from|to|\d+(?:\.\d+)?%) *)*$/i),x=!e,b=[],e&&(e=e[0].replace(/ +/g,""))):(b=ga(a,h),a=b[0],b=b[1],!a.length&&!b.length?x=m:(e=a.join(", "),e||(e="head > html",d=m)));x||k.push(e,"{")}B.push(x?r:{da:b,K:k.length-1,ea:d})},endRuleset:function(){var b=B.pop(),d=k.length;if(!x&&(k.push("}"),"object"===typeof b)){var e=b.da;if(e.length){var g=k.slice(b.K);k.push(e.join(", "),a(g))}}b&&b.ea&&
k.splice(b.K-1,d+1);n()},declaration:function(a,b){if(!x){var d=w,g=b.length;2<=g&&"!"===b[g-2]&&"important"===b[g-1].toLowerCase()&&(d=m,b.length-=2);fa(a,b,f,e,h.M);b.length&&k.push(a,":",b.join(" "),d?" !important;":";")}}});return{result:{toString:function(){return k.join("")}},ya:!!s[0]}}ha=function(a,b,e,g){return d(a,b,e,g,c,c).result.toString()}})()})();
"undefined"!==typeof window&&(window.sanitizeCssProperty=fa,window.sanitizeCssSelectors=ga,window.sanitizeStylesheet=ha,window.sanitizeMediaQuery=ia);var ja,la;
(function(){function g(d,b,g,h,e){for(var a=b++;b<g&&"{"!==d[b]&&";"!==d[b];)++b;if(b<g&&(e||";"===d[b])){var e=a+1,f=b;e<g&&" "===d[e]&&++e;f>e&&" "===d[f-1]&&--f;h.startAtrule&&h.startAtrule(d[a].toLowerCase(),d.slice(e,f));b="{"===d[b]?N(d,b,g,h):b+1;h.endAtrule&&h.endAtrule()}return b}function N(d,b,f,h){++b;for(h.startBlock&&h.startBlock();b<f;){var e=d[b].charAt(0);if("}"==e){++b;break}b=" "===e||";"===e?b+1:"@"===e?g(d,b,f,h,w):"{"===e?N(d,b,f,h):O(d,b,f,h)}h.endBlock&&h.endBlock();return b}
function O(d,b,g,h){var e=b,a=A(d,b,g,m);if(0>a)return a=~a,a===e?a+1:a;var j=d[a];if("{"!==j)return a===e?a+1:a;b=a+1;a>e&&" "===d[a-1]&&--a;for(h.startRuleset&&h.startRuleset(d.slice(e,a));b<g;){j=d[b];if("}"===j){++b;break}b=" "===j?b+1:f(d,b,g,h)}h.endRuleset&&h.endRuleset();return b}function A(d,b,g,f){for(var e,a=[],j=-1;b<g;++b)if(e=d[b].charAt(0),"["===e||"("===e)a[++j]=e;else if("]"===e&&"["===a[j]||")"===e&&"("===a[j])--j;else if("{"===e||"}"===e||";"===e||"@"===e||":"===e&&!f)break;0<=
j&&(b=~(b+1));return b}function G(d,b,g){for(;b<g&&";"!==d[b]&&"}"!==d[b];)++b;return b<g&&";"===d[b]?b+1:b}function f(d,b,g,f){var e=d[b++];if(!j.test(e))return G(d,b,g);b<g&&" "===d[b]&&++b;if(b==g||":"!==d[b])return G(d,b,g);++b;b<g&&" "===d[b]&&++b;var a=A(d,b,g,w);if(0>a)a=~a;else{for(var L=[],l=0,p=b;p<a;++p)b=d[p]," "!==b&&(L[l++]=b);if(a<g){do{b=d[a];if(";"===b||"}"===b)break;l=0}while(++a<g);";"===b&&++a}l&&f.declaration&&f.declaration(e.toLowerCase(),L)}return a}ja=function(d,b){var f=aa(d);
b.startStylesheet&&b.startStylesheet();for(var h=0,e=f.length;h<e;)h=" "===f[h]?h+1:h<e?"@"===f[h].charAt(0)?g(f,h,e,b,m):O(f,h,e,b):h;b.endStylesheet&&b.endStylesheet()};var j=/^-?[a-z]/i;la=function(d,b){for(var g=aa(d),h=0,e=g.length;h<e;)h=" "!==g[h]?f(g,h,e,b):h+1}})();"undefined"!==typeof window&&(window.parseCssStylesheet=ja,window.parseCssDeclarations=la);var $={d:{NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,HTML:12,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10,MEDIA_QUERY:13}};$.atype=$.d;
$.m={"*::class":9,"*::dir":0,"*::draggable":0,"*::hidden":0,"*::id":4,"*::inert":0,"*::itemprop":0,"*::itemref":6,"*::itemscope":0,"*::lang":0,"*::onblur":2,"*::onchange":2,"*::onclick":2,"*::ondblclick":2,"*::onerror":2,"*::onfocus":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::onreset":2,"*::onscroll":2,"*::onselect":2,"*::onsubmit":2,"*::onunload":2,"*::spellcheck":0,"*::style":3,
"*::title":0,"*::translate":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"audio::controls":0,"audio::loop":0,"audio::mediagroup":5,"audio::muted":0,"audio::preload":0,"audio::src":1,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,
"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"command::checked":0,"command::command":5,"command::disabled":0,"command::icon":1,
"command::label":0,"command::radiogroup":0,"command::type":0,"data::value":0,"del::cite":1,"del::datetime":0,"details::open":0,"dir::compact":0,"div::align":0,"dl::compact":0,"fieldset::disabled":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::novalidate":0,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,
"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::inputmode":0,
"input::ismap":0,"input::list":5,"input::max":0,"input::maxlength":0,"input::min":0,"input::multiple":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::placeholder":0,"input::readonly":0,"input::required":0,"input::size":0,"input::src":1,"input::step":0,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,
"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"menu::label":0,"menu::type":0,"meter::high":0,"meter::low":0,"meter::max":0,"meter::min":0,"meter::value":0,"ol::compact":0,"ol::reversed":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"output::for":6,"output::name":8,"p::align":0,"pre::width":0,"progress::max":0,"progress::min":0,"progress::value":0,"q::cite":1,"select::autocomplete":0,
"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::required":0,"select::size":0,"select::tabindex":0,"source::type":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,
"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::autocomplete":0,"textarea::cols":0,"textarea::disabled":0,"textarea::inputmode":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::placeholder":0,"textarea::readonly":0,"textarea::required":0,"textarea::rows":0,"textarea::tabindex":0,"textarea::wrap":0,"tfoot::align":0,
"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"track::default":0,"track::kind":0,"track::label":0,"track::srclang":0,"ul::compact":0,"ul::type":0,
"video::controls":0,"video::height":0,"video::loop":0,"video::mediagroup":5,"video::muted":0,"video::poster":1,"video::preload":0,"video::src":1,"video::width":0};$.ATTRIBS=$.m;$.c={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128,VIRTUALIZED:256};$.eflags=$.c;
$.f={a:0,abbr:0,acronym:0,address:0,applet:272,area:2,article:0,aside:0,audio:0,b:0,base:274,basefont:274,bdi:0,bdo:0,big:0,blockquote:0,body:305,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,command:2,data:0,datalist:0,dd:1,del:0,details:0,dfn:0,dialog:272,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,figcaption:0,figure:0,font:0,footer:0,form:0,frame:274,frameset:272,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:305,header:0,hgroup:0,hr:2,html:305,i:0,iframe:4,img:2,input:2,ins:0,isindex:274,
kbd:0,keygen:274,label:0,legend:0,li:1,link:274,map:0,mark:0,menu:0,meta:274,meter:0,nav:0,nobr:0,noembed:276,noframes:276,noscript:276,object:272,ol:0,optgroup:0,option:1,output:0,p:1,param:274,pre:0,progress:0,q:0,s:0,samp:0,script:84,section:0,select:0,small:0,source:2,span:0,strike:0,strong:0,style:148,sub:0,summary:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,time:0,title:280,tr:1,track:2,tt:0,u:0,ul:0,"var":0,video:0,wbr:2};$.ELEMENTS=$.f;
$.R={a:"HTMLAnchorElement",abbr:"HTMLElement",acronym:"HTMLElement",address:"HTMLElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLBaseFontElement",bdi:"HTMLElement",bdo:"HTMLElement",big:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",center:"HTMLElement",
cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",command:"HTMLCommandElement",data:"HTMLElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",
form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLKeygenElement",
label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",mark:"HTMLElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",nobr:"HTMLElement",noembed:"HTMLElement",noframes:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",
progress:"HTMLProgressElement",q:"HTMLQuoteElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",section:"HTMLElement",select:"HTMLSelectElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strike:"HTMLElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableDataCellElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",
th:"HTMLTableHeaderCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",tt:"HTMLElement",u:"HTMLElement",ul:"HTMLUListElement","var":"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};$.ELEMENT_DOM_INTERFACES=$.R;$.Q={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2};$.ueffects=$.Q;
$.J={"a::href":2,"area::href":2,"audio::src":1,"blockquote::cite":0,"command::icon":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0,"video::poster":1,"video::src":1};$.URIEFFECTS=$.J;$.N={UNSANDBOXED:2,SANDBOXED:1,DATA:0};$.ltypes=$.N;$.I={"a::href":2,"area::href":2,"audio::src":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1,"video::src":2};$.LOADERTYPES=$.I;
"undefined"!==typeof window&&(window.html4=$);var ma=function(g){function N(a){if(Z.hasOwnProperty(a))return Z[a];var b=a.match(o);return b?String.fromCharCode(parseInt(b[1],10)):(b=a.match(n))?String.fromCharCode(parseInt(b[1],16)):s&&k.test(a)?(s.innerHTML="&"+a+";",b=s.textContent,Z[a]=b):"&"+a+";"}function O(a,b){return N(b)}function A(a){return a.replace(x,O)}function G(a){return(""+a).replace(y,"&amp;").replace(D,"&lt;").replace(R,"&gt;").replace(na,"&#34;")}function f(a){return a.replace(V,"&amp;$1").replace(D,"&lt;").replace(R,"&gt;")}
function j(a){var d={z:a.z||a.cdata,A:a.A||a.comment,B:a.B||a.endDoc,t:a.t||a.endTag,e:a.e||a.pcdata,F:a.F||a.rcdata,H:a.H||a.startDoc,w:a.w||a.startTag};return function(a,g){var e;var W=/(<\/|<\!--|<[!?]|[&<>])/g;e=a+"";if(da)e=e.split(W);else{for(var f=[],h=0,i;(i=W.exec(e))!==r;)f.push(e.substring(h,i.index)),f.push(i[0]),h=i.index+i[0].length;f.push(e.substring(h));e=f}b(d,e,0,{r:w,C:w},g)}}function d(a,d,g,e,q){return function(){b(a,d,g,e,q)}}function b(a,b,e,f,q){try{a.H&&0==e&&a.H(q);for(var E,
u,S,l=b.length;e<l;){var k=b[e++],j=b[e];switch(k){case "&":i.test(j)?(a.e&&a.e("&"+j,q,v,d(a,b,e,f,q)),e++):a.e&&a.e("&amp;",q,v,d(a,b,e,f,q));break;case "</":if(E=/^([-\w:]+)[^\'\"]*/.exec(j))if(E[0].length===j.length&&">"===b[e+1])e+=2,S=E[1].toLowerCase(),a.t&&a.t(S,q,v,d(a,b,e,f,q));else{var n=b,p=e,o=a,s=q,x=v,z=f,A=h(n,p);A?(o.t&&o.t(A.name,s,x,d(o,n,p,z,s)),e=A.next):e=n.length}else a.e&&a.e("&lt;/",q,v,d(a,b,e,f,q));break;case "<":if(E=/^([-\w:]+)\s*\/?/.exec(j))if(E[0].length===j.length&&
">"===b[e+1]){e+=2;S=E[1].toLowerCase();a.w&&a.w(S,[],q,v,d(a,b,e,f,q));var B=g.f[S];B&F&&(e=I(b,{name:S,next:e,c:B},a,q,v,f))}else{var n=b,p=a,o=q,s=v,x=f,y=h(n,e);y?(p.w&&p.w(y.name,y.S,o,s,d(p,n,y.next,x,o)),e=y.c&F?I(n,y,p,o,s,x):y.next):e=n.length}else a.e&&a.e("&lt;",q,v,d(a,b,e,f,q));break;case "<\!--":if(!f.C){for(u=e+1;u<l&&!(">"===b[u]&&/--$/.test(b[u-1]));u++);if(u<l){if(a.A){var C=b.slice(e,u).join("");a.A(C.substr(0,C.length-2),q,v,d(a,b,u+1,f,q))}e=u+1}else f.C=m}f.C&&a.e&&a.e("&lt;!--",
q,v,d(a,b,e,f,q));break;case "<!":if(/^\w/.test(j)){if(!f.r){for(u=e+1;u<l&&">"!==b[u];u++);u<l?e=u+1:f.r=m}f.r&&a.e&&a.e("&lt;!",q,v,d(a,b,e,f,q))}else a.e&&a.e("&lt;!",q,v,d(a,b,e,f,q));break;case "<?":if(!f.r){for(u=e+1;u<l&&">"!==b[u];u++);u<l?e=u+1:f.r=m}f.r&&a.e&&a.e("&lt;?",q,v,d(a,b,e,f,q));break;case ">":a.e&&a.e("&gt;",q,v,d(a,b,e,f,q));break;case "":break;default:a.e&&a.e(k,q,v,d(a,b,e,f,q))}}a.B&&a.B(q)}catch(D){if(D!==v)throw D;}}function I(a,b,e,h,q,i){var u=a.length;P.hasOwnProperty(b.name)||
(P[b.name]=RegExp("^"+b.name+"(?:[\\s\\/]|$)","i"));for(var S=P[b.name],l=b.next,j=b.next+1;j<u&&!("</"===a[j-1]&&S.test(a[j]));j++);j<u&&(j-=1);u=a.slice(l,j).join("");if(b.c&g.c.CDATA)e.z&&e.z(u,h,q,d(e,a,j,i,h));else if(b.c&g.c.RCDATA)e.F&&e.F(f(u),h,q,d(e,a,j,i,h));else throw Error("bug");return j}function h(a,b){var d=/^([-\w:]+)/.exec(a[b]),e={};e.name=d[1].toLowerCase();e.c=g.f[e.name];for(var f=a[b].substr(d[0].length),h=b+1,u=a.length;h<u&&">"!==a[h];h++)f+=a[h];if(!(u<=h)){for(var i=[];""!==
f;)if(d=z.exec(f))if(d[4]&&!d[5]||d[6]&&!d[7]){for(var d=d[4]||d[6],j=w,f=[f,a[h++]];h<u;h++){if(j){if(">"===a[h])break}else 0<=a[h].indexOf(d)&&(j=m);f.push(a[h])}if(u<=h)break;f=f.join("")}else{var j=d[1].toLowerCase(),l;if(d[2]){l=d[3];var k=l.charCodeAt(0);if(34===k||39===k)l=l.substr(1,l.length-2);l=A(l.replace(B,""))}else l="";i.push(j,l);f=f.substr(d[0].length)}else f=f.replace(/^[\s\S][^a-z\s]*/,"");e.S=i;e.next=h+1;return e}}function e(a){function b(a,d){e||d.push(a)}var d,e;return j({startDoc:function(){d=
[];e=w},startTag:function(b,f,h){if(!e&&g.f.hasOwnProperty(b)){var i=g.f[b];if(!(i&g.c.FOLDABLE)){var l=a(b,f);if(l){if("object"!==typeof l)throw Error("tagPolicy did not return object (old API?)");if("attribs"in l)f=l.attribs;else throw Error("tagPolicy gave no attribs");var j;"tagName"in l?(j=l.tagName,l=g.f[j]):(j=b,l=i);if(i&g.c.OPTIONAL_ENDTAG){var t=d[d.length-1];t&&t.D===b&&(t.v!==j||b!==j)&&h.push("</",t.v,">")}i&g.c.EMPTY||d.push({D:b,v:j});h.push("<",j);b=0;for(t=f.length;b<t;b+=2){var k=
f[b],n=f[b+1];n!==r&&n!==c&&h.push(" ",k,'="',G(n),'"')}h.push(">");i&g.c.EMPTY&&!(l&g.c.EMPTY)&&h.push("</",j,">")}else e=!(i&g.c.EMPTY)}}},endTag:function(a,b){if(e)e=w;else if(g.f.hasOwnProperty(a)){var f=g.f[a];if(!(f&(g.c.EMPTY|g.c.FOLDABLE))){if(f&g.c.OPTIONAL_ENDTAG)for(f=d.length;0<=--f;){var h=d[f].D;if(h===a)break;if(!(g.f[h]&g.c.OPTIONAL_ENDTAG))return}else for(f=d.length;0<=--f&&d[f].D!==a;);if(!(0>f)){for(h=d.length;--h>f;){var i=d[h].v;g.f[i]&g.c.OPTIONAL_ENDTAG||b.push("</",i,">")}f<
d.length&&(a=d[f].v);d.length=f;b.push("</",a,">")}}}},pcdata:b,rcdata:b,cdata:b,endDoc:function(a){for(;d.length;d.length--)a.push("</",d[d.length-1].v,">")}})}function a(a,b,d,e,f){if(!f)return r;try{var g=ca.parse(""+a);if(g&&(!g.L()||ea.test(g.Y()))){var h=f(g,b,d,e);return h?h.toString():r}}catch(i){}return r}function L(a,b,d,e,f){d||a(b+" removed",{T:"removed",tagName:b});if(e!==f){var g="changed";e&&!f?g="removed":!e&&f&&(g="added");a(b+"."+d+" "+g,{T:g,tagName:b,pa:d,oldValue:e,newValue:f})}}
function l(a,b,d){b=b+"::"+d;if(a.hasOwnProperty(b))return a[b];b="*::"+d;if(a.hasOwnProperty(b))return a[b]}function p(b,d,e,f,h){for(var i=0;i<d.length;i+=2){var j=d[i],k=d[i+1],n=k,p=r,o;if((o=b+"::"+j,g.m.hasOwnProperty(o))||(o="*::"+j,g.m.hasOwnProperty(o)))p=g.m[o];if(p!==r)switch(p){case g.d.NONE:break;case g.d.SCRIPT:k=r;h&&L(h,b,j,n,k);break;case g.d.STYLE:if("undefined"===typeof Y){k=r;h&&L(h,b,j,n,k);break}var s=[];Y(k,{declaration:function(b,d){var f=b.toLowerCase();ka(f,d,e?function(b){return a(b,
g.Q.na,g.N.oa,{TYPE:"CSS",CSS_PROP:f},e)}:r);d.length&&s.push(f+": "+d.join(" "))}});k=0<s.length?s.join(" ; "):r;h&&L(h,b,j,n,k);break;case g.d.ID:case g.d.IDREF:case g.d.IDREFS:case g.d.GLOBAL_NAME:case g.d.LOCAL_NAME:case g.d.CLASSES:k=f?f(k):k;h&&L(h,b,j,n,k);break;case g.d.URI:k=a(k,l(g.J,b,j),l(g.I,b,j),{TYPE:"MARKUP",XML_ATTR:j,XML_TAG:b},e);h&&L(h,b,j,n,k);break;case g.d.URI_FRAGMENT:k&&"#"===k.charAt(0)?(k=k.substring(1),k=f?f(k):k,k!==r&&k!==c&&(k="#"+k)):k=r;h&&L(h,b,j,n,k);break;default:k=
r,h&&L(h,b,j,n,k)}else k=r,h&&L(h,b,j,n,k);d[i+1]=k}return d}function U(a,b,d){return function(e,f){if(g.f[e]&g.c.UNSAFE)d&&L(d,e,c,c,c);else return{attribs:p(e,f,a,b,d)}}}function Q(a,b){var d=[];e(b)(a,d);return d.join("")}var Y,ka;"undefined"!==typeof window&&(Y=window.parseCssDeclarations,ka=window.sanitizeCssProperty);var Z={lt:"<",LT:"<",gt:">",GT:">",amp:"&",AMP:"&",quot:'"',apos:"'",nbsp:"\u00a0"},o=/^#(\d+)$/,n=/^#x([0-9A-Fa-f]+)$/,k=/^[A-Za-z][A-za-z0-9]+$/,s="undefined"!==typeof window&&
window.document?window.document.createElement("textarea"):r,B=/\0/g,x=/&(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/g,i=/^(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/,y=/&/g,V=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,D=/[<]/g,R=/>/g,na=/\"/g,z=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,da=3==="a,b".split(/(,)/).length,F=g.c.CDATA|g.c.RCDATA,v={},P={},ea=/^(?:https?|mailto)$/i,C={};C.sa=C.escapeAttrib=G;C.ua=C.makeHtmlSanitizer=e;C.va=C.makeSaxParser=j;C.wa=C.makeTagPolicy=
U;C.za=C.normalizeRCData=f;C.Aa=C.sanitize=function(a,b,d,e){return Q(a,U(b,d,e))};C.Ba=C.sanitizeAttribs=p;C.Ca=C.sanitizeWithPolicy=Q;C.Ea=C.unescapeEntities=A;return C}($),oa=ma.sanitize;"undefined"!==typeof window&&(window.html=ma,window.html_sanitize=oa);})();

View file

@ -0,0 +1,42 @@
(function(){var l=null,p=function(){function e(a){a=(""+a).match(E);return!a?l:new b(q(a[1]),q(a[2]),q(a[3]),q(a[4]),q(a[5]),q(a[6]),q(a[7]))}function z(a,e){return"string"==typeof a?encodeURI(a).replace(e,B):l}function B(a){a=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function y(a){if(a===l)return l;for(var a=a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/"),e=m,b;(b=a.replace(e,"$1"))!=a;a=b);return a}function A(a,e){var b=a.R(),g=e.K();g?b.fa(e.j):
g=e.V();g?b.ca(e.m):g=e.W();g?b.da(e.k):g=e.Y();var m=e.g,k=y(m);if(g)b.ba(e.T()),k=k&&k.replace(x,"");else if(g=!!m){if(47!==k.charCodeAt(0))var k=y(b.g||"").replace(x,""),s=k.lastIndexOf("/")+1,k=y((s?k.substring(0,s):"")+y(m)).replace(x,"")}else k=k&&k.replace(x,""),k!==m&&b.G(k);g?b.G(k):g=e.Z();g?b.M(e.l):g=e.X();g&&b.ea(e.n);return b}function b(a,e,b,g,m,k,s){this.j=a;this.m=e;this.k=b;this.h=g;this.g=m;this.l=k;this.n=s}function q(a){return"string"==typeof a&&0<a.length?a:l}var m=RegExp(/(\/|^)(?:[^./][^/]*|\.{2,}(?:[^./][^/]*)|\.{3,}[^/]*)\/\.\.(?:\/|$)/),
x=/^(?:\.\.\/)*(?:\.\.$)?/;b.prototype.toString=function(){var a=[];l!==this.j&&a.push(this.j,":");l!==this.k&&(a.push("//"),l!==this.m&&a.push(this.m,"@"),a.push(this.k),l!==this.h&&a.push(":",this.h.toString()));l!==this.g&&a.push(this.g);l!==this.l&&a.push("?",this.l);l!==this.n&&a.push("#",this.n);return a.join("")};b.prototype.R=function(){return new b(this.j,this.m,this.k,this.h,this.g,this.l,this.n)};b.prototype.U=function(){return this.j&&decodeURIComponent(this.j).toLowerCase()};b.prototype.fa=
function(a){this.j=a?a:l};b.prototype.K=function(){return l!==this.j};b.prototype.ca=function(a){this.m=a?a:l};b.prototype.V=function(){return l!==this.m};b.prototype.da=function(a){this.k=a?a:l;this.G(this.g)};b.prototype.W=function(){return l!==this.k};b.prototype.T=function(){return this.h&&decodeURIComponent(this.h)};b.prototype.ba=function(a){if(a){a=Number(a);if(a!==(a&65535))throw Error("Bad port number "+a);this.h=""+a}else this.h=l};b.prototype.Y=function(){return l!==this.h};b.prototype.S=
function(){return this.g&&decodeURIComponent(this.g)};b.prototype.G=function(a){a?(a=""+a,this.g=!this.k||/^\//.test(a)?a:"/"+a):this.g=l};b.prototype.M=function(a){this.l=a?a:l};b.prototype.Z=function(){return l!==this.l};b.prototype.aa=function(a){if("object"===typeof a&&!(a instanceof Array)&&(a instanceof Object||"[object Array]"!==Object.prototype.toString.call(a))){var e=[],b=-1,g;for(g in a){var m=a[g];"string"===typeof m&&(e[++b]=g,e[++b]=m)}a=e}for(var e=[],b="",k=0;k<a.length;)g=a[k++],
m=a[k++],e.push(b,encodeURIComponent(g.toString())),b="&",m&&e.push("=",encodeURIComponent(m.toString()));this.l=e.join("")};b.prototype.ea=function(a){this.n=a?a:l};b.prototype.X=function(){return l!==this.n};var E=/^(?:([^:/?#]+):)?(?:\/\/(?:([^/?#]*)@)?([^/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,D=/[#\/\?@]/g,F=/[\#\?]/g;b.parse=e;b.create=function(a,e,m,g,q,k,s){a=new b(z(a,D),z(e,D),"string"==typeof m?encodeURIComponent(m):l,0<g?g.toString():l,z(q,F),l,"string"==typeof s?encodeURIComponent(s):
l);k&&("string"===typeof k?a.M(k.replace(/[^?&=0-9A-Za-z_\-~.%]/g,B)):a.aa(k));return a};b.$=A;b.ja=y;b.ua={oa:function(a){return/\.html$/.test(e(a).S())?"text/html":"application/javascript"},$:function(a,b){return a?A(e(a),e(b)).toString():""+b}};return b}();"undefined"!==typeof window&&(window.URI=p);var L={e:{NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,HTML:12,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10,MEDIA_QUERY:13}};L.atype=L.e;
L.w={"*::class":9,"*::dir":0,"*::draggable":0,"*::hidden":0,"*::id":4,"*::inert":0,"*::itemprop":0,"*::itemref":6,"*::itemscope":0,"*::lang":0,"*::onblur":2,"*::onchange":2,"*::onclick":2,"*::ondblclick":2,"*::onerror":2,"*::onfocus":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::onreset":2,"*::onscroll":2,"*::onselect":2,"*::onsubmit":2,"*::onunload":2,"*::spellcheck":0,"*::style":3,
"*::title":0,"*::translate":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"audio::controls":0,"audio::loop":0,"audio::mediagroup":5,"audio::muted":0,"audio::preload":0,"audio::src":1,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,
"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"command::checked":0,"command::command":5,"command::disabled":0,"command::icon":1,
"command::label":0,"command::radiogroup":0,"command::type":0,"data::value":0,"del::cite":1,"del::datetime":0,"details::open":0,"dir::compact":0,"div::align":0,"dl::compact":0,"fieldset::disabled":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::novalidate":0,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,
"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::inputmode":0,
"input::ismap":0,"input::list":5,"input::max":0,"input::maxlength":0,"input::min":0,"input::multiple":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::placeholder":0,"input::readonly":0,"input::required":0,"input::size":0,"input::src":1,"input::step":0,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,
"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"menu::label":0,"menu::type":0,"meter::high":0,"meter::low":0,"meter::max":0,"meter::min":0,"meter::value":0,"ol::compact":0,"ol::reversed":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"output::for":6,"output::name":8,"p::align":0,"pre::width":0,"progress::max":0,"progress::min":0,"progress::value":0,"q::cite":1,"select::autocomplete":0,
"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::required":0,"select::size":0,"select::tabindex":0,"source::type":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,
"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::autocomplete":0,"textarea::cols":0,"textarea::disabled":0,"textarea::inputmode":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::placeholder":0,"textarea::readonly":0,"textarea::required":0,"textarea::rows":0,"textarea::tabindex":0,"textarea::wrap":0,"tfoot::align":0,
"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"track::default":0,"track::kind":0,"track::label":0,"track::srclang":0,"ul::compact":0,"ul::type":0,
"video::controls":0,"video::height":0,"video::loop":0,"video::mediagroup":5,"video::muted":0,"video::poster":1,"video::preload":0,"video::src":1,"video::width":0};L.ATTRIBS=L.w;L.c={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128,VIRTUALIZED:256};L.eflags=L.c;
L.f={a:0,abbr:0,acronym:0,address:0,applet:272,area:2,article:0,aside:0,audio:0,b:0,base:274,basefont:274,bdi:0,bdo:0,big:0,blockquote:0,body:305,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,command:2,data:0,datalist:0,dd:1,del:0,details:0,dfn:0,dialog:272,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,figcaption:0,figure:0,font:0,footer:0,form:0,frame:274,frameset:272,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:305,header:0,hgroup:0,hr:2,html:305,i:0,iframe:4,img:2,input:2,ins:0,isindex:274,
kbd:0,keygen:274,label:0,legend:0,li:1,link:274,map:0,mark:0,menu:0,meta:274,meter:0,nav:0,nobr:0,noembed:276,noframes:276,noscript:276,object:272,ol:0,optgroup:0,option:1,output:0,p:1,param:274,pre:0,progress:0,q:0,s:0,samp:0,script:84,section:0,select:0,small:0,source:2,span:0,strike:0,strong:0,style:148,sub:0,summary:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,time:0,title:280,tr:1,track:2,tt:0,u:0,ul:0,"var":0,video:0,wbr:2};L.ELEMENTS=L.f;
L.O={a:"HTMLAnchorElement",abbr:"HTMLElement",acronym:"HTMLElement",address:"HTMLElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLBaseFontElement",bdi:"HTMLElement",bdo:"HTMLElement",big:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",center:"HTMLElement",
cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",command:"HTMLCommandElement",data:"HTMLElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",
form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLKeygenElement",
label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",mark:"HTMLElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",nobr:"HTMLElement",noembed:"HTMLElement",noframes:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",
progress:"HTMLProgressElement",q:"HTMLQuoteElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",section:"HTMLElement",select:"HTMLSelectElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strike:"HTMLElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableDataCellElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",
th:"HTMLTableHeaderCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",tt:"HTMLElement",u:"HTMLElement",ul:"HTMLUListElement","var":"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};L.ELEMENT_DOM_INTERFACES=L.O;L.N={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2};L.ueffects=L.N;
L.J={"a::href":2,"area::href":2,"audio::src":1,"blockquote::cite":0,"command::icon":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0,"video::poster":1,"video::src":1};L.URIEFFECTS=L.J;L.L={UNSANDBOXED:2,SANDBOXED:1,DATA:0};L.ltypes=L.L;L.I={"a::href":2,"area::href":2,"audio::src":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1,"video::src":2};L.LOADERTYPES=L.I;
"undefined"!==typeof window&&(window.html4=L);var Q=function(e){function z(f){if(G.hasOwnProperty(f))return G[f];var a=f.match(R);return a?String.fromCharCode(parseInt(a[1],10)):(a=f.match(S))?String.fromCharCode(parseInt(a[1],16)):H&&T.test(f)?(H.innerHTML="&"+f+";",a=H.textContent,G[f]=a):"&"+f+";"}function B(f,a){return z(a)}function y(f){return f.replace(U,B)}function A(f){return(""+f).replace(V,"&amp;").replace(M,"&lt;").replace(N,"&gt;").replace(W,"&#34;")}function b(f){return f.replace(X,"&amp;$1").replace(M,"&lt;").replace(N,"&gt;")}
function q(f){var a={z:f.z||f.cdata,A:f.A||f.comment,B:f.B||f.endDoc,r:f.r||f.endTag,d:f.d||f.pcdata,F:f.F||f.rcdata,H:f.H||f.startDoc,v:f.v||f.startTag};return function(f,e){var c;var b=/(<\/|<\!--|<[!?]|[&<>])/g;c=f+"";if(Y)c=c.split(b);else{for(var i=[],h=0,n;(n=b.exec(c))!==l;)i.push(c.substring(h,n.index)),i.push(n[0]),h=n.index+n[0].length;i.push(c.substring(h));c=i}x(a,c,0,{o:!1,C:!1},e)}}function m(f,a,d,e,c){return function(){x(f,a,d,e,c)}}function x(f,a,d,j,c){try{f.H&&0==d&&f.H(c);for(var b,
i,h,n=a.length;d<n;){var r=a[d++],k=a[d];switch(r){case "&":Z.test(k)?(f.d&&f.d("&"+k,c,t,m(f,a,d,j,c)),d++):f.d&&f.d("&amp;",c,t,m(f,a,d,j,c));break;case "</":if(b=/^([-\w:]+)[^\'\"]*/.exec(k))if(b[0].length===k.length&&">"===a[d+1])d+=2,h=b[1].toLowerCase(),f.r&&f.r(h,c,t,m(f,a,d,j,c));else{var g=a,o=d,q=f,s=c,v=t,y=j,x=D(g,o);x?(q.r&&q.r(x.name,s,v,m(q,g,o,y,s)),d=x.next):d=g.length}else f.d&&f.d("&lt;/",c,t,m(f,a,d,j,c));break;case "<":if(b=/^([-\w:]+)\s*\/?/.exec(k))if(b[0].length===k.length&&
">"===a[d+1]){d+=2;h=b[1].toLowerCase();f.v&&f.v(h,[],c,t,m(f,a,d,j,c));var z=e.f[h];z&O&&(d=E(a,{name:h,next:d,c:z},f,c,t,j))}else{var g=a,o=f,q=c,s=t,v=j,C=D(g,d);C?(o.v&&o.v(C.name,C.P,q,s,m(o,g,C.next,v,q)),d=C.c&O?E(g,C,o,q,s,v):C.next):d=g.length}else f.d&&f.d("&lt;",c,t,m(f,a,d,j,c));break;case "<\!--":if(!j.C){for(i=d+1;i<n&&!(">"===a[i]&&/--$/.test(a[i-1]));i++);if(i<n){if(f.A){var A=a.slice(d,i).join("");f.A(A.substr(0,A.length-2),c,t,m(f,a,i+1,j,c))}d=i+1}else j.C=!0}j.C&&f.d&&f.d("&lt;!--",
c,t,m(f,a,d,j,c));break;case "<!":if(/^\w/.test(k)){if(!j.o){for(i=d+1;i<n&&">"!==a[i];i++);i<n?d=i+1:j.o=!0}j.o&&f.d&&f.d("&lt;!",c,t,m(f,a,d,j,c))}else f.d&&f.d("&lt;!",c,t,m(f,a,d,j,c));break;case "<?":if(!j.o){for(i=d+1;i<n&&">"!==a[i];i++);i<n?d=i+1:j.o=!0}j.o&&f.d&&f.d("&lt;?",c,t,m(f,a,d,j,c));break;case ">":f.d&&f.d("&gt;",c,t,m(f,a,d,j,c));break;case "":break;default:f.d&&f.d(r,c,t,m(f,a,d,j,c))}}f.B&&f.B(c)}catch(B){if(B!==t)throw B;}}function E(a,w,d,j,c,u){var i=a.length;I.hasOwnProperty(w.name)||
(I[w.name]=RegExp("^"+w.name+"(?:[\\s\\/]|$)","i"));for(var h=I[w.name],n=w.next,r=w.next+1;r<i&&!("</"===a[r-1]&&h.test(a[r]));r++);r<i&&(r-=1);i=a.slice(n,r).join("");if(w.c&e.c.CDATA)d.z&&d.z(i,j,c,m(d,a,r,u,j));else if(w.c&e.c.RCDATA)d.F&&d.F(b(i),j,c,m(d,a,r,u,j));else throw Error("bug");return r}function D(a,b){var d=/^([-\w:]+)/.exec(a[b]),j={};j.name=d[1].toLowerCase();j.c=e.f[j.name];for(var c=a[b].substr(d[0].length),u=b+1,i=a.length;u<i&&">"!==a[u];u++)c+=a[u];if(!(i<=u)){for(var h=[];""!==
c;)if(d=$.exec(c))if(d[4]&&!d[5]||d[6]&&!d[7]){for(var d=d[4]||d[6],n=!1,c=[c,a[u++]];u<i;u++){if(n){if(">"===a[u])break}else 0<=a[u].indexOf(d)&&(n=!0);c.push(a[u])}if(i<=u)break;c=c.join("")}else{var n=d[1].toLowerCase(),r;if(d[2]){r=d[3];var g=r.charCodeAt(0);if(34===g||39===g)r=r.substr(1,r.length-2);r=y(r.replace(aa,""))}else r="";h.push(n,r);c=c.substr(d[0].length)}else c=c.replace(/^[\s\S][^a-z\s]*/,"");j.P=h;j.next=u+1;return j}}function F(a){function b(a,f){j||f.push(a)}var d,j;return q({startDoc:function(){d=
[];j=!1},startTag:function(c,b,i){if(!j&&e.f.hasOwnProperty(c)){var h=e.f[c];if(!(h&e.c.FOLDABLE)){var n=a(c,b);if(n){if("object"!==typeof n)throw Error("tagPolicy did not return object (old API?)");if("attribs"in n)b=n.attribs;else throw Error("tagPolicy gave no attribs");var g;"tagName"in n?(g=n.tagName,n=e.f[g]):(g=c,n=h);if(h&e.c.OPTIONAL_ENDTAG){var k=d[d.length-1];k&&k.D===c&&(k.t!==g||c!==g)&&i.push("</",k.t,">")}h&e.c.EMPTY||d.push({D:c,t:g});i.push("<",g);c=0;for(k=b.length;c<k;c+=2){var m=
b[c],w=b[c+1];w!==l&&void 0!==w&&i.push(" ",m,'="',A(w),'"')}i.push(">");h&e.c.EMPTY&&!(n&e.c.EMPTY)&&i.push("</",g,">")}else j=!(h&e.c.EMPTY)}}},endTag:function(a,f){if(j)j=!1;else if(e.f.hasOwnProperty(a)){var b=e.f[a];if(!(b&(e.c.EMPTY|e.c.FOLDABLE))){if(b&e.c.OPTIONAL_ENDTAG)for(b=d.length;0<=--b;){var h=d[b].D;if(h===a)break;if(!(e.f[h]&e.c.OPTIONAL_ENDTAG))return}else for(b=d.length;0<=--b&&d[b].D!==a;);if(!(0>b)){for(h=d.length;--h>b;){var g=d[h].t;e.f[g]&e.c.OPTIONAL_ENDTAG||f.push("</",g,
">")}b<d.length&&(a=d[b].t);d.length=b;f.push("</",a,">")}}}},pcdata:b,rcdata:b,cdata:b,endDoc:function(a){for(;d.length;d.length--)a.push("</",d[d.length-1].t,">")}})}function a(a,b,d,e,c){if(!c)return l;try{var g=p.parse(""+a);if(g&&(!g.K()||ba.test(g.U()))){var i=c(g,b,d,e);return i?i.toString():l}}catch(h){}return l}function v(a,b,d,e,c){d||a(b+" removed",{Q:"removed",tagName:b});if(e!==c){var g="changed";e&&!c?g="removed":!e&&c&&(g="added");a(b+"."+d+" "+g,{Q:g,tagName:b,ia:d,oldValue:e,newValue:c})}}
function J(a,b,d){b=b+"::"+d;if(a.hasOwnProperty(b))return a[b];b="*::"+d;if(a.hasOwnProperty(b))return a[b]}function g(b,g,d,j,c){for(var k=0;k<g.length;k+=2){var i=g[k],h=g[k+1],n=h,m=l,o;if((o=b+"::"+i,e.w.hasOwnProperty(o))||(o="*::"+i,e.w.hasOwnProperty(o)))m=e.w[o];if(m!==l)switch(m){case e.e.NONE:break;case e.e.SCRIPT:h=l;c&&v(c,b,i,n,h);break;case e.e.STYLE:if("undefined"===typeof s){h=l;c&&v(c,b,i,n,h);break}var q=[];s(h,{declaration:function(b,c){var f=b.toLowerCase();P(f,c,d?function(b){return a(b,
e.N.ga,e.L.ha,{TYPE:"CSS",CSS_PROP:f},d)}:l);c.length&&q.push(f+": "+c.join(" "))}});h=0<q.length?q.join(" ; "):l;c&&v(c,b,i,n,h);break;case e.e.ID:case e.e.IDREF:case e.e.IDREFS:case e.e.GLOBAL_NAME:case e.e.LOCAL_NAME:case e.e.CLASSES:h=j?j(h):h;c&&v(c,b,i,n,h);break;case e.e.URI:h=a(h,J(e.J,b,i),J(e.I,b,i),{TYPE:"MARKUP",XML_ATTR:i,XML_TAG:b},d);c&&v(c,b,i,n,h);break;case e.e.URI_FRAGMENT:h&&"#"===h.charAt(0)?(h=h.substring(1),h=j?j(h):h,h!==l&&void 0!==h&&(h="#"+h)):h=l;c&&v(c,b,i,n,h);break;
default:h=l,c&&v(c,b,i,n,h)}else h=l,c&&v(c,b,i,n,h);g[k+1]=h}return g}function K(a,b,d){return function(j,c){if(e.f[j]&e.c.UNSAFE)d&&v(d,j,void 0,void 0,void 0);else return{attribs:g(j,c,a,b,d)}}}function k(a,b){var d=[];F(b)(a,d);return d.join("")}var s,P;"undefined"!==typeof window&&(s=window.parseCssDeclarations,P=window.sanitizeCssProperty);var G={lt:"<",LT:"<",gt:">",GT:">",amp:"&",AMP:"&",quot:'"',apos:"'",nbsp:"\u00a0"},R=/^#(\d+)$/,S=/^#x([0-9A-Fa-f]+)$/,T=/^[A-Za-z][A-za-z0-9]+$/,H="undefined"!==
typeof window&&window.document?window.document.createElement("textarea"):l,aa=/\0/g,U=/&(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/g,Z=/^(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/,V=/&/g,X=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,M=/[<]/g,N=/>/g,W=/\"/g,$=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,Y=3==="a,b".split(/(,)/).length,O=e.c.CDATA|e.c.RCDATA,t={},I={},ba=/^(?:https?|mailto)$/i,o={};o.ka=o.escapeAttrib=A;o.la=o.makeHtmlSanitizer=F;o.ma=o.makeSaxParser=
q;o.na=o.makeTagPolicy=K;o.pa=o.normalizeRCData=b;o.qa=o.sanitize=function(a,b,d,e){return k(a,K(b,d,e))};o.ra=o.sanitizeAttribs=g;o.sa=o.sanitizeWithPolicy=k;o.ta=o.unescapeEntities=y;return o}(L),ca=Q.sanitize;"undefined"!==typeof window&&(window.html=Q,window.html_sanitize=ca);})();

View file

@ -0,0 +1,21 @@
{% extends 'layout.html' %}
{% block body %}
<h2>Create New Site</h2>
<div class="row">
<div class='col-md-6'>
<form method="POST" role="form">
<div class="form-group">
<label for="wiki" class="control-label">Site Name</label>
<div class="input-group">
<input id="wiki" name="name" type="text" class="form-control" />
<span class="input-group-addon">.realms.io</span>
</div>
</div>
<input type="submit" class="btn btn-primary" value="Save">
</form>
</div>
</div>
{% endblock %}

View file

@ -36,12 +36,26 @@
<ul class="nav navbar-nav">
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/create/"><i class="icon-plus"></i> Create</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" role="menu" data-toggle="dropdown">Wiki
<i class="icon-caret-down"></i></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Page Options</li>
<li><a href="/create/">Create Page</a></li>
{% if name %}
<li><a href="/edit/{{ name }}">Edit Page</a></li>
<li><a href="/history/{{ name }}">History</a></li>
{% endif %}
<li class="divider"></li>
<li class="dropdown-header">Site Options</li>
<li><a href="/_new/">Create New Wiki</a></li>
</ul>
</li>
{% if session.get('user') %}
<li class="dropdown user-avatar">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span>
<img src="http://static.ffxiah.com/images/avatars/mini/5a85e45e0976c8a96c955e83a9743b47.jpg" class="menu-avatar">
<img src="{{ session['user'].get('avatar') }}" class="menu-avatar">
<span>{{ session['user'].get('username') }} <i class="icon-caret-down"></i></span>
</span>
</a>
@ -59,6 +73,10 @@
</div>
</div>
<!-- Page Menu -->
<div class="container">
<div id="main-body">

View file

@ -1,5 +1,6 @@
{% extends 'layout.html' %}
{% block js %}
<script src="/static/js/html-css-sanitizer-minified.js"></script>
<script src="/static/js/ace/ace.js"></script>
<script src="/static/js/ace/mode-markdown.js"></script>
<script src="/static/js/keymaster.min.js"></script>

View file

@ -1,10 +1,12 @@
{% extends 'layout.html' %}
{% block body %}
<div class="controls pull-right">
{% block page_menu %}
<div class="controls pull-right">
<a class="btn btn-default btn-sm" href="/edit/{{ name }}">Edit</a>
<a class="btn btn-default btn-sm" href="/history/{{ name }}">History</a>
</div>
</div>
{% endblock %}
{% block body %}
<div id="page-content" style="display:none">
{{ page.data|safe }}

View file

@ -1,5 +1,6 @@
import re
import os
import hashlib
def mkdir_safe(path):
@ -56,3 +57,7 @@ def to_canonical(s):
s = re.sub(r"[^a-zA-Z0-9\-]", "", s)
s = s[:64]
return s
def gravatar_url(email):
return "https://www.gravatar.com/avatar/" + hashlib.md5(email).hexdigest()