Guest User

Untitled

a guest
Jan 31st, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 353.62 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title>i don&#x27;t know who i am</title>
  7. <style title="Twine CSS">@-webkit-keyframes $animation-name{0%{opacity:0}to{opacity:1}}@keyframes $animation-name{0%{opacity:0}to{opacity:1}}@-webkit-keyframes $animation-name{0%,to{opacity:0}50%{opacity:1}}@keyframes $animation-name{0%,to{opacity:0}50%{opacity:1}}@-webkit-keyframes $animation-name{0%,to{}50%{-webkit-transform:translateY(-0.2em);transform:translateY(-0.2em)}}@keyframes $animation-name{0%,to{}50%{-webkit-transform:translateY(-0.2em);transform:translateY(-0.2em)}}@-webkit-keyframes $animation-name{0%,to{}50%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}@keyframes $animation-name{0%,to{}50%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}@-webkit-keyframes $animation-name{0%{background-color:white;color:white}to{}}@keyframes $animation-name{0%{background-color:white;color:white}to{}}@-webkit-keyframes $animation-name{0%{-webkit-transform:scale(0, 0);transform:scale(0, 0)}20%{-webkit-transform:scale(1.2, 1.2);transform:scale(1.2, 1.2)}40%{-webkit-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}60%{-webkit-transform:scale(1.05, 1.05);transform:scale(1.05, 1.05)}80%{-webkit-transform:scale(0.925, 0.925);transform:scale(0.925, 0.925)}to{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}@keyframes $animation-name{0%{-webkit-transform:scale(0, 0);transform:scale(0, 0)}20%{-webkit-transform:scale(1.2, 1.2);transform:scale(1.2, 1.2)}40%{-webkit-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}60%{-webkit-transform:scale(1.05, 1.05);transform:scale(1.05, 1.05)}80%{-webkit-transform:scale(0.925, 0.925);transform:scale(0.925, 0.925)}to{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}@-webkit-keyframes $animation-name{0%,to{-webkit-transform:translateX(0em);transform:translateX(0em)}5%,25%,45%{-webkit-transform:translateX(-1em);transform:translateX(-1em)}15%,35%,55%{-webkit-transform:translateX(1em);transform:translateX(1em)}65%{-webkit-transform:translateX(-0.6em);transform:translateX(-0.6em)}75%{-webkit-transform:translateX(0.6em);transform:translateX(0.6em)}85%{-webkit-transform:translateX(-0.2em);transform:translateX(-0.2em)}95%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}@keyframes $animation-name{0%,to{-webkit-transform:translateX(0em);transform:translateX(0em)}5%,25%,45%{-webkit-transform:translateX(-1em);transform:translateX(-1em)}15%,35%,55%{-webkit-transform:translateX(1em);transform:translateX(1em)}65%{-webkit-transform:translateX(-0.6em);transform:translateX(-0.6em)}75%{-webkit-transform:translateX(0.6em);transform:translateX(0.6em)}85%{-webkit-transform:translateX(-0.2em);transform:translateX(-0.2em)}95%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}.debug-mode tw-expression[type=hookref]{background-color:rgba(115,123,140,0.15)}.debug-mode tw-expression[type=hookref]::after{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"?" attr(name)}.debug-mode tw-expression[type=variable]{background-color:rgba(140,128,115,0.15)}.debug-mode tw-expression[type=variable]::after{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"$" attr(name)}.debug-mode tw-expression[type=macro]:nth-of-type(4n+0){background-color:rgba(136,153,102,0.15)}.debug-mode tw-expression[type=macro]:nth-of-type(2n+1){background-color:rgba(102,153,102,0.15)}.debug-mode tw-expression[type=macro]:nth-of-type(4n+2){background-color:rgba(102,153,136,0.15)}.debug-mode tw-expression[type=macro][name="display"]{background-color:rgba(0,170,255,0.1) !important}.debug-mode tw-expression[type=macro][name="if"],.debug-mode tw-expression[type=macro][name="if"]+tw-hook:not([name]),.debug-mode tw-expression[type=macro][name="unless"],.debug-mode tw-expression[type=macro][name="unless"]+tw-hook:not([name]),.debug-mode tw-expression[type=macro][name="elseif"],.debug-mode tw-expression[type=macro][name="elseif"]+tw-hook:not([name]),.debug-mode tw-expression[type=macro][name="else"],.debug-mode tw-expression[type=macro][name="else"]+tw-hook:not([name]){background-color:rgba(0,255,0,0.1) !important}.debug-mode tw-expression[type=macro].false{background-color:rgba(255,0,0,0.2) !important}.debug-mode tw-expression[type=macro].false+tw-hook:not([name]){display:none}.debug-mode tw-expression[type=macro][name="a"],.debug-mode tw-expression[type=macro][name="array"],.debug-mode tw-expression[type=macro][name="datamap"],.debug-mode tw-expression[type=macro][name="dataset"],.debug-mode tw-expression[type=macro][name="colour"],.debug-mode tw-expression[type=macro][name="color"],.debug-mode tw-expression[type=macro][name="num"],.debug-mode tw-expression[type=macro][name="number"],.debug-mode tw-expression[type=macro][name="text"],.debug-mode tw-expression[type=macro][name="print"]{background-color:rgba(255,255,0,0.2) !important}.debug-mode tw-expression[type=macro][name="put"],.debug-mode tw-expression[type=macro][name="set"]{background-color:rgba(255,128,0,0.2) !important}.debug-mode tw-expression[type=macro][name="script"]{background-color:rgba(255,191,0,0.2) !important}.debug-mode tw-expression[type=macro][name="style"]{background-color:rgba(185,198,198,0.2) !important}.debug-mode tw-expression[type=macro][name^="link"],.debug-mode tw-expression[type=macro][name^="click"],.debug-mode tw-expression[type=macro][name^="mouseover"],.debug-mode tw-expression[type=macro][name^="mouseout"]{background-color:rgba(128,223,32,0.2) !important}.debug-mode tw-expression[type=macro][name^="replace"],.debug-mode tw-expression[type=macro][name^="prepend"],.debug-mode tw-expression[type=macro][name^="append"],.debug-mode tw-expression[type=macro][name^="remove"]{background-color:rgba(223,96,32,0.2) !important}.debug-mode tw-expression[type=macro][name="live"]{background-color:rgba(32,96,223,0.2) !important}.debug-mode tw-expression[type=macro]::before{content:"(" attr(name) ":)";padding:0 0.5rem;font-size:1rem;vertical-align:middle;line-height:normal;background-color:inherit;border:1px solid rgba(255,255,255,0.5)}.debug-mode tw-hook{background-color:rgba(0,85,255,0.1) !important}.debug-mode tw-hook::before{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"["}.debug-mode tw-hook::after{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"]"}.debug-mode tw-hook[name]::after{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"]<" attr(name) "|"}.debug-mode tw-pseudo-hook{background-color:rgba(255,170,0,0.1) !important}.debug-mode tw-collapsed::before{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"{"}.debug-mode tw-collapsed::after{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"}"}.debug-mode tw-verbatim::before,.debug-mode tw-verbatim::after{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:"`"}.debug-mode tw-align[style*="text-align: center"]{background:linear-gradient(to right, rgba(255,204,189,0) 0%, rgba(255,204,189,0.25) 50%, rgba(255,204,189,0) 100%)}.debug-mode tw-align[style*="text-align: left"]{background:linear-gradient(to right, rgba(255,204,189,0.25) 0%, rgba(255,204,189,0) 100%)}.debug-mode tw-align[style*="text-align: right"]{background:linear-gradient(to right, rgba(255,204,189,0) 0%, rgba(255,204,189,0.25) 100%)}.debug-mode p{background-color:rgba(255,213,0,0.1)}.debug-mode tw-enchantment{animation:enchantment 0.5s infinite;-webkit-animation:enchantment 0.5s infinite;border:1px solid}.debug-mode tw-link::after,.debug-mode tw-broken-link::after{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:attr(passage-name)}.debug-mode tw-include{background-color:rgba(204,128,51,0.1)}.debug-mode tw-include::before{font-size:0.8rem;padding-left:0.2rem;padding-right:0.2rem;vertical-align:top;content:attr(type) ' "' attr(title) '"'}@keyframes enchantment{0%,to{border-color:#ffb366}50%{border-color:#6fc}}@-webkit-keyframes enchantment{0%,to{border-color:#ffb366}50%{border-color:#6fc}}tw-debugger{position:fixed;bottom:0;right:0;z-index:999999;min-width:10em;min-height:1em;padding:1em;font-size:1.5em;border-left:solid #000 2px;border-top:solid #000 2px;border-top-left-radius:0.5em;background:#fff;transition:opacity 0.2s;-webkit-transition:opacity 0.2s;opacity:0.8}@media screen and (max-width: 1280px){tw-debugger{font-size:1.25em}}@media screen and (max-width: 960px){tw-debugger{font-size:1em}}@media screen and (max-width: 640px){tw-debugger{font-size:0.8em}}tw-debugger:hover{opacity:1}.show-invisibles{border-radius:3px;border:solid #999 1px;background-color:#fff;font-size:inherit}.debug-mode .show-invisibles{background-color:#eee;box-shadow:inset #ddd 3px 5px 0.5em}tw-link,.link,tw-icon{cursor:pointer}tw-link,.enchantment-link{color:#4169E1;font-weight:bold;text-decoration:none;transition:color 0.2s ease-in-out}tw-link:hover,.enchantment-link:hover{color:DeepSkyBlue}tw-link:active,.enchantment-link:active{color:#DD4B39}.visited{color:#6941e1}.visited:hover{color:#E3E}tw-broken-link{color:#993333;border-bottom:2px solid #993333;cursor:not-allowed}.enchantment-hover{border-bottom:1px dashed #666}.enchantment-mouseout{border:rgba(64,149,191,0.25) 1px solid}.enchantment-mouseout:hover{background-color:rgba(64,149,191,0.25);border:transparent 1px solid;border-radius:0.2em}html{font:100% Georgia, serif;margin:0;background-color:transparent;color:#000;height:100%;overflow-x:hidden;box-sizing:border-box}*,:before,:after{position:relative;box-sizing:inherit}body{margin:0;background-color:transparent}tw-storydata{display:none}tw-story{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:60%;font-size:1.5em;line-height:1.5em;margin:5% auto}@media screen and (max-width: 1024px){tw-story{font-size:1.2em}}@media screen and (max-width: 896px){tw-story{font-size:1.05em}}@media screen and (max-width: 768px){tw-story{font-size:0.9em}}tw-passage{display:block}tw-sidebar{left:-5em;width:3em;position:absolute;text-align:center;display:block}tw-icon{display:block;margin:0.5em 0;opacity:0.1;font-size:2.75em}tw-icon:hover{opacity:0.3}tw-error{display:inline-block;border-radius:0.2em;padding:0.2em;font-size:1rem;cursor:help}tw-error.error{background-color:rgba(223,58,190,0.4);color:black}tw-error.warning{background-color:rgba(223,140,58,0.4);color:black;display:none}.debug-mode tw-error.warning{display:inline}tw-error-explanation{display:block;font-size:0.8rem;line-height:1rem}tw-error-explanation-button{cursor:pointer;line-height:0em;border-radius:1px;border:1px solid black;font-size:0.8rem;margin:0 0.4rem;opacity:0.5}tw-error-explanation-button .folddown-arrowhead{display:inline-block}tw-notifier{border-radius:0.2em;padding:0.2em;font-size:1rem;background-color:rgba(223,182,58,0.4);display:none}.debug-mode tw-notifier{display:inline}tw-notifier::before{content:attr(message)}tw-colour{border:1px solid black;display:inline-block;width:1em;height:1em}h1{font-size:3em}h2{font-size:2.25em}h3{font-size:1.75em}h1,h2,h3,h4,h5,h6{line-height:1em;margin:0.6em 0}pre{font-size:1rem}small{font-size:70%}big{font-size:120%}mark{color:rgba(0,0,0,0.6);background-color:#ff9}ins{color:rgba(0,0,0,0.6);background-color:rgba(255,242,204,0.5);border-radius:0.5em;box-shadow:0em 0em 0.2em #ffe699;text-decoration:none}del{background-color:#000;text-decoration:none}center{text-align:center;margin:0 auto;width:60%}blink{text-decoration:none;animation:fade-in-out 1s steps(1, end) infinite alternate;-webkit-animation:fade-in-out 1s steps(1, end) infinite alternate}tw-align{display:block}tw-outline{color:white;text-shadow:-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000}tw-shadow{text-shadow:0.08em 0.08em 0.08em #000}tw-emboss{text-shadow:0.08em 0.08em 0em #000;color:white}tw-condense{letter-spacing:-0.08em}tw-expand{letter-spacing:0.1em}tw-blur{color:transparent;text-shadow:0em 0em 0.08em #000}tw-blurrier{color:transparent;text-shadow:0em 0em 0.2em #000}tw-blurrier::selection{background-color:transparent;color:transparent}tw-blurrier::-moz-selection{background-color:transparent;color:transparent}tw-smear{color:transparent;text-shadow:0em 0em 0.02em rgba(0,0,0,0.75),-0.2em 0em 0.5em rgba(0,0,0,0.5),0.2em 0em 0.5em rgba(0,0,0,0.5)}tw-mirror{display:inline-block;transform:scaleX(-1);-webkit-transform:scaleX(-1)}tw-upside-down{display:inline-block;transform:scaleY(-1);-webkit-transform:scaleY(-1)}tw-fade-in-out{text-decoration:none;animation:fade-in-out 2s ease-in-out infinite alternate;-webkit-animation:fade-in-out 2s ease-in-out infinite alternate}tw-rumble{-webkit-animation:rumble linear 0.1s 0s infinite;animation:rumble linear 0.1s 0s infinite;display:inline-block}tw-shudder{-webkit-animation:shudder linear 0.1s 0s infinite;animation:shudder linear 0.1s 0s infinite;display:inline-block}tw-shudder-in{animation:shudder-in 1s ease-out;-webkit-animation:shudder-in 1s ease-out}.transition-in{-webkit-animation:appear 0ms step-start;animation:appear 0ms step-start}.transition-out{-webkit-animation:appear 0ms step-end;animation:appear 0ms step-end}[data-t8n^=fade-in].transition-in,.transition-in[data-t8n^=dissolve]{-webkit-animation:appear 0.8s;animation:appear 0.8s}[data-t8n^=dissolve].transition-out{-webkit-animation:appear 0.8s reverse;animation:appear 0.8s reverse}[data-t8n^=shudder-in].transition-in,.transition-in[data-t8n^=shudder]{display:inline-block;-webkit-animation:shudder-in 0.8s;animation:shudder-in 0.8s}[data-t8n^=shudder-out].transition-out,.transition-out[data-t8n^=shudder]{display:inline-block;-webkit-animation:shudder-out 0.8s;animation:shudder-out 0.8s}[data-t8n^=boxflash].transition-in{-webkit-animation:box-flash 0.8s;animation:box-flash 0.8s}[data-t8n^=pulse].transition-in{-webkit-animation:pulse 0.8s;animation:pulse 0.8s}[data-t8n^=pulse].transition-out{-webkit-animation:pulse 0.8s reverse;animation:pulse 0.8s reverse}[data-t8n$=fast]{animation-duration:0.4s;-webkit-animation-duration:0.4s}[data-t8n$=slow]{animation-duration:1.2s;-webkit-animation-duration:1.2s}
  8. </style>
  9. </head>
  10.  
  11. <body>
  12.  
  13. <tw-story></tw-story>
  14.  
  15. <tw-storydata name="i don&#39;t know who i am" startnode="1" creator="Twine" creator-version="2.0.10" ifid="316B76C8-ECFF-45D0-B0F7-7DB2A36727E4" format="Harlowe" options="" hidden><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css">
  16.  
  17. </style><script role="script" id="twine-user-script" type="text/twine-javascript"></script><tw-passagedata pid="1" name="Start" tags="" position="700,3.3333333333333335">
  18. Touch the last word in this sentence to keep going.(mouseover-append: &quot;going.&quot;)[ This is about the painful memories that never go away.](mouseover-append: &quot;away.&quot;)[ This is about me trying to figure out who I am.](mouseover-append: &quot;am.&quot;)[ THE FIRST THING THAT COMES TO MIND[[ IS...|3rdgradecry]]]
  19. </tw-passagedata>
  20. <tw-passagedata pid="2" name="3rdgradecry" tags="" position="706.6666666666667,173.33333333333334">i was in third grade. i was in class.(mouseover-append: &quot;class.&quot;)[ We were taken in groups into this fake space shuttle cockpit. My niave, daydreaming mind thought it would be a real one. I walked into class to find some plastic tubes in the shape of a shuttle cockpit with a white plastic sheet draped over them.](mouseover-append: &quot;them.&quot;)[ my dream of being an astronaut started to crumble.](mouseover-append: &quot;crumble.&quot;)[ We were in there doing science experiments. Mostly just busy work to make the time pass and make this whole effort seem worth whatever it cost to make.](mouseover-append: &quot;make.&quot;)[ The teacher was outside. Normally strict and vigilant, but she  wanted to maintain the illusion that we were in space communicating with ground control.](mouseover-append:  &quot;control.&quot;)[ Ground control was a bitch.](mouseover-append: &quot;bitch.&quot;)[ We had been working on some worksheet or math problem or something, and I was lagging behind everyone else. They didn&#39;t notice and started to grab everything and put it away.](mouseover-append: &quot;away.&quot;)[ I think they were motivated by some competition that would give a prize to the team that solved everything the fastest.](mouseover-append: &quot;fastest.&quot;)[ I got angry, frustrated, desperate, hurt, panicked, ashamed.](mouseover-append: &quot;ashamed.&quot;)[ my parents always told me i was smart. why was i struggling with this.](mouseover-append:  &quot;this.&quot;)[ I told them to put it back. I wasn&#39;t done. I needed more time.](mouseover-append: &quot;time.&quot;)[ One of them laughed. said something mean. I don&#39;t remember what it was.](mouseover-append: &quot;was.&quot;)[ I started to cry. I thought they were my friends. why were they laughing.](mouseover-append: &quot;laughing.&quot;)[ I was making a scene. they didn&#39;t know what to do.](mouseover-append: &quot;do.&quot;)[ Ground control emailed us, yelled at us. can&#39;t remember.](mouseover-append: &quot;remember.&quot;)[ we checked the email. they told her what was going on.](mouseover-append: &quot;on.&quot;)[ we stood there, waiting for our orders.](mouseover-append: &quot;orders.&quot;)[ Ground control was mad. This was her big day and I was fucking it all up.](mouseover-append: &quot;up.&quot;)[ she replied in all caps. i don&#39;t remember exactly what it said, but i&#39;ll give my best guess.]
  21. (mouseover-append: &quot;guess.&quot;)[ STOP CRYING! ASTRONAUTS DON&#39;T CRY!!! DON&#39;T YOU WANT TO WIN THE ASTROANUT AWARD]
  22. (mouseover-append: &quot;AWARD&quot;)[ i couldn&#39;t hold back the tears. i wanted my mom. i wanted to go home.](mouseover-append: &quot;home.&quot;)[ why was she so angry. why is everyone mad at me.]
  23. (mouseover-append: &quot;at me.&quot;)[ i hope they let me go home. i hate it here.](mouseover-append:  &quot;here.&quot;)[ AND [[THEN|runslikeagirl]]]
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. </tw-passagedata>
  49. <tw-passagedata pid="3" name="runslikeagirl" tags="" position="700,306.6666666666667">i don&#39;t remember how old i was. 12. 13. young enough to think i needed my dad&#39;s approval to be happy.(mouseover-append:  &quot;happy.&quot;)[ our cousins, uncles, aunts, grandparents were at our house. we rarely hosted parties, but this one felt special. maybe it was the gold, pink, purple sunset. maybe it was a birthday party. I don&#39;t remember.](mouseover-append: &quot;remember.&quot;)[ i had excess energy. i was excited. did my mom tell me to run around in the neighborhood park? i don&#39;t remember. somehow, i got out there and ran.](mouseover-append: &quot;ran.&quot;)[ my parents were watching. i wanted to impress them. i wanted to look strong. i wanted to show my dad i wasn&#39;t weak.](mouseover-append: &quot;weak.&quot;)[ i got tired. i walked back to the house and hopped over the fence. out of breath. walking toward the door that led back inside where my family was.](mouseover-append: &quot;was.&quot;)[ wow, you were running so fast! good job.](mouseover-append: &quot;job.&quot;)[ She prodded my dad to join in. or maybe he felt the need to add something.](mouseover-append: &quot;something.&quot;)[ He runs like a girl.](mouseover-append: &quot;girl.&quot;)[ my mom didn&#39;t like that. he laughed, louder and louder.](mouseover-append: &quot;louder.&quot;)[ it hurt.](mouseover-append: &quot;hurt&quot;)[ No, don&#39;t cry. don&#39;t let him see you crying. maybe you were running like a girl. you shouldn&#39;t have gone running.](mouseover-append: &quot;running.&quot;)[ no, it&#39;s okay. just shut up and go back inside.](mouseover-append: &quot;inside.&quot;)[ you&#39;re crying.](mouseover-append: &quot;crying.&quot;)[ it&#39;s okay.](mouseover-append: &quot;okay.&quot;)[ they&#39;re gonna see you and want to know what&#39;s wrong.](mouseover-append: &quot;wrong.&quot;)[ just get out of here. go to the bathroom. you can hide in there for a while.](mouseover-append: &quot;while.&quot;)[ it&#39;s fine.](mouseover-append: &quot;&quot;)[ you&#39;re not a girl. you did run fast.](mouseover-append: &quot;&quot;)[ it&#39;s okay...](mouseover-append: &quot;okay...&quot;)[ you are a girl. he&#39;s right. you&#39;re weak. you&#39;re stupid. why did you do that.](mouseover-append: &quot;that.&quot;)[ JUST [[GO|getoffme]]]
  50.  
  51.  
  52.  
  53.  
  54. </tw-passagedata>
  55. <tw-passagedata pid="4" name="getoffme" tags="" position="702,458">i think i was 21. 22. i don&#39;t know. avoiding the risk of failure for my entire life had given me few opportunities to talk to the women i liked or maintain any sort of healthy relationship with them.
  56.  
  57. but i was getting desperate. i was in my 20s and already worried about dying alone. i didn&#39;t have many friends, and was too scared to express myself to the ones i did have.
  58.  
  59. you&#39;re weird. you&#39;re never going to find anyone because you scare people away. you come on too strong or you just do weird shit and then they&#39;re gone. just kill yourself. fuck this shit. this is stupid. you&#39;re stupid.
  60.  
  61. my desperate attempt to find someone who loved me led me to a woman equally desperate for it. we met online. we quickly met in person.
  62.  
  63. the whole story isn&#39;t worth telling, but it eventually led to us getting naked and trying to have sex on the carpet floor of her room. i guess we stayed off the mattress because her mom was home and we didn&#39;t want to draw attention.
  64.  
  65. the mattress was on the floor. her idea of organizing clothes was to put them all in a big pile near her closet and pick them out as needed. but who am i to judge. my room was a mess, too, and the generosity of my parents was the only reason i had a decent bed.
  66.  
  67. so we tried to have sex. i was already worried it would be a disaster before it started. i didn&#39;t respect her. i didn&#39;t love her. she didn&#39;t love me. we just enjoyed those brief moments when we kissed or touched each other. those moments were shallow and fleeting, but when you&#39;re in the moment, you don&#39;t care who you are or what you&#39;re doing. for a brief moment, you&#39;re just happy. stimulated. together. free. I wanted more of that.
  68.  
  69. so we tried to make it work. it went on for a while. i don&#39;t know how long it was, but i was struggling to finish, and she could tell that, and it made her wonder whether it was her fault.
  70.  
  71. it wasn&#39;t, but i get why she&#39;d think it was. nobody wants to have those thoughts when they&#39;re having sex with someone else.
  72.  
  73.                             HER
  74.                     Get off me!
  75.                    
  76. oh, okay. i guess we&#39;re done then. she pushed me off. i stumbled away, defeated and exhausted.
  77.  
  78. now it was awkward. i think i ripped the condom off, stuck it somewhere where it wouldn&#39;t make a mess, and went to the bathroom across the hall. i guess i got dressed first. i don&#39;t know.
  79.  
  80. i don&#39;t know why i couldn&#39;t cum. maybe it&#39;s all the porn you watch. i don&#39;t watch that much. not much of the weird stuff, at least.
  81.  
  82. maybe you&#39;re gay. maybe you&#39;re a faggot. I&#39;m not gay. i do like women. i like looking at them and thinking about them.
  83.  
  84. then why didn&#39;t you cum
  85.  
  86. i don&#39;t know. i don&#39;t know what&#39;s wrong with me.
  87.  
  88. just get out of here. don&#39;t talk to her anymore. just go home. you&#39;re safe at home. nobody can hurt you when you&#39;re at home. this was a stupid idea anyway.
  89.  
  90. [[next|meds]]</tw-passagedata>
  91. <tw-passagedata pid="5" name="meds" tags="" position="702,608">you were in 8th grade. i don&#39;t remember how it started, but somehow your mom took you to see a psychiatrist. maybe she thought you weren&#39;t happy. maybe i seemed too shy. maybe she saw something i couldn&#39;t see.
  92.  
  93. The psychiatrist was easier to get along with than expected. I was shy at first, but slowly started to open up and tell jokes. not take things so seriously.
  94.  
  95. she had trouble figuring out what was wrong with me, too. took her a while. eventually, she settled on bipolar disorder. mixed bipolar disorder? atypical bipolar? i don&#39;t remember the exact words. I guess it&#39;s a term they use for cases that don&#39;t fit a certain set of conditions. the abnormal ones. the gray area.
  96.  
  97. we tried a lot of different meds. some made me vomit. one made my vision blurry. lithium sent me to the hopsital because i got dehydrated during a bad manic episode. that was a bad time, but it&#39;s all a blur now.
  98.  
  99. Finally, we found mood stabilizers. Topomax and Trilpetal--the generic versions of them. i took them, and they worked. my manic episodes weren&#39;t as severe. my depression wasn&#39;t as bad. everything was leveled out, like a stormy ocean slowly settling back to tranquil water.
  100.  
  101. tranquil is a good for it. they&#39;re like tranquilizers for your emotions, your mind, your thoughts, your creativity, your passion. it&#39;s a blessing and a curse.
  102.  
  103. for years, i went along with it. my parents liked it. i was more stable. I struggled with anything that demanded my focus and creativity, but i got by and tried to not think about what life might be like if I&#39;d chosen differently.
  104.  
  105. then senior year of college hit. those annoyingly enthusiastic guides at my college orientation years ago were right. It did go by like that. faster than i thought it would. i&#39;d had a lot of chances to make friends, reach out, get experience, grow. But when i was given the choice of taking a risk or playing it safe, anxiety would almost always win.
  106.  
  107. nope. too stressful. remember what happened last time you tried that? it&#39;s not worth it. they don&#39;t even like you anyway. they just keep you around out of pity.
  108.  
  109. they&#39;re stupid anyway. they don&#39;t care about what i do or who i am. the only person you can count on is yourself. just go home. it will be okay. you can deal with it once you get home. get out of here. just go, go. keep walking. keep walking. it doesn&#39;t matter. it&#39;s not worth it. just keep walking.
  110.  
  111. [[next|makeup]]
  112.  
  113. </tw-passagedata>
  114. <tw-passagedata pid="6" name="makeup" tags="" position="702,758"></tw-passagedata>
  115. </tw-storydata>
  116.  
  117.  
  118. <script title="Twine engine code" data-main="harlowe">"use strict";var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"])_i["return"]()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr)){return arr}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}else{return Array.from(arr)}}function _typeof(obj){return obj&&typeof Symbol!=="undefined"&&obj.constructor===Symbol?"symbol":typeof obj}(function(){var requirejs,require,define;(function(undef){var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name&&name.charAt(0)==="."){if(baseName){name=name.split("/");lastIndex=name.length-1;if(config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])){name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")}name=baseParts.slice(0,baseParts.length-1).concat(name);for(i=0;i<name.length;i+=1){part=name[i];if(part==="."){name.splice(i,1);i-=1}else if(part===".."){if(i===1&&(name[2]===".."||name[0]==="..")){break}else if(i>0){name.splice(i-1,2);i-=2}}}name=name.join("/")}else if(name.indexOf("./")===0){name=name.substring(2)}}if((baseParts||starMap)&&map){nameParts=name.split("/");for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/");if(baseParts){for(j=baseParts.length;j>0;j-=1){mapValue=map[baseParts.slice(0,j).join("/")];if(mapValue){mapValue=mapValue[nameSegment];if(mapValue){foundMap=mapValue;foundI=i;break}}}}if(foundMap){break}if(!foundStarMap&&starMap&&starMap[nameSegment]){foundStarMap=starMap[nameSegment];starI=i}}if(!foundMap&&foundStarMap){foundMap=foundStarMap;foundI=starI}if(foundMap){nameParts.splice(0,foundI,foundMap);name=nameParts.join("/")}}return name}function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);if(typeof args[0]!=="string"&&args.length===1){args.push(null)}return req.apply(undef,args.concat([relName,forceSync]))}}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(depName){return function(value){defined[depName]=value}}function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name];defining[name]=true;main.apply(undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name)){throw new Error("No "+name)}return defined[name]}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;if(index>-1){prefix=name.substring(0,index);name=name.substring(index+1,name.length)}return[prefix,name]}makeMap=function(name,relName){var plugin,parts=splitPrefix(name),prefix=parts[0];name=parts[1];if(prefix){prefix=normalize(prefix,relName);plugin=callDep(prefix)}if(prefix){if(plugin&&plugin.normalize){name=plugin.normalize(name,makeNormalize(relName))}else{name=normalize(name,relName)}}else{name=normalize(name,relName);parts=splitPrefix(name);prefix=parts[0];name=parts[1];if(prefix){plugin=callDep(prefix)}}return{f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}};function makeConfig(name){return function(){return config&&config.config&&config.config[name]||{}}}handlers={require:function require(name){return makeRequire(name)},exports:function exports(name){var e=defined[name];if(typeof e!=="undefined"){return e}else{return defined[name]={}}},module:function module(name){return{id:name,uri:"",exports:defined[name],config:makeConfig(name)}}};main=function(name,deps,callback,relName){var cjsModule,depName,ret,map,i,args=[],callbackType=typeof callback==="undefined"?"undefined":_typeof(callback),usingExports;relName=relName||name;if(callbackType==="undefined"||callbackType==="function"){deps=!deps.length&&callback.length?["require","exports","module"]:deps;for(i=0;i<deps.length;i+=1){map=makeMap(deps[i],relName);depName=map.f;if(depName==="require"){args[i]=handlers.require(name)}else if(depName==="exports"){args[i]=handlers.exports(name);usingExports=true}else if(depName==="module"){cjsModule=args[i]=handlers.module(name)}else if(hasProp(defined,depName)||hasProp(waiting,depName)||hasProp(defining,depName)){args[i]=callDep(depName)}else if(map.p){map.p.load(map.n,makeRequire(relName,true),makeLoad(depName),{});args[i]=defined[depName]}else{throw new Error(name+" missing "+depName)}}ret=callback?callback.apply(defined[name],args):undefined;if(name){if(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]){defined[name]=cjsModule.exports}else if(ret!==undef||!usingExports){defined[name]=ret}}}else if(name){defined[name]=callback}};requirejs=require=req=function(deps,callback,relName,forceSync,alt){if(typeof deps==="string"){if(handlers[deps]){return handlers[deps](callback)}return callDep(makeMap(deps,callback).f)}else if(!deps.splice){config=deps;if(config.deps){req(config.deps,config.callback)}if(!callback){return}if(callback.splice){deps=callback;callback=relName;relName=null}else{deps=undef}}callback=callback||function(){};if(typeof relName==="function"){relName=forceSync;forceSync=alt}if(forceSync){main(undef,deps,callback,relName)}else{setTimeout(function(){main(undef,deps,callback,relName)},4)}return req};req.config=function(cfg){return req(cfg)};requirejs._defined=defined;define=function(name,deps,callback){if(typeof name!=="string"){throw new Error("See almond README: incorrect module build, no module name")}if(!deps.splice){callback=deps;deps=[]}if(!hasProp(defined,name)&&!hasProp(waiting,name)){waiting[name]=[name,deps,callback]}};define.amd={jQuery:true}})();define("almond",function(){});(function(global,factory){if((typeof module==="undefined"?"undefined":_typeof(module))==="object"&&_typeof(module.exports)==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document")}return factory(w)}}else{factory(global)}})(typeof window!=="undefined"?window:this,function(window,noGlobal){var arr=[];var _slice=arr.slice;var concat=arr.concat;var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var support={};var document=window.document,version="2.1.4",jQuery=function jQuery(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function fcamelCase(all,letter){return letter.toUpperCase()};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,selector:"",length:0,toArray:function toArray(){return _slice.call(this)},get:function get(num){return num!=null?num<0?this[num+this.length]:this[num]:_slice.call(this)},pushStack:function pushStack(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;ret.context=this.context;return ret},each:function each(callback,args){return jQuery.each(this,callback,args)},map:function map(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function slice(){return this.pushStack(_slice.apply(this,arguments))},first:function first(){return this.eq(0)},last:function last(){return this.eq(-1)},eq:function eq(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[])},end:function end(){return this.prevObject||this.constructor(null)},push:push,sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++}if((typeof target==="undefined"?"undefined":_typeof(target))!=="object"&&!jQuery.isFunction(target)){target={}}if(i===length){target=this;i--}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&jQuery.isArray(src)?src:[]}else{clone=src&&jQuery.isPlainObject(src)?src:{}}target[name]=jQuery.extend(deep,clone,copy)}else if(copy!==undefined){target[name]=copy}}}}return target};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,error:function error(msg){throw new Error(msg)},noop:function noop(){},isFunction:function isFunction(obj){return jQuery.type(obj)==="function"},isArray:Array.isArray,isWindow:function isWindow(obj){return obj!=null&&obj===obj.window},isNumeric:function isNumeric(obj){return!jQuery.isArray(obj)&&obj-parseFloat(obj)+1>=0},isPlainObject:function isPlainObject(obj){if(jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false}if(obj.constructor&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false}return true},isEmptyObject:function isEmptyObject(obj){var name;for(name in obj){return false}return true},type:function type(obj){if(obj==null){return obj+""}return(typeof obj==="undefined"?"undefined":_typeof(obj))==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj==="undefined"?"undefined":_typeof(obj)},globalEval:function globalEval(code){var script,indirect=eval;code=jQuery.trim(code);if(code){if(code.indexOf("use strict")===1){script=document.createElement("script");script.text=code;document.head.appendChild(script).parentNode.removeChild(script)}else{indirect(code)}}},camelCase:function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function each(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray){for(;i<length;i++){value=callback.apply(obj[i],args);if(value===false){break}}}else{for(i in obj){value=callback.apply(obj[i],args);if(value===false){break}}}}else{if(isArray){for(;i<length;i++){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}else{for(i in obj){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}}return obj},trim:function trim(text){return text==null?"":(text+"").replace(rtrim,"")},makeArray:function makeArray(arr,results){var ret=results||[];if(arr!=null){if(isArraylike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr)}else{push.call(ret,arr)}}return ret},inArray:function inArray(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i)},merge:function merge(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j]}first.length=i;return first},grep:function grep(elems,callback,invert){var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i);if(callbackInverse!==callbackExpect){matches.push(elems[i])}}return matches},map:function map(elems,callback,arg){var value,i=0,length=elems.length,isArray=isArraylike(elems),ret=[];if(isArray){for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}return concat.apply([],ret)},guid:1,proxy:function proxy(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp}if(!jQuery.isFunction(fn)){return undefined}args=_slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(_slice.call(arguments)))};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy},now:Date.now,support:support});jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()});function isArraylike(obj){var length="length"in obj&&obj.length,type=jQuery.type(obj);if(type==="function"||jQuery.isWindow(obj)){return false}if(obj.nodeType===1&&length){return true}return type==="array"||length===0||typeof length==="number"&&length>0&&length-1 in obj}var Sizzle=function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function sortOrder(a,b){if(a===b){hasDuplicate=true}return 0},MAX_NEGATIVE=1<<31,hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function indexOf(list,elem){var i=0,len=list.length;for(;i<len;i++){if(list[i]===elem){return i}}return-1},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",characterEncoding="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",identifier=characterEncoding.replace("w","w#"),attributes="\\["+whitespace+"*("+characterEncoding+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+characterEncoding+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function funescape(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,high&1023|56320)},unloadHandler=function unloadHandler(){setDocument()};try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){var j=target.length,i=0;while(target[j++]=els[i++]){}target.length=j-1}}}function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context)}context=context||document;results=results||[];nodeType=context.nodeType;if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results}if(!seed&&documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if(m=match[1]){if(nodeType===9){elem=context.getElementById(m);if(elem&&elem.parentNode){if(elem.id===m){results.push(elem);return results}}else{return results}}else{if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results}else if((m=match[3])&&support.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results}}if(support.qsa&&(!rbuggyQSA||!rbuggyQSA.test(selector))){nid=old=expando;newContext=context;newSelector=nodeType!==1&&selector;if(nodeType===1&&context.nodeName.toLowerCase()!=="object"){groups=tokenize(selector);if(old=context.getAttribute("id")){nid=old.replace(rescape,"\\$&")}else{context.setAttribute("id",nid)}nid="[id='"+nid+"'] ";i=groups.length;while(i--){groups[i]=nid+toSelector(groups[i])}newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;newSelector=groups.join(",")}if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results}catch(qsaError){}finally{if(!old){context.removeAttribute("id")}}}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()]}return cache[key+" "]=value}return cache}function markFunction(fn){fn[expando]=true;return fn}function assert(fn){var div=document.createElement("div");try{return!!fn(div)}catch(e){return false}finally{if(div.parentNode){div.parentNode.removeChild(div)}div=null}}function addHandle(attrs,handler){var arr=attrs.split("|"),i=attrs.length;while(i--){Expr.attrHandle[arr[i]]=handler}}function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff){return diff}if(cur){while(cur=cur.nextSibling){if(cur===b){return-1}}}return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[j=matchIndexes[i]]){seed[j]=!(matches[j]=seed[j])}}})})}function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context}support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};setDocument=Sizzle.setDocument=function(node){var hasCompare,parent,doc=node?node.ownerDocument||node:preferredDoc;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document}document=doc;docElem=doc.documentElement;parent=doc.defaultView;if(parent&&parent!==parent.top){if(parent.addEventListener){parent.addEventListener("unload",unloadHandler,false)}else if(parent.attachEvent){parent.attachEvent("onunload",unloadHandler)}}documentIsHTML=!isXML(doc);support.attributes=assert(function(div){div.className="i";return!div.getAttribute("className")});support.getElementsByTagName=assert(function(div){div.appendChild(doc.createComment(""));return!div.getElementsByTagName("*").length});support.getElementsByClassName=rnative.test(doc.getElementsByClassName);support.getById=assert(function(div){docElem.appendChild(div).id=expando;return!doc.getElementsByName||!doc.getElementsByName(expando).length});if(support.getById){Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}};Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}}else{delete Expr.find["ID"];Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId}}}Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag)}else if(support.qsa){return context.querySelectorAll(tag)}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while(elem=results[i++]){if(elem.nodeType===1){tmp.push(elem)}}return tmp}return results};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(documentIsHTML){return context.getElementsByClassName(className)}};rbuggyMatches=[];rbuggyQSA=[];if(support.qsa=rnative.test(doc.querySelectorAll)){assert(function(div){docElem.appendChild(div).innerHTML="<a id='"+expando+"'></a>"+"<select id='"+expando+"-\f]' msallowcapture=''>"+"<option selected=''></option></select>";if(div.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")")}if(!div.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")")}if(!div.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=")}if(!div.querySelectorAll(":checked").length){rbuggyQSA.push(":checked")}if(!div.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]")}});assert(function(div){var input=doc.createElement("input");input.setAttribute("type","hidden");div.appendChild(input).setAttribute("name","D");if(div.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=")}if(!div.querySelectorAll(":enabled").length){rbuggyQSA.push(":enabled",":disabled")}div.querySelectorAll("*,:x");rbuggyQSA.push(",.*:")})}if(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)){assert(function(div){support.disconnectedMatch=matches.call(div,"div");matches.call(div,"[s!='']:x");rbuggyMatches.push("!=",pseudos)})}rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16))}:function(a,b){if(b){while(b=b.parentNode){if(b===a){return true}}}return false};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0}var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare}compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||!support.sortDetached&&b.compareDocumentPosition(a)===compare){if(a===doc||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)){return-1}if(b===doc||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)){return 1}return sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0}return compare&4?-1:1}:function(a,b){if(a===b){hasDuplicate=true;return 0}var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a===doc?-1:b===doc?1:aup?-1:bup?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0}else if(aup===bup){return siblingCheck(a,b)}cur=a;while(cur=cur.parentNode){ap.unshift(cur)}cur=b;while(cur=cur.parentNode){bp.unshift(cur)}while(ap[i]===bp[i]){i++}return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0};return doc};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem)}expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret}}catch(e){}}return Sizzle(expr,document,null,[elem]).length>0};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context)}return contains(context,elem)};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem)}var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while(elem=results[i++]){if(elem===results[i]){j=duplicates.push(i)}}while(j--){results.splice(duplicates[j],1)}}sortInput=null;return results};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while(node=elem[i++]){ret+=getText(node)}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem)}}}else if(nodeType===3||nodeType===4){return elem.nodeValue}return ret};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function ATTR(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" "}return match.slice(0,4)},CHILD:function CHILD(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0])}match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+(match[7]+match[8]||match[3]==="odd")}else if(match[3]){Sizzle.error(match[0])}return match},PSEUDO:function PSEUDO(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null}if(match[3]){match[2]=match[4]||match[5]||""}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess)}return match.slice(0,3)}},filter:{TAG:function TAG(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function CLASS(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"")})},ATTR:function ATTR(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!="}if(!operator){return true}result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false}},CHILD:function CHILD(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){while(dir){node=elem;while(node=node[dir]){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false}}start=dir=type==="only"&&!start&&"nextSibling"}return true}start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){outerCache=parent[expando]||(parent[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=cache[0]===dirruns&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop()){if(node.nodeType===1&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns){diff=cache[1]}else{while(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop()){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){(node[expando]||(node[expando]={}))[type]=[dirruns,diff]}if(node===elem){break}}}}diff-=last;return diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function PSEUDO(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument)}if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i])}}):function(elem){return fn(elem,0,args)}}return fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if(elem=unmatched[i]){seed[i]=!(matches[i]=elem)}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang)}lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang")){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0}}while((elem=elem.parentNode)&&elem.nodeType===1);return false}}),target:function target(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function root(elem){return elem===docElem},focus:function focus(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function enabled(elem){return elem.disabled===false},disabled:function disabled(elem){return elem.disabled===true},checked:function checked(elem){var nodeName=elem.nodeName.toLowerCase();return nodeName==="input"&&!!elem.checked||nodeName==="option"&&!!elem.selected;
  119.  
  120. },selected:function selected(elem){if(elem.parentNode){elem.parentNode.selectedIndex}return elem.selected===true},empty:function empty(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false}}return true},parent:function parent(elem){return!Expr.pseudos["empty"](elem)},header:function header(elem){return rheader.test(elem.nodeName)},input:function input(elem){return rinputs.test(elem.nodeName)},button:function button(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button"},text:function text(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text")},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i)}return matchIndexes}),odd:createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i)}return matchIndexes}),lt:createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;--i>=0;){matchIndexes.push(i)}return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i)}return matchIndexes})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i)}for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i)}function setFilters(){}setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters;tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0)}soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar}groups.push(tokens=[])}matched=false;if(match=rcombinators.exec(soFar)){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length)}for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length)}}if(!matched){break}}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)};function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value}return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,checkNonElements=base&&dir==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml)}}}:function(elem,context,xml){var oldCache,outerCache,newCache=[dirruns,doneName];if(xml){while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true}}}}else{while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});if((oldCache=outerCache[dir])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return newCache[2]=oldCache[2]}else{outerCache[dir]=newCache;if(newCache[2]=matcher(elem,context,xml)){return true}}}}}}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false}}return true}:matchers[0]}function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results)}return results}function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if(elem=unmatched[i]){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i)}}}}return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter)}if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector)}return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml)}if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if(elem=temp[i]){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem)}}}if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if(elem=matcherOut[i]){temp.push(matcherIn[i]=elem)}}postFinder(null,matcherOut=[],temp,xml)}i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem)}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml)}else{push.apply(results,matcherOut)}}})}function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1},implicitRelative,true),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret}];for(;i<len;i++){if(matcher=Expr.relative[tokens[i].type]){matchers=[addCombinator(elementMatcher(matchers),matcher)]}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break}}return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens(tokens=tokens.slice(j)),j<len&&toSelector(tokens))}matchers.push(matcher)}}return elementMatcher(matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function superMatcher(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),dirrunsUnique=dirruns+=contextBackup==null?1:Math.random()||.1,len=elems.length;if(outermost){outermostContext=context!==document&&context}for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;while(matcher=elementMatchers[j++]){if(matcher(elem,context,xml)){results.push(elem);break}}if(outermost){dirruns=dirrunsUnique}}if(bySet){if(elem=!matcher&&elem){matchedCount--}if(seed){unmatched.push(elem)}}}matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while(matcher=setMatchers[j++]){matcher(unmatched,setMatched,context,xml)}if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results)}}}setMatched=condense(setMatched)}push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1){Sizzle.uniqueSort(results)}}if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup}return unmatched};return bySet?markFunction(superMatcher):superMatcher}compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector)}i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached)}else{elementMatchers.push(cached)}}cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector}return cached};select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize(selector=compiled.selector||selector);results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&support.getById&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results}else if(compiled){context=context.parentNode}selector=selector.slice(tokens.shift().value.length)}i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[type=token.type]){break}if(find=Expr.find[type]){if(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context)){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results}break}}}}(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,rsibling.test(selector)&&testContext(context.parentNode)||context);return results};support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(div1){return div1.compareDocumentPosition(document.createElement("div"))&1});if(!assert(function(div){div.innerHTML="<a href='#'></a>";return div.firstChild.getAttribute("href")==="#"})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2)}})}if(!support.attributes||!assert(function(div){div.innerHTML="<input/>";div.firstChild.setAttribute("value","");return div.firstChild.getAttribute("value")===""})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue}})}if(!assert(function(div){return div.getAttribute("disabled")==null})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}})}return Sizzle}(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;var rneedsContext=jQuery.expr.match.needsContext;var rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/;var risSimple=/^.[^:#\[\.,]*$/;function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not})}if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not})}if(typeof qualifier==="string"){if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not)}qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>=0!==not})}jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")"}return elems.length===1&&elem.nodeType===1?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1}))};jQuery.fn.extend({find:function find(selector){var i,len=this.length,ret=[],self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true}}}))}for(i=0;i<len;i++){jQuery.find(selector,self[i],ret)}ret=this.pushStack(len>1?jQuery.unique(ret):ret);ret.selector=this.selector?this.selector+" "+selector:selector;return ret},filter:function filter(selector){return this.pushStack(winnow(this,selector||[],false))},not:function not(selector){return this.pushStack(winnow(this,selector||[],true))},is:function is(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(selector,context){var match,elem;if(!selector){return this}if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null]}else{match=rquickExpr.exec(selector)}if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match])}else{this.attr(match,context[match])}}}return this}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){this.length=1;this[0]=elem}this.context=document;this.selector=selector;return this}}else if(!context||context.jquery){return(context||rootjQuery).find(selector)}else{return this.constructor(context).find(selector)}}else if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}else if(jQuery.isFunction(selector)){return typeof rootjQuery.ready!=="undefined"?rootjQuery.ready(selector):selector(jQuery)}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}return jQuery.makeArray(selector,this)};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.extend({dir:function dir(elem,_dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[_dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break}matched.push(elem)}}return matched},sibling:function sibling(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n)}}return matched}});jQuery.fn.extend({has:function has(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,targets[i])){return true}}})},closest:function closest(selectors,context){var cur,i=0,l=this.length,matched=[],pos=rneedsContext.test(selectors)||typeof selectors!=="string"?jQuery(selectors,context||this.context):0;for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(pos?pos.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}}}return this.pushStack(matched.length>1?jQuery.unique(matched):matched)},index:function index(elem){if(!elem){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0])}return indexOf.call(this,elem.jquery?elem[0]:elem)},add:function add(selector,context){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function addBack(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector))}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){}return cur}jQuery.each({parent:function parent(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents:function parents(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function parentsUntil(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function next(elem){return sibling(elem,"nextSibling")},prev:function prev(elem){return sibling(elem,"previousSibling")},nextAll:function nextAll(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function prevAll(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function nextUntil(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function prevUntil(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function siblings(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem)},children:function children(elem){return jQuery.sibling(elem.firstChild)},contents:function contents(elem){return elem.contentDocument||jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until}if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched)}if(this.length>1){if(!guaranteedUnique[name]){jQuery.unique(matched)}if(rparentsprev.test(name)){matched.reverse()}}return this.pushStack(matched)}});var rnotwhite=/\S+/g;var optionsCache={};function createOptions(options){var object=optionsCache[options]={};jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=true});return object}jQuery.Callbacks=function(options){options=typeof options==="string"?optionsCache[options]||createOptions(options):jQuery.extend({},options);var memory,_fired,firing,firingStart,firingLength,firingIndex,list=[],stack=!options.once&&[],fire=function fire(data){memory=options.memory&&data;_fired=true;firingIndex=firingStart||0;firingStart=0;firingLength=list.length;firing=true;for(;list&&firingIndex<firingLength;firingIndex++){if(list[firingIndex].apply(data[0],data[1])===false&&options.stopOnFalse){memory=false;break}}firing=false;if(list){if(stack){if(stack.length){fire(stack.shift())}}else if(memory){list=[]}else{self.disable()}}},self={add:function add(){if(list){var start=list.length;(function add(args){jQuery.each(args,function(_,arg){var type=jQuery.type(arg);if(type==="function"){if(!options.unique||!self.has(arg)){list.push(arg)}}else if(arg&&arg.length&&type!=="string"){add(arg)}})})(arguments);if(firing){firingLength=list.length}else if(memory){firingStart=start;fire(memory)}}return this},remove:function remove(){if(list){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(firing){if(index<=firingLength){firingLength--}if(index<=firingIndex){firingIndex--}}}})}return this},has:function has(fn){return fn?jQuery.inArray(fn,list)>-1:!!(list&&list.length)},empty:function empty(){list=[];firingLength=0;return this},disable:function disable(){list=stack=memory=undefined;return this},disabled:function disabled(){return!list},lock:function lock(){stack=undefined;if(!memory){self.disable()}return this},locked:function locked(){return!stack},fireWith:function fireWith(context,args){if(list&&(!_fired||stack)){args=args||[];args=[context,args.slice?args.slice():args];if(firing){stack.push(args)}else{fire(args)}}return this},fire:function fire(){self.fireWith(this,arguments);return this},fired:function fired(){return!!_fired}};return self};jQuery.extend({Deferred:function Deferred(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],_state="pending",_promise2={state:function state(){return _state},always:function always(){deferred.done(arguments).fail(arguments);return this},then:function then(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify)}else{newDefer[tuple[0]+"With"](this===_promise2?newDefer.promise():this,fn?[returned]:arguments)}})});fns=null}).promise()},promise:function promise(obj){return obj!=null?jQuery.extend(obj,_promise2):_promise2}},deferred={};_promise2.pipe=_promise2.then;jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];_promise2[tuple[1]]=list.add;if(stateString){list.add(function(){_state=stateString},tuples[i^1][2].disable,tuples[2][2].lock)}deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?_promise2:this,arguments);return this};deferred[tuple[0]+"With"]=list.fireWith});_promise2.promise(deferred);if(func){func.call(deferred,deferred)}return deferred},when:function when(subordinate){var i=0,resolveValues=_slice.call(arguments),length=resolveValues.length,remaining=length!==1||subordinate&&jQuery.isFunction(subordinate.promise)?length:0,deferred=remaining===1?subordinate:jQuery.Deferred(),updateFunc=function updateFunc(i,contexts,values){return function(value){contexts[i]=this;values[i]=arguments.length>1?_slice.call(arguments):value;if(values===progressValues){deferred.notifyWith(contexts,values)}else if(!--remaining){deferred.resolveWith(contexts,values)}}},progressValues,progressContexts,resolveContexts;if(length>1){progressValues=new Array(length);progressContexts=new Array(length);resolveContexts=new Array(length);for(;i<length;i++){if(resolveValues[i]&&jQuery.isFunction(resolveValues[i].promise)){resolveValues[i].promise().done(updateFunc(i,resolveContexts,resolveValues)).fail(deferred.reject).progress(updateFunc(i,progressContexts,progressValues))}else{--remaining}}}if(!remaining){deferred.resolveWith(resolveContexts,resolveValues)}return deferred.promise()}});var readyList;jQuery.fn.ready=function(fn){jQuery.ready.promise().done(fn);return this};jQuery.extend({isReady:false,readyWait:1,holdReady:function holdReady(hold){if(hold){jQuery.readyWait++}else{jQuery.ready(true)}},ready:function ready(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return}jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return}readyList.resolveWith(document,[jQuery]);if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");jQuery(document).off("ready")}}});function completed(){document.removeEventListener("DOMContentLoaded",completed,false);window.removeEventListener("load",completed,false);jQuery.ready()}jQuery.ready.promise=function(obj){if(!readyList){readyList=jQuery.Deferred();if(document.readyState==="complete"){setTimeout(jQuery.ready)}else{document.addEventListener("DOMContentLoaded",completed,false);window.addEventListener("load",completed,false)}}return readyList.promise(obj)};jQuery.ready.promise();var access=jQuery.access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(jQuery.type(key)==="object"){chainable=true;for(i in key){jQuery.access(elems,fn,i,key[i],true,emptyGet,raw)}}else if(value!==undefined){chainable=true;if(!jQuery.isFunction(value)){raw=true}if(bulk){if(raw){fn.call(elems,value);fn=null}else{bulk=fn;fn=function(elem,key,value){return bulk.call(jQuery(elem),value)}}}if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)))}}}return chainable?elems:bulk?fn.call(elems):len?fn(elems[0],key):emptyGet};jQuery.acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!+owner.nodeType};function Data(){Object.defineProperty(this.cache={},0,{get:function get(){return{}}});this.expando=jQuery.expando+Data.uid++}Data.uid=1;Data.accepts=jQuery.acceptData;Data.prototype={key:function key(owner){if(!Data.accepts(owner)){return 0}var descriptor={},unlock=owner[this.expando];if(!unlock){unlock=Data.uid++;try{descriptor[this.expando]={value:unlock};Object.defineProperties(owner,descriptor)}catch(e){descriptor[this.expando]=unlock;jQuery.extend(owner,descriptor)}}if(!this.cache[unlock]){this.cache[unlock]={}}return unlock},set:function set(owner,data,value){var prop,unlock=this.key(owner),cache=this.cache[unlock];if(typeof data==="string"){cache[data]=value}else{if(jQuery.isEmptyObject(cache)){jQuery.extend(this.cache[unlock],data)}else{for(prop in data){cache[prop]=data[prop]}}}return cache},get:function get(owner,key){var cache=this.cache[this.key(owner)];return key===undefined?cache:cache[key]},access:function access(owner,key,value){var stored;if(key===undefined||key&&typeof key==="string"&&value===undefined){stored=this.get(owner,key);return stored!==undefined?stored:this.get(owner,jQuery.camelCase(key))}this.set(owner,key,value);return value!==undefined?value:key},remove:function remove(owner,key){var i,name,camel,unlock=this.key(owner),cache=this.cache[unlock];if(key===undefined){this.cache[unlock]={}}else{if(jQuery.isArray(key)){name=key.concat(key.map(jQuery.camelCase))}else{camel=jQuery.camelCase(key);if(key in cache){name=[key,camel]}else{name=camel;name=name in cache?[name]:name.match(rnotwhite)||[]}}i=name.length;while(i--){delete cache[name[i]]}}},hasData:function hasData(owner){return!jQuery.isEmptyObject(this.cache[owner[this.expando]]||{})},discard:function discard(owner){if(owner[this.expando]){delete this.cache[owner[this.expando]]}}};var data_priv=new Data;var data_user=new Data;var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/([A-Z])/g;function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}data_user.set(elem,key,data)}else{data=undefined}}return data}jQuery.extend({hasData:function hasData(elem){return data_user.hasData(elem)||data_priv.hasData(elem)},data:function data(elem,name,_data){return data_user.access(elem,name,_data)},removeData:function removeData(elem,name){data_user.remove(elem,name)},_data:function _data(elem,name,data){return data_priv.access(elem,name,data)},_removeData:function _removeData(elem,name){data_priv.remove(elem,name)}});jQuery.fn.extend({data:function data(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=data_user.get(elem);if(elem.nodeType===1&&!data_priv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=jQuery.camelCase(name.slice(5));dataAttr(elem,name,data[name])}}}data_priv.set(elem,"hasDataAttrs",true)}}return data}if((typeof key==="undefined"?"undefined":_typeof(key))==="object"){return this.each(function(){data_user.set(this,key)})}return access(this,function(value){var data,camelKey=jQuery.camelCase(key);if(elem&&value===undefined){data=data_user.get(elem,key);if(data!==undefined){return data}data=data_user.get(elem,camelKey);if(data!==undefined){return data}data=dataAttr(elem,camelKey,undefined);if(data!==undefined){return data}return}this.each(function(){var data=data_user.get(this,camelKey);data_user.set(this,camelKey,value);if(key.indexOf("-")!==-1&&data!==undefined){data_user.set(this,key,value)}})},null,value,arguments.length>1,null,true)},removeData:function removeData(key){return this.each(function(){data_user.remove(this,key)})}});jQuery.extend({queue:function queue(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=data_priv.get(elem,type);if(data){if(!queue||jQuery.isArray(data)){queue=data_priv.access(elem,type,jQuery.makeArray(data))}else{queue.push(data)}}return queue||[]}},dequeue:function dequeue(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function next(){jQuery.dequeue(elem,type)};if(fn==="inprogress"){fn=queue.shift();startLength--}if(fn){if(type==="fx"){queue.unshift("inprogress")}delete hooks.stop;fn.call(elem,next,hooks)}if(!startLength&&hooks){hooks.empty.fire()}},_queueHooks:function _queueHooks(elem,type){var key=type+"queueHooks";return data_priv.get(elem,key)||data_priv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){data_priv.remove(elem,[type+"queue",key])})})}});jQuery.fn.extend({queue:function queue(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--}if(arguments.length<setter){return jQuery.queue(this[0],type)}return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function dequeue(type){return this.each(function(){jQuery.dequeue(this,type)})},clearQueue:function clearQueue(type){return this.queue(type||"fx",[])},promise:function promise(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function resolve(){if(!--count){defer.resolveWith(elements,[elements])}};if(typeof type!=="string"){obj=type;type=undefined}type=type||"fx";while(i--){tmp=data_priv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve)}}resolve();return defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;var cssExpand=["Top","Right","Bottom","Left"];var isHidden=function isHidden(elem,el){elem=el||elem;return jQuery.css(elem,"display")==="none"||!jQuery.contains(elem.ownerDocument,elem)};var rcheckableType=/^(?:checkbox|radio)$/i;(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue})();var strundefined=typeof undefined==="undefined"?"undefined":_typeof(undefined);support.focusinBubbles="onfocusin"in window;var rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;function returnTrue(){return true}function returnFalse(){return false}function safeActiveElement(){try{return document.activeElement}catch(err){}}jQuery.event={global:{},add:function add(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=data_priv.get(elem);if(!elemData){return}if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector}if(!handler.guid){handler.guid=jQuery.guid++}if(!(events=elemData.events)){events=elemData.events={}}if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return(typeof jQuery==="undefined"?"undefined":_typeof(jQuery))!==strundefined&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined}}types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue}special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false)}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}if(selector){handlers.splice(handlers.delegateCount++,0,handleObj)}else{
  121. handlers.push(handleObj)}jQuery.event.global[type]=true}},remove:function remove(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=data_priv.hasData(elem)&&data_priv.get(elem);if(!elemData||!(events=elemData.events)){return}types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true)}continue}special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--}if(special.remove){special.remove.call(elem,handleObj)}}}if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle)}delete events[type]}}if(jQuery.isEmptyObject(events)){delete elemData.handle;data_priv.remove(elem,"events")}},trigger:function trigger(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return}if(rfocusMorph.test(type+jQuery.event.triggered)){return}if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();namespaces.sort()}ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,(typeof event==="undefined"?"undefined":_typeof(event))==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem}data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return}if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode}for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur}if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window)}}i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(data_priv.get(cur,"events")||{})[event.type]&&data_priv.get(cur,"handle");if(handle){handle.apply(cur,data)}handle=ontype&&cur[ontype];if(handle&&handle.apply&&jQuery.acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault()}}}event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&jQuery.acceptData(elem)){if(ontype&&jQuery.isFunction(elem[type])&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null}jQuery.event.triggered=type;elem[type]();jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp}}}}return event.result},dispatch:function dispatch(event){event=jQuery.event.fix(event);var i,j,ret,matched,handleObj,handlerQueue=[],args=_slice.call(arguments),handlers=(data_priv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return}handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation()}}}}}if(special.postDispatch){special.postDispatch.call(this,event)}return event.result},handlers:function handlers(event,_handlers){var i,matches,sel,handleObj,handlerQueue=[],delegateCount=_handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||event.type!=="click")){for(;cur!==this;cur=cur.parentNode||this){if(cur.disabled!==true||event.type!=="click"){matches=[];for(i=0;i<delegateCount;i++){handleObj=_handlers[i];sel=handleObj.selector+" ";if(matches[sel]===undefined){matches[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>=0:jQuery.find(sel,this,null,[cur]).length}if(matches[sel]){matches.push(handleObj)}}if(matches.length){handlerQueue.push({elem:cur,handlers:matches})}}}}if(delegateCount<_handlers.length){handlerQueue.push({elem:this,handlers:_handlers.slice(delegateCount)})}return handlerQueue},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function filter(event,original){if(event.which==null){event.which=original.charCode!=null?original.charCode:original.keyCode}return event}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function filter(event,original){var eventDoc,doc,body,button=original.button;if(event.pageX==null&&original.clientX!=null){eventDoc=event.target.ownerDocument||document;doc=eventDoc.documentElement;body=eventDoc.body;event.pageX=original.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=original.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}if(!event.which&&button!==undefined){event.which=button&1?1:button&2?3:button&4?2:0}return event}},fix:function fix(event){if(event[jQuery.expando]){return event}var i,prop,copy,type=event.type,originalEvent=event,fixHook=this.fixHooks[type];if(!fixHook){this.fixHooks[type]=fixHook=rmouseEvent.test(type)?this.mouseHooks:rkeyEvent.test(type)?this.keyHooks:{}}copy=fixHook.props?this.props.concat(fixHook.props):this.props;event=new jQuery.Event(originalEvent);i=copy.length;while(i--){prop=copy[i];event[prop]=originalEvent[prop]}if(!event.target){event.target=document}if(event.target.nodeType===3){event.target=event.target.parentNode}return fixHook.filter?fixHook.filter(event,originalEvent):event},special:{load:{noBubble:true},focus:{trigger:function trigger(){if(this!==safeActiveElement()&&this.focus){this.focus();return false}},delegateType:"focusin"},blur:{trigger:function trigger(){if(this===safeActiveElement()&&this.blur){this.blur();return false}},delegateType:"focusout"},click:{trigger:function trigger(){if(this.type==="checkbox"&&this.click&&jQuery.nodeName(this,"input")){this.click();return false}},_default:function _default(event){return jQuery.nodeName(event.target,"a")}},beforeunload:{postDispatch:function postDispatch(event){if(event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result}}}},simulate:function simulate(type,elem,event,bubble){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:true,originalEvent:{}});if(bubble){jQuery.event.trigger(e,null,elem)}else{jQuery.event.dispatch.call(elem,e)}if(e.isDefaultPrevented()){event.preventDefault()}}};jQuery.removeEvent=function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle,false)}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props)}if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?returnTrue:returnFalse}else{this.type=src}if(props){jQuery.extend(this,props)}this.timeStamp=src&&src.timeStamp||jQuery.now();this[jQuery.expando]=true};jQuery.Event.prototype={isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,preventDefault:function preventDefault(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(e&&e.preventDefault){e.preventDefault()}},stopPropagation:function stopPropagation(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(e&&e.stopPropagation){e.stopPropagation()}},stopImmediatePropagation:function stopImmediatePropagation(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue;if(e&&e.stopImmediatePropagation){e.stopImmediatePropagation()}this.stopPropagation()}};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function handle(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||related!==target&&!jQuery.contains(target,related)){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix}return ret}}});if(!support.focusinBubbles){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function handler(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event),true)};jQuery.event.special[fix]={setup:function setup(){var doc=this.ownerDocument||this,attaches=data_priv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true)}data_priv.access(doc,fix,(attaches||0)+1)},teardown:function teardown(){var doc=this.ownerDocument||this,attaches=data_priv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);data_priv.remove(doc,fix)}else{data_priv.access(doc,fix,attaches)}}}})}jQuery.fn.extend({on:function on(types,selector,data,fn,one){var origFn,type;if((typeof types==="undefined"?"undefined":_typeof(types))==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined}for(type in types){this.on(type,selector,data,types[type],one)}return this}if(data==null&&fn==null){fn=selector;data=selector=undefined}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined}else{fn=data;data=selector;selector=undefined}}if(fn===false){fn=returnFalse}else if(!fn){return this}if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments)};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)}return this.each(function(){jQuery.event.add(this,types,fn,data,selector)})},one:function one(types,selector,data,fn){return this.on(types,selector,data,fn,1)},off:function off(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this}if((typeof types==="undefined"?"undefined":_typeof(types))==="object"){for(type in types){this.off(type,selector,types[type])}return this}if(selector===false||typeof selector==="function"){fn=selector;selector=undefined}if(fn===false){fn=returnFalse}return this.each(function(){jQuery.event.remove(this,types,fn,selector)})},trigger:function trigger(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function triggerHandler(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true)}}});var rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rhtml=/<|&#?\w+;/,rnoInnerhtml=/<(?:script|style|link)/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/^$|\/(?:java|ecma)script/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(content.nodeType!==11?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);if(match){elem.type=match[1]}else{elem.removeAttribute("type")}return elem}function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){data_priv.set(elems[i],"globalEval",!refElements||data_priv.get(refElements[i],"globalEval"))}}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(dest.nodeType!==1){return}if(data_priv.hasData(src)){pdataOld=data_priv.access(src);pdataCur=data_priv.set(dest,pdataOld);events=pdataOld.events;if(events){delete pdataCur.handle;pdataCur.events={};for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i])}}}}if(data_user.hasData(src)){udataOld=data_user.access(src);udataCur=jQuery.extend({},udataOld);data_user.set(dest,udataCur)}}function getAll(context,tag){var ret=context.getElementsByTagName?context.getElementsByTagName(tag||"*"):context.querySelectorAll?context.querySelectorAll(tag||"*"):[];return tag===undefined||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],ret):ret}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){dest.checked=src.checked}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue}}jQuery.extend({clone:function clone(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=jQuery.contains(elem.ownerDocument,elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i])}}if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i])}}else{cloneCopyEvent(elem,clone)}}destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"))}return clone},buildFragment:function buildFragment(elems,context,scripts,selection){var elem,tmp,tag,wrap,contains,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(jQuery.type(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem)}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem))}else{tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+elem.replace(rxhtmlTag,"<$1></$2>")+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild}jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent=""}}}fragment.textContent="";i=0;while(elem=nodes[i++]){if(selection&&jQuery.inArray(elem,selection)!==-1){continue}contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(fragment.appendChild(elem),"script");if(contains){setGlobalEval(tmp)}if(scripts){j=0;while(elem=tmp[j++]){if(rscriptType.test(elem.type||"")){scripts.push(elem)}}}}return fragment},cleanData:function cleanData(elems){var data,elem,type,key,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(jQuery.acceptData(elem)){key=elem[data_priv.expando];if(key&&(data=data_priv.cache[key])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type)}else{jQuery.removeEvent(elem,type,data.handle)}}}if(data_priv.cache[key]){delete data_priv.cache[key]}}}delete data_user.cache[elem[data_user.expando]]}}});jQuery.fn.extend({text:function text(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value}})},null,value,arguments.length)},append:function append(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem)}})},prepend:function prepend(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function before(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this)}})},after:function after(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling)}})},remove:function remove(selector,keepData){var elem,elems=selector?jQuery.filter(selector,this):this,i=0;for(;(elem=elems[i])!=null;i++){if(!keepData&&elem.nodeType===1){jQuery.cleanData(getAll(elem))}if(elem.parentNode){if(keepData&&jQuery.contains(elem.ownerDocument,elem)){setGlobalEval(getAll(elem,"script"))}elem.parentNode.removeChild(elem)}}return this},empty:function empty(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent=""}}return this},clone:function clone(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function html(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML}if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1></$2>");try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value}}elem=0}catch(e){}}if(elem){this.empty().append(value)}},null,value,arguments.length)},replaceWith:function replaceWith(){var arg=arguments[0];this.domManip(arguments,function(elem){arg=this.parentNode;jQuery.cleanData(getAll(this));if(arg){arg.replaceChild(elem,this)}});return arg&&(arg.length||arg.nodeType)?this:this.remove()},detach:function detach(selector){return this.remove(selector,true)},domManip:function domManip(args,callback){args=concat.apply([],args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=this.length,set=this,iNoClone=l-1,value=args[0],isFunction=jQuery.isFunction(value);if(isFunction||l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value)){return this.each(function(index){var self=set.eq(index);if(isFunction){args[0]=value.call(this,index,self.html())}self.domManip(args,callback)})}if(l){fragment=jQuery.buildFragment(args,this[0].ownerDocument,false,this);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first}if(first){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"))}}callback.call(this[i],node,i)}if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!data_priv.access(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src){if(jQuery._evalUrl){jQuery._evalUrl(node.src)}}else{jQuery.globalEval(node.textContent.replace(rcleanScript,""))}}}}}}return this}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);push.apply(ret,elems.get())}return this.pushStack(ret)}});var iframe,elemdisplay={};function actualDisplay(name,doc){var style,elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=window.getDefaultComputedStyle&&(style=window.getDefaultComputedStyle(elem[0]))?style.display:jQuery.css(elem[0],"display");elem.detach();return display}function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];if(!display){display=actualDisplay(nodeName,doc);if(display==="none"||!display){iframe=(iframe||jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);doc=iframe[0].contentDocument;doc.write();doc.close();display=actualDisplay(nodeName,doc);iframe.detach()}elemdisplay[nodeName]=display}return display}var rmargin=/^margin/;var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var getStyles=function getStyles(elem){if(elem.ownerDocument.defaultView.opener){return elem.ownerDocument.defaultView.getComputedStyle(elem,null)}return window.getComputedStyle(elem,null)};function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name]}if(computed){if(ret===""&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name)}if(rnumnonpx.test(ret)&&rmargin.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth}}return ret!==undefined?ret+"":ret}function addGetHookIf(conditionFn,hookFn){return{get:function get(){if(conditionFn()){delete this.get;return}return(this.get=hookFn).apply(this,arguments)}}}(function(){var pixelPositionVal,boxSizingReliableVal,docElem=document.documentElement,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return}div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";container.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;"+"position:absolute";container.appendChild(div);function computePixelPositionAndBoxSizingReliable(){div.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;"+"box-sizing:border-box;display:block;margin-top:1%;top:1%;"+"border:1px;padding:1px;width:4px;position:absolute";div.innerHTML="";docElem.appendChild(container);var divStyle=window.getComputedStyle(div,null);pixelPositionVal=divStyle.top!=="1%";boxSizingReliableVal=divStyle.width==="4px";docElem.removeChild(container)}if(window.getComputedStyle){jQuery.extend(support,{pixelPosition:function pixelPosition(){computePixelPositionAndBoxSizingReliable();return pixelPositionVal},boxSizingReliable:function boxSizingReliable(){if(boxSizingReliableVal==null){computePixelPositionAndBoxSizingReliable()}return boxSizingReliableVal},reliableMarginRight:function reliableMarginRight(){var ret,marginDiv=div.appendChild(document.createElement("div"));marginDiv.style.cssText=div.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;"+"box-sizing:content-box;display:block;margin:0;border:0;padding:0";marginDiv.style.marginRight=marginDiv.style.width="0";div.style.width="1px";docElem.appendChild(container);ret=!parseFloat(window.getComputedStyle(marginDiv,null).marginRight);docElem.removeChild(container);div.removeChild(marginDiv);return ret}})}})();jQuery.swap=function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name]}ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name]}return ret};var rdisplayswap=/^(none|table(?!-c[ea]).+)/,rnumsplit=new RegExp("^("+pnum+")(.*)$","i"),rrelNum=new RegExp("^([+-])=("+pnum+")","i"),cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","O","Moz","ms"];function vendorPropName(style,name){if(name in style){return name}var capName=name[0].toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in style){return name}}return origName}function setPositiveNumber(elem,value,subtract){var matches=rnumsplit.exec(value);return matches?Math.max(0,matches[1]-(subtract||0))+(matches[2]||"px"):value}function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){var i=extra===(isBorderBox?"border":"content")?4:name==="width"?1:0,val=0;for(;i<4;i+=2){if(extra==="margin"){val+=jQuery.css(elem,extra+cssExpand[i],true,styles)}if(isBorderBox){if(extra==="content"){val-=jQuery.css(elem,"padding"+cssExpand[i],true,styles)}if(extra!=="margin"){val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles)}}else{val+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(extra!=="padding"){val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles)}}}return val}function getWidthOrHeight(elem,name,extra){var valueIsBorderBox=true,val=name==="width"?elem.offsetWidth:elem.offsetHeight,styles=getStyles(elem),isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";if(val<=0||val==null){val=curCSS(elem,name,styles);if(val<0||val==null){val=elem.style[name]}if(rnumnonpx.test(val)){return val}valueIsBorderBox=isBorderBox&&(support.boxSizingReliable()||val===elem.style[name]);val=parseFloat(val)||0}return val+augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles)+"px"}function showHide(elements,show){var display,elem,hidden,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue}values[index]=data_priv.get(elem,"olddisplay");display=elem.style.display;if(show){if(!values[index]&&display==="none"){elem.style.display=""}if(elem.style.display===""&&isHidden(elem)){values[index]=data_priv.access(elem,"olddisplay",defaultDisplay(elem.nodeName))}}else{hidden=isHidden(elem);if(display!=="none"||!hidden){data_priv.set(elem,"olddisplay",hidden?display:jQuery.css(elem,"display"))}}}for(index=0;index<length;index++){elem=elements[index];if(!elem.style){continue}if(!show||elem.style.display==="none"||elem.style.display===""){elem.style.display=show?values[index]||"":"none"}}return elements}jQuery.extend({cssHooks:{opacity:{get:function get(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret}}}},cssNumber:{columnCount:true,fillOpacity:true,flexGrow:true,flexShrink:true,fontWeight:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":"cssFloat"},style:function style(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return}var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value==="undefined"?"undefined":_typeof(value);if(type==="string"&&(ret=rrelNum.exec(value))){value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name));type="number"}if(value==null||value!==value){return}if(type==="number"&&!jQuery.cssNumber[origName]){value+="px"}if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit"}if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){style[name]=value}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret}return style[name]}},css:function css(elem,name,extra,styles){var val,num,hooks,origName=jQuery.camelCase(name);name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra)}if(val===undefined){val=curCSS(elem,name,styles)}if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name]}if(extra===""||extra){num=parseFloat(val);return extra===true||jQuery.isNumeric(num)?num||0:val}return val}});jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function get(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&elem.offsetWidth===0?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra)}},set:function set(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.css(elem,"boxSizing",false,styles)==="border-box",styles):0)}}});jQuery.cssHooks.marginRight=addGetHookIf(support.reliableMarginRight,function(elem,computed){if(computed){return jQuery.swap(elem,{display:"inline-block"},curCSS,[elem,"marginRight"])}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function expand(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0]}return expanded}};if(!rmargin.test(prefix)){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber}});jQuery.fn.extend({css:function css(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(jQuery.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles)}return map}return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)},show:function show(){return showHide(this,true)},hide:function hide(){return showHide(this)},toggle:function toggle(state){if(typeof state==="boolean"){return state?this.show():this.hide()}return this.each(function(){if(isHidden(this)){jQuery(this).show()}else{jQuery(this).hide()}})}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function init(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||"swing";this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function cur(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function run(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration)}else{this.pos=eased=percent}this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(hooks&&hooks.set){hooks.set(this)}else{Tween.propHooks._default.set(this)}return this}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function get(tween){var result;if(tween.elem[tween.prop]!=null&&(!tween.elem.style||tween.elem.style[tween.prop]==null)){return tween.elem[tween.prop]}result=jQuery.css(tween.elem,tween.prop,"");
  122.  
  123. return!result||result==="auto"?0:result},set:function set(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween)}else if(tween.elem.style&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}else{tween.elem[tween.prop]=tween.now}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function set(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now}}};jQuery.easing={linear:function linear(p){return p},swing:function swing(p){return.5-Math.cos(p*Math.PI)/2}};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var tween=this.createTween(prop,value),target=tween.cur(),parts=rfxnum.exec(value),unit=parts&&parts[3]||(jQuery.cssNumber[prop]?"":"px"),start=(jQuery.cssNumber[prop]||unit!=="px"&&+target)&&rfxnum.exec(jQuery.css(tween.elem,prop)),scale=1,maxIterations=20;if(start&&start[3]!==unit){unit=unit||start[3];parts=parts||[];start=+target||1;do{scale=scale||".5";start=start/scale;jQuery.style(tween.elem,prop,start+unit)}while(scale!==(scale=tween.cur()/target)&&scale!==1&&--maxIterations)}if(parts){start=tween.start=+start||+target||0;tween.unit=unit;tween.end=parts[1]?start+(parts[1]+1)*parts[2]:+parts[2]}return tween}]};function createFxNow(){setTimeout(function(){fxNow=undefined});return fxNow=jQuery.now()}function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type}if(includeWidth){attrs.opacity=attrs.width=type}return attrs}function createTween(value,prop,animation){var tween,collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if(tween=collection[index].call(animation,prop,value)){return tween}}}function defaultPrefilter(elem,props,opts){var prop,value,toggle,tween,hooks,oldfire,display,checkDisplay,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHidden(elem),dataShow=data_priv.get(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire()}}}hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire()}})})}if(elem.nodeType===1&&("height"in props||"width"in props)){opts.overflow=[style.overflow,style.overflowX,style.overflowY];display=jQuery.css(elem,"display");checkDisplay=display==="none"?data_priv.get(elem,"olddisplay")||defaultDisplay(elem.nodeName):display;if(checkDisplay==="inline"&&jQuery.css(elem,"float")==="none"){style.display="inline-block"}}if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2]})}for(prop in props){value=props[prop];if(rfxtypes.exec(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=true}else{continue}}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}else{display=undefined}}if(!jQuery.isEmptyObject(orig)){if(dataShow){if("hidden"in dataShow){hidden=dataShow.hidden}}else{dataShow=data_priv.access(elem,"fxshow",{})}if(toggle){dataShow.hidden=!hidden}if(hidden){jQuery(elem).show()}else{anim.done(function(){jQuery(elem).hide()})}anim.done(function(){var prop;data_priv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop])}});for(prop in orig){tween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=tween.start;if(hidden){tween.end=tween.start;tween.start=prop==="width"||prop==="height"?1:0}}}}else if((display==="none"?defaultDisplay(elem.nodeName):display)==="inline"){style.display=display}}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=jQuery.camelCase(index);easing=specialEasing[name];value=props[index];if(jQuery.isArray(value)){easing=value[1];value=props[index]=value[0]}if(index!==name){props[name]=value;delete props[index]}hooks=jQuery.cssHooks[name];if(hooks&&"expand"in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing}}}else{specialEasing[name]=easing}}}function Animation(elem,properties,options){var result,stopped,index=0,length=animationPrefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),tick=function tick(){if(stopped){return false}var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent)}deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining}else{deferred.resolveWith(elem,[animation]);return false}},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{}},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function createTween(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween},stop:function stop(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this}stopped=true;for(;index<length;index++){animation.tweens[index].run(1)}if(gotoEnd){deferred.resolveWith(elem,[animation,gotoEnd])}else{deferred.rejectWith(elem,[animation,gotoEnd])}return this}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=animationPrefilters[index].call(animation,elem,props,animation.opts);if(result){return result}}jQuery.map(props,createTween,animation);if(jQuery.isFunction(animation.opts.start)){animation.opts.start.call(elem,animation)}jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always)}jQuery.Animation=jQuery.extend(Animation,{tweener:function tweener(props,callback){if(jQuery.isFunction(props)){callback=props;props=["*"]}else{props=props.split(" ")}var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];tweeners[prop]=tweeners[prop]||[];tweeners[prop].unshift(callback)}},prefilter:function prefilter(callback,prepend){if(prepend){animationPrefilters.unshift(callback)}else{animationPrefilters.push(callback)}}});jQuery.speed=function(speed,easing,fn){var opt=speed&&(typeof speed==="undefined"?"undefined":_typeof(speed))==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default;if(opt.queue==null||opt.queue===true){opt.queue="fx"}opt.old=opt.complete;opt.complete=function(){if(jQuery.isFunction(opt.old)){opt.old.call(this)}if(opt.queue){jQuery.dequeue(this,opt.queue)}};return opt};jQuery.fn.extend({fadeTo:function fadeTo(speed,to,easing,callback){return this.filter(isHidden).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function animate(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function doAnimation(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||data_priv.get(this,"finish")){anim.stop(true)}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function stop(type,clearQueue,gotoEnd){var stopQueue=function stopQueue(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd)};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined}if(clearQueue&&type!==false){this.queue(type||"fx",[])}return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=data_priv.get(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index])}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index])}}}for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1)}}if(dequeue||!gotoEnd){jQuery.dequeue(this,type)}})},finish:function finish(type){if(type!==false){type=type||"fx"}return this.each(function(){var index,data=data_priv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true)}for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1)}}for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this)}}delete data.finish})}});jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback)}});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}});jQuery.timers=[];jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;fxNow=jQuery.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1)}}if(!timers.length){jQuery.fx.stop()}fxNow=undefined};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);if(timer()){jQuery.fx.start()}else{jQuery.timers.pop()}};jQuery.fx.interval=13;jQuery.fx.start=function(){if(!timerId){timerId=setInterval(jQuery.fx.tick,jQuery.fx.interval)}};jQuery.fx.stop=function(){clearInterval(timerId);timerId=null};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=setTimeout(next,time);hooks.stop=function(){clearTimeout(timeout)}})};(function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;select.disabled=true;support.optDisabled=!opt.disabled;input=document.createElement("input");input.value="t";input.type="radio";support.radioValue=input.value==="t"})();var nodeHook,boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function attr(name,value){return access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function removeAttr(name){return this.each(function(){jQuery.removeAttr(this,name)})}});jQuery.extend({attr:function attr(elem,name,value){var hooks,ret,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return}if(_typeof(elem.getAttribute)===strundefined){return jQuery.prop(elem,name,value)}if(nType!==1||!jQuery.isXMLDoc(elem)){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:nodeHook)}if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name)}else if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret}else{elem.setAttribute(name,value+"");return value}}else if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret}else{ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret}},removeAttr:function removeAttr(elem,value){var name,propName,i=0,attrNames=value&&value.match(rnotwhite);if(attrNames&&elem.nodeType===1){while(name=attrNames[i++]){propName=jQuery.propFix[name]||name;if(jQuery.expr.match.bool.test(name)){elem[propName]=false}elem.removeAttribute(name)}}},attrHooks:{type:{set:function set(elem,value){if(!support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val}return value}}}}});boolHook={set:function set(elem,value,name){if(value===false){jQuery.removeAttr(elem,name)}else{elem.setAttribute(name,name)}return name}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle;if(!isXML){handle=attrHandle[name];attrHandle[name]=ret;ret=getter(elem,name,isXML)!=null?name.toLowerCase():null;attrHandle[name]=handle}return ret}});var rfocusable=/^(?:input|select|textarea|button)$/i;jQuery.fn.extend({prop:function prop(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function removeProp(name){return this.each(function(){delete this[jQuery.propFix[name]||name]})}});jQuery.extend({propFix:{"for":"htmlFor","class":"className"},prop:function prop(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return}notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name]}if(value!==undefined){return hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:elem[name]=value}else{return hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null?ret:elem[name]}},propHooks:{tabIndex:{get:function get(elem){return elem.hasAttribute("tabindex")||rfocusable.test(elem.nodeName)||elem.href?elem.tabIndex:-1}}}});if(!support.optSelected){jQuery.propHooks.selected={get:function get(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex}return null}}}jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});var rclass=/[\t\r\n\f]/g;jQuery.fn.extend({addClass:function addClass(value){var classes,elem,cur,clazz,j,finalValue,proceed=typeof value==="string"&&value,i=0,len=this.length;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))})}if(proceed){classes=(value||"").match(rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):" ");if(cur){j=0;while(clazz=classes[j++]){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" "}}finalValue=jQuery.trim(cur);if(elem.className!==finalValue){elem.className=finalValue}}}}return this},removeClass:function removeClass(value){var classes,elem,cur,clazz,j,finalValue,proceed=arguments.length===0||typeof value==="string"&&value,i=0,len=this.length;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,this.className))})}if(proceed){classes=(value||"").match(rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):"");if(cur){j=0;while(clazz=classes[j++]){while(cur.indexOf(" "+clazz+" ")>=0){cur=cur.replace(" "+clazz+" "," ")}}finalValue=value?jQuery.trim(cur):"";if(elem.className!==finalValue){elem.className=finalValue}}}}return this},toggleClass:function toggleClass(value,stateVal){var type=typeof value==="undefined"?"undefined":_typeof(value);if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value)}if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)})}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),classNames=value.match(rnotwhite)||[];while(className=classNames[i++]){if(self.hasClass(className)){self.removeClass(className)}else{self.addClass(className)}}}else if(type===strundefined||type==="boolean"){if(this.className){data_priv.set(this,"__className__",this.className)}this.className=this.className||value===false?"":data_priv.get(this,"__className__")||""}})},hasClass:function hasClass(selector){var className=" "+selector+" ",i=0,l=this.length;for(;i<l;i++){if(this[i].nodeType===1&&(" "+this[i].className+" ").replace(rclass," ").indexOf(className)>=0){return true}}return false}});var rreturn=/\r/g;jQuery.fn.extend({val:function val(value){var hooks,ret,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret}ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret}return}isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return}if(isFunction){val=value.call(this,i,jQuery(this).val())}else{val=value}if(val==null){val=""}else if(typeof val==="number"){val+=""}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+""})}hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val}})}});jQuery.extend({valHooks:{option:{get:function get(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:jQuery.trim(jQuery.text(elem))}},select:{get:function get(elem){var value,option,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one"||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;for(;i<max;i++){option=options[i];if((option.selected||i===index)&&(support.optDisabled?!option.disabled:option.getAttribute("disabled")===null)&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value}values.push(value)}}return values},set:function set(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if(option.selected=jQuery.inArray(option.value,values)>=0){optionSet=true}}if(!optionSet){elem.selectedIndex=-1}return values}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function set(elem,value){if(jQuery.isArray(value)){return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value}}});jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}});jQuery.fn.extend({hover:function hover(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)},bind:function bind(types,data,fn){return this.on(types,null,data,fn)},unbind:function unbind(types,fn){return this.off(types,null,fn)},delegate:function delegate(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function undelegate(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn)}});var nonce=jQuery.now();var rquery=/\?/;jQuery.parseJSON=function(data){return JSON.parse(data+"")};jQuery.parseXML=function(data){var xml,tmp;if(!data||typeof data!=="string"){return null}try{tmp=new DOMParser;xml=tmp.parseFromString(data,"text/xml")}catch(e){xml=undefined}if(!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data)}return xml};var rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,prefilters={},transports={},allTypes="*/".concat("*"),ajaxLocation=window.location.href,ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*"}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func)){while(dataType=dataTypes[i++]){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func)}else{(structure[dataType]=structure[dataType]||[]).push(func)}}}}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=structure===transports;function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false}else if(seekingTransport){return!(selected=dataTypeOrTransport)}});return selected}return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key]}}if(deep){jQuery.extend(true,target,deep)}return target}function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type")}}if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}}}if(dataTypes[0]in responses){finalDataType=dataTypes[0]}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}if(!firstDataType){firstDataType=type}}finalDataType=finalDataType||firstDataType}if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType)}return responses[finalDataType]}}function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv]}}current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response}if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType)}prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2]}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1])}break}}}}if(conv!==true){if(conv&&s["throws"]){response=conv(response)}else{try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}}}}}return{state:"success",data:response}}jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function ajaxSetup(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function ajax(url,options){if((typeof url==="undefined"?"undefined":_typeof(url))==="object"){options=url;url=undefined}options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,parts,fireGlobals,i,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),_statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function getResponseHeader(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while(match=rheaders.exec(responseHeadersString)){responseHeaders[match[1].toLowerCase()]=match[2]}}match=responseHeaders[key.toLowerCase()]}return match==null?null:match},getAllResponseHeaders:function getAllResponseHeaders(){return state===2?responseHeadersString:null},setRequestHeader:function setRequestHeader(name,value){var lname=name.toLowerCase();if(!state){name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value}return this},overrideMimeType:function overrideMimeType(type){if(!state){s.mimeType=type}return this},statusCode:function statusCode(map){var code;if(map){if(state<2){for(code in map){_statusCode[code]=[_statusCode[code],map[code]]}}else{jqXHR.always(map[jqXHR.status])}}return this},abort:function abort(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText)}done(0,finalText);return this}};deferred.promise(jqXHR).complete=completeDeferred.add;jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(rnotwhite)||[""];if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!==ajaxLocParts[1]||parts[2]!==ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?"80":"443"))!==(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?"80":"443"))))}if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return jqXHR}fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart")}s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url;if(!s.hasContent){if(s.data){cacheURL=s.url+=(rquery.test(cacheURL)?"&":"?")+s.data;delete s.data}if(s.cache===false){s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+nonce++):cacheURL+(rquery.test(cacheURL)?"&":"?")+"_="+nonce++}}if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL])}if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])}}if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType)}jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i])}if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){return jqXHR.abort()}strAbort="abort";for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i])}transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport")}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s])}if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout)}try{state=1;transport.send(requestHeaders,done)}catch(e){if(state<2){done(-1,e)}else{throw e}}}function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(state===2){return}state=2;if(timeoutTimer){clearTimeout(timeoutTimer)}transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses)}response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified}modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified}}if(status===204||s.type==="HEAD"){statusText="nocontent"}else if(status===304){statusText="notmodified"}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0}}}jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR])}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error])}jqXHR.statusCode(_statusCode);_statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error])}completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!--jQuery.active){jQuery.event.trigger("ajaxStop")}}}return jqXHR},getJSON:function getJSON(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function getScript(url,callback){return jQuery.get(url,undefined,callback,"script")}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined}return jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}});jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:false,global:false,"throws":true})};jQuery.fn.extend({wrapAll:function wrapAll(html){var wrap;if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))})}if(this[0]){wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild}return elem}).append(this)}return this},wrapInner:function wrapInner(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i))})}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},wrap:function wrap(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function unwrap(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes)}}).end()}});jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0;
  124.  
  125. };jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v)}else{buildParams(prefix+"["+((typeof v==="undefined"?"undefined":_typeof(v))==="object"?i:"")+"]",v,traditional,add)}})}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add)}}else{add(prefix,obj)}}jQuery.param=function(a,traditional){var prefix,s=[],add=function add(key,value){value=jQuery.isFunction(value)?value():value==null?"":value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined){traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional}if(jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a)){jQuery.each(a,function(){add(this.name,this.value)})}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add)}}return s.join("&").replace(r20,"+")};jQuery.fn.extend({serialize:function serialize(){return jQuery.param(this.serializeArray())},serializeArray:function serializeArray(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}});jQuery.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var xhrId=0,xhrCallbacks={},xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();if(window.attachEvent){window.attachEvent("onunload",function(){for(var key in xhrCallbacks){xhrCallbacks[key]()}})}support.cors=!!xhrSupported&&"withCredentials"in xhrSupported;support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function send(headers,complete){var i,xhr=options.xhr(),id=++xhrId;xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i]}}if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType)}if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest"}for(i in headers){xhr.setRequestHeader(i,headers[i])}callback=function(type){return function(){if(callback){delete xhrCallbacks[id];callback=xhr.onload=xhr.onerror=null;if(type==="abort"){xhr.abort()}else if(type==="error"){complete(xhr.status,xhr.statusText)}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,typeof xhr.responseText==="string"?{text:xhr.responseText}:undefined,xhr.getAllResponseHeaders())}}}};xhr.onload=callback();xhr.onerror=callback("error");callback=xhrCallbacks[id]=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback){throw e}}},abort:function abort(){if(callback){callback()}}}}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function textScript(text){jQuery.globalEval(text);return text}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false}if(s.crossDomain){s.type="GET"}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function send(_,complete){script=jQuery("<script>").prop({async:true,charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove();callback=null;if(evt){complete(evt.type==="error"?404:200,evt.type)}});document.head.appendChild(script[0])},abort:function abort(){if(callback){callback()}}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function jsonpCallback(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+nonce++;this[callback]=true;return callback}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName)}else if(s.jsonp!==false){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName}s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called")}return responseContainer[0]};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments};jqXHR.always(function(){window[callbackName]=overwritten;if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName)}if(responseContainer&&jQuery.isFunction(overwritten)){overwritten(responseContainer[0])}responseContainer=overwritten=undefined});return"script"}});jQuery.parseHTML=function(data,context,keepScripts){if(!data||typeof data!=="string"){return null}if(typeof context==="boolean"){keepScripts=context;context=false}context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])]}parsed=jQuery.buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove()}return jQuery.merge([],parsed.childNodes)};var _load=jQuery.fn.load;jQuery.fn.load=function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments)}var selector,type,response,self=this,off=url.indexOf(" ");if(off>=0){selector=jQuery.trim(url.slice(off));url=url.slice(0,off)}if(jQuery.isFunction(params)){callback=params;params=undefined}else if(params&&(typeof params==="undefined"?"undefined":_typeof(params))==="object"){type="POST"}if(self.length>0){jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])})}return this};jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}});jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length};var docElem=window.document.documentElement;function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView}jQuery.offset={setOffset:function setOffset(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative"}curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto")>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0}if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset)}if(options.top!=null){props.top=options.top-curOffset.top+curTop}if(options.left!=null){props.left=options.left-curOffset.left+curLeft}if("using"in options){options.using.call(elem,props)}else{curElem.css(props)}}};jQuery.fn.extend({offset:function offset(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)})}var docElem,win,elem=this[0],box={top:0,left:0},doc=elem&&elem.ownerDocument;if(!doc){return}docElem=doc.documentElement;if(!jQuery.contains(docElem,elem)){return box}if(_typeof(elem.getBoundingClientRect)!==strundefined){box=elem.getBoundingClientRect()}win=getWindow(doc);return{top:box.top+win.pageYOffset-docElem.clientTop,left:box.left+win.pageXOffset-docElem.clientLeft}},position:function position(){if(!this[0]){return}var offsetParent,offset,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect()}else{offsetParent=this.offsetParent();offset=this.offset();if(!jQuery.nodeName(offsetParent[0],"html")){parentOffset=offsetParent.offset()}parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",true)}return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)}},offsetParent:function offsetParent(){return this.map(function(){var offsetParent=this.offsetParent||docElem;while(offsetParent&&!jQuery.nodeName(offsetParent,"html")&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent}return offsetParent||docElem})}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win=getWindow(elem);if(val===undefined){return win?win[prop]:elem[method]}if(win){win.scrollTo(!top?val:window.pageXOffset,top?val:window.pageYOffset)}else{elem[method]=val}},method,val,arguments.length,null)}});jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}})});jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return access(this,function(elem,type,value){var doc;if(jQuery.isWindow(elem)){return elem.document.documentElement["client"+name]}if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])}return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable,null)}})});jQuery.fn.size=function(){return this.length};jQuery.fn.andSelf=jQuery.fn.addBack;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery})}var _jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$}if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery}return jQuery};if((typeof noGlobal==="undefined"?"undefined":_typeof(noGlobal))===strundefined){window.jQuery=window.$=jQuery}return jQuery});(function(root,factory){if(typeof define==="function"&&define.amd){define("es6-shim",factory)}else if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"){module.exports=factory()}else{root.returnExports=factory()}})(this,function(){"use strict";var _apply=Function.call.bind(Function.apply);var _call=Function.call.bind(Function.call);var isArray=Array.isArray;var not=function notThunker(func){return function notThunk(){return!_apply(func,this,arguments)}};var throwsError=function throwsError(func){try{func();return false}catch(e){return true}};var valueOrFalseIfThrows=function valueOrFalseIfThrows(func){try{return func()}catch(e){return false}};var isCallableWithoutNew=not(throwsError);var arePropertyDescriptorsSupported=function arePropertyDescriptorsSupported(){return!throwsError(function(){Object.defineProperty({},"x",{get:function get(){}})})};var supportsDescriptors=!!Object.defineProperty&&arePropertyDescriptorsSupported();var functionsHaveNames=function foo(){}.name==="foo";var _forEach=Function.call.bind(Array.prototype.forEach);var _reduce=Function.call.bind(Array.prototype.reduce);var _filter=Function.call.bind(Array.prototype.filter);var _some=Function.call.bind(Array.prototype.some);var defineProperty=function defineProperty(object,name,value,force){if(!force&&name in object){return}if(supportsDescriptors){Object.defineProperty(object,name,{configurable:true,enumerable:false,writable:true,value:value})}else{object[name]=value}};var defineProperties=function defineProperties(object,map){_forEach(Object.keys(map),function(name){var method=map[name];defineProperty(object,name,method,false)})};var create=Object.create||function(prototype,properties){var Prototype=function Prototype(){};Prototype.prototype=prototype;var object=new Prototype;if(typeof properties!=="undefined"){Object.keys(properties).forEach(function(key){Value.defineByDescriptor(object,key,properties[key])})}return object};var supportsSubclassing=function supportsSubclassing(C,f){if(!Object.setPrototypeOf){return false}return valueOrFalseIfThrows(function(){var Sub=function Subclass(arg){var o=new C(arg);Object.setPrototypeOf(o,Subclass.prototype);return o};Object.setPrototypeOf(Sub,C);Sub.prototype=create(C.prototype,{constructor:{value:Sub}});return f(Sub)})};var getGlobal=function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var globals=getGlobal();var globalIsFinite=globals.isFinite;var _indexOf=Function.call.bind(String.prototype.indexOf);var _toString=Function.call.bind(Object.prototype.toString);var _concat=Function.call.bind(Array.prototype.concat);var _strSlice=Function.call.bind(String.prototype.slice);var _push=Function.call.bind(Array.prototype.push);var _pushApply=Function.apply.bind(Array.prototype.push);var _shift=Function.call.bind(Array.prototype.shift);var _max=Math.max;var _min=Math.min;var _floor=Math.floor;var _abs=Math.abs;var _log=Math.log;var _sqrt=Math.sqrt;var _hasOwnProperty=Function.call.bind(Object.prototype.hasOwnProperty);var ArrayIterator;var noop=function noop(){};var Symbol=globals.Symbol||{};var symbolSpecies=Symbol.species||"@@species";var numberIsNaN=Number.isNaN||function isNaN(value){return value!==value};var numberIsFinite=Number.isFinite||function isFinite(value){return typeof value==="number"&&globalIsFinite(value)};var isStandardArguments=function isArguments(value){return _toString(value)==="[object Arguments]"};var isLegacyArguments=function isArguments(value){return value!==null&&(typeof value==="undefined"?"undefined":_typeof(value))==="object"&&typeof value.length==="number"&&value.length>=0&&_toString(value)!=="[object Array]"&&_toString(value.callee)==="[object Function]"};var isArguments=isStandardArguments(arguments)?isStandardArguments:isLegacyArguments;var Type={primitive:function primitive(x){return x===null||typeof x!=="function"&&(typeof x==="undefined"?"undefined":_typeof(x))!=="object"},object:function object(x){return x!==null&&(typeof x==="undefined"?"undefined":_typeof(x))==="object"},string:function string(x){return _toString(x)==="[object String]"},regex:function regex(x){return _toString(x)==="[object RegExp]"},symbol:function symbol(x){return typeof globals.Symbol==="function"&&(typeof x==="undefined"?"undefined":_typeof(x))==="symbol"}};var $iterator$=Type.symbol(Symbol.iterator)?Symbol.iterator:"_es6-shim iterator_";if(globals.Set&&typeof(new globals.Set)["@@iterator"]==="function"){$iterator$="@@iterator"}if(!globals.Reflect){defineProperty(globals,"Reflect",{})}var Reflect=globals.Reflect;var ES={Call:function Call(F,V){var args=arguments.length>2?arguments[2]:[];if(!ES.IsCallable(F)){throw new TypeError(F+" is not a function")}return _apply(F,V,args)},RequireObjectCoercible:function RequireObjectCoercible(x,optMessage){if(x==null){throw new TypeError(optMessage||"Cannot call method on "+x)}},TypeIsObject:function TypeIsObject(x){return x!=null&&Object(x)===x},ToObject:function ToObject(o,optMessage){ES.RequireObjectCoercible(o,optMessage);return Object(o)},IsCallable:function IsCallable(x){return typeof x==="function"&&_toString(x)==="[object Function]"},IsConstructor:function IsConstructor(x){return ES.IsCallable(x)},ToInt32:function ToInt32(x){return ES.ToNumber(x)>>0},ToUint32:function ToUint32(x){return ES.ToNumber(x)>>>0},ToNumber:function ToNumber(value){if(_toString(value)==="[object Symbol]"){throw new TypeError("Cannot convert a Symbol value to a number")}return+value},ToInteger:function ToInteger(value){var number=ES.ToNumber(value);if(numberIsNaN(number)){return 0}if(number===0||!numberIsFinite(number)){return number}return(number>0?1:-1)*_floor(_abs(number))},ToLength:function ToLength(value){var len=ES.ToInteger(value);if(len<=0){return 0}if(len>Number.MAX_SAFE_INTEGER){return Number.MAX_SAFE_INTEGER}return len},SameValue:function SameValue(a,b){if(a===b){if(a===0){return 1/a===1/b}return true}return numberIsNaN(a)&&numberIsNaN(b)},SameValueZero:function SameValueZero(a,b){return a===b||numberIsNaN(a)&&numberIsNaN(b)},IsIterable:function IsIterable(o){return ES.TypeIsObject(o)&&(typeof o[$iterator$]!=="undefined"||isArguments(o))},GetIterator:function GetIterator(o){if(isArguments(o)){return new ArrayIterator(o,"value")}var itFn=ES.GetMethod(o,$iterator$);if(!ES.IsCallable(itFn)){throw new TypeError("value is not an iterable")}var it=_call(itFn,o);if(!ES.TypeIsObject(it)){throw new TypeError("bad iterator")}return it},GetMethod:function GetMethod(o,p){var func=ES.ToObject(o)[p];if(func===void 0||func===null){return void 0}if(!ES.IsCallable(func)){throw new TypeError("Method not callable: "+p)}return func},IteratorComplete:function IteratorComplete(iterResult){return!!iterResult.done},IteratorClose:function IteratorClose(iterator,completionIsThrow){var returnMethod=ES.GetMethod(iterator,"return");if(returnMethod===void 0){return}var innerResult,innerException;try{innerResult=_call(returnMethod,iterator)}catch(e){innerException=e}if(completionIsThrow){return}if(innerException){throw innerException}if(!ES.TypeIsObject(innerResult)){throw new TypeError("Iterator's return method returned a non-object.")}},IteratorNext:function IteratorNext(it){var result=arguments.length>1?it.next(arguments[1]):it.next();if(!ES.TypeIsObject(result)){throw new TypeError("bad iterator")}return result},IteratorStep:function IteratorStep(it){var result=ES.IteratorNext(it);var done=ES.IteratorComplete(result);return done?false:result},Construct:function Construct(C,args,newTarget,isES6internal){var target=typeof newTarget==="undefined"?C:newTarget;if(!isES6internal){return Reflect.construct(C,args,target)}var proto=target.prototype;if(!ES.TypeIsObject(proto)){proto=Object.prototype}var obj=create(proto);var result=ES.Call(C,obj,args);return ES.TypeIsObject(result)?result:obj},SpeciesConstructor:function SpeciesConstructor(O,defaultConstructor){var C=O.constructor;if(C===void 0){return defaultConstructor}if(!ES.TypeIsObject(C)){throw new TypeError("Bad constructor")}var S=C[symbolSpecies];if(S===void 0||S===null){return defaultConstructor}if(!ES.IsConstructor(S)){throw new TypeError("Bad @@species")}return S},CreateHTML:function CreateHTML(string,tag,attribute,value){var S=String(string);var p1="<"+tag;if(attribute!==""){var V=String(value);var escapedV=V.replace(/"/g,"&quot;");p1+=" "+attribute+'="'+escapedV+'"'}var p2=p1+">";var p3=p2+S;return p3+"</"+tag+">"}};var Value={getter:function getter(object,name,_getter){if(!supportsDescriptors){throw new TypeError("getters require true ES5 support")}Object.defineProperty(object,name,{configurable:true,enumerable:false,get:_getter})},proxy:function proxy(originalObject,key,targetObject){if(!supportsDescriptors){throw new TypeError("getters require true ES5 support")}var originalDescriptor=Object.getOwnPropertyDescriptor(originalObject,key);Object.defineProperty(targetObject,key,{configurable:originalDescriptor.configurable,enumerable:originalDescriptor.enumerable,get:function getKey(){return originalObject[key]},set:function setKey(value){originalObject[key]=value}})},redefine:function redefine(object,property,newValue){if(supportsDescriptors){var descriptor=Object.getOwnPropertyDescriptor(object,property);descriptor.value=newValue;Object.defineProperty(object,property,descriptor)}else{object[property]=newValue}},defineByDescriptor:function defineByDescriptor(object,property,descriptor){if(supportsDescriptors){Object.defineProperty(object,property,descriptor)}else if("value"in descriptor){object[property]=descriptor.value}},preserveToString:function preserveToString(target,source){if(source&&ES.IsCallable(source.toString)){defineProperty(target,"toString",source.toString.bind(source),true)}}};var wrapConstructor=function wrapConstructor(original,replacement,keysToSkip){Value.preserveToString(replacement,original);if(Object.setPrototypeOf){Object.setPrototypeOf(original,replacement)}if(supportsDescriptors){_forEach(Object.getOwnPropertyNames(original),function(key){if(key in noop||keysToSkip[key]){return}Value.proxy(original,key,replacement)})}else{_forEach(Object.keys(original),function(key){if(key in noop||keysToSkip[key]){return}replacement[key]=original[key]})}replacement.prototype=original.prototype;Value.redefine(original.prototype,"constructor",replacement)};var defaultSpeciesGetter=function defaultSpeciesGetter(){return this};var addDefaultSpecies=function addDefaultSpecies(C){if(supportsDescriptors&&!_hasOwnProperty(C,symbolSpecies)){Value.getter(C,symbolSpecies,defaultSpeciesGetter)}};var overrideNative=function overrideNative(object,property,replacement){var original=object[property];defineProperty(object,property,replacement,true);Value.preserveToString(object[property],original)};var addIterator=function addIterator(prototype,impl){var implementation=impl||function iterator(){return this};defineProperty(prototype,$iterator$,implementation);if(!prototype[$iterator$]&&Type.symbol($iterator$)){prototype[$iterator$]=implementation}};var createDataProperty=function createDataProperty(object,name,value){if(supportsDescriptors){Object.defineProperty(object,name,{configurable:true,enumerable:true,writable:true,value:value})}else{object[name]=value}};var createDataPropertyOrThrow=function createDataPropertyOrThrow(object,name,value){createDataProperty(object,name,value);if(!ES.SameValue(object[name],value)){throw new TypeError("property is nonconfigurable")}};var emulateES6construct=function emulateES6construct(o,defaultNewTarget,defaultProto,slots){if(!ES.TypeIsObject(o)){throw new TypeError("Constructor requires `new`: "+defaultNewTarget.name)}var proto=defaultNewTarget.prototype;if(!ES.TypeIsObject(proto)){proto=defaultProto}var obj=create(proto);for(var name in slots){if(_hasOwnProperty(slots,name)){var value=slots[name];defineProperty(obj,name,value,true)}}return obj};if(String.fromCodePoint&&String.fromCodePoint.length!==1){var originalFromCodePoint=String.fromCodePoint;overrideNative(String,"fromCodePoint",function fromCodePoint(codePoints){return _apply(originalFromCodePoint,this,arguments)})}var StringShims={fromCodePoint:function fromCodePoint(codePoints){var result=[];var next;for(var i=0,length=arguments.length;i<length;i++){next=Number(arguments[i]);if(!ES.SameValue(next,ES.ToInteger(next))||next<0||next>1114111){throw new RangeError("Invalid code point "+next)}if(next<65536){_push(result,String.fromCharCode(next))}else{next-=65536;_push(result,String.fromCharCode((next>>10)+55296));_push(result,String.fromCharCode(next%1024+56320))}}return result.join("")},raw:function raw(callSite){var cooked=ES.ToObject(callSite,"bad callSite");var rawString=ES.ToObject(cooked.raw,"bad raw value");var len=rawString.length;var literalsegments=ES.ToLength(len);if(literalsegments<=0){return""}var stringElements=[];var nextIndex=0;var nextKey,next,nextSeg,nextSub;while(nextIndex<literalsegments){nextKey=String(nextIndex);nextSeg=String(rawString[nextKey]);_push(stringElements,nextSeg);if(nextIndex+1>=literalsegments){break}next=nextIndex+1<arguments.length?arguments[nextIndex+1]:"";nextSub=String(next);_push(stringElements,nextSub);nextIndex+=1}return stringElements.join("")}};if(String.raw&&String.raw({raw:{0:"x",1:"y",length:2}})!=="xy"){overrideNative(String,"raw",StringShims.raw)}defineProperties(String,StringShims);var stringRepeat=function repeat(s,times){if(times<1){return""}if(times%2){return repeat(s,times-1)+s}var half=repeat(s,times/2);return half+half};var stringMaxLength=Infinity;var StringPrototypeShims={repeat:function repeat(times){ES.RequireObjectCoercible(this);var thisStr=String(this);var numTimes=ES.ToInteger(times);if(numTimes<0||numTimes>=stringMaxLength){throw new RangeError("repeat count must be less than infinity and not overflow maximum string size")}return stringRepeat(thisStr,numTimes)},startsWith:function startsWith(searchString){ES.RequireObjectCoercible(this);var thisStr=String(this);if(Type.regex(searchString)){throw new TypeError('Cannot call method "startsWith" with a regex')}var searchStr=String(searchString);var startArg=arguments.length>1?arguments[1]:void 0;var start=_max(ES.ToInteger(startArg),0);return _strSlice(thisStr,start,start+searchStr.length)===searchStr},endsWith:function endsWith(searchString){ES.RequireObjectCoercible(this);var thisStr=String(this);if(Type.regex(searchString)){throw new TypeError('Cannot call method "endsWith" with a regex')}var searchStr=String(searchString);var thisLen=thisStr.length;var posArg=arguments.length>1?arguments[1]:void 0;var pos=typeof posArg==="undefined"?thisLen:ES.ToInteger(posArg);var end=_min(_max(pos,0),thisLen);return _strSlice(thisStr,end-searchStr.length,end)===searchStr},includes:function includes(searchString){if(Type.regex(searchString)){throw new TypeError('"includes" does not accept a RegExp')}var position;if(arguments.length>1){position=arguments[1]}return _indexOf(this,searchString,position)!==-1},codePointAt:function codePointAt(pos){ES.RequireObjectCoercible(this);var thisStr=String(this);var position=ES.ToInteger(pos);var length=thisStr.length;if(position>=0&&position<length){var first=thisStr.charCodeAt(position);var isEnd=position+1===length;if(first<55296||first>56319||isEnd){return first}var second=thisStr.charCodeAt(position+1);if(second<56320||second>57343){return first}return(first-55296)*1024+(second-56320)+65536}}};if(String.prototype.includes&&"a".includes("a",Infinity)!==false){overrideNative(String.prototype,"includes",StringPrototypeShims.includes)}if(String.prototype.startsWith&&String.prototype.endsWith){var startsWithRejectsRegex=throwsError(function(){"/a/".startsWith(/a/)});var startsWithHandlesInfinity="abc".startsWith("a",Infinity)===false;if(!startsWithRejectsRegex||!startsWithHandlesInfinity){overrideNative(String.prototype,"startsWith",StringPrototypeShims.startsWith);overrideNative(String.prototype,"endsWith",StringPrototypeShims.endsWith)}}defineProperties(String.prototype,StringPrototypeShims);var ws=["   \n \f\r   ᠎    ","          \u2028","\u2029"].join("");var trimRegexp=new RegExp("(^["+ws+"]+)|(["+ws+"]+$)","g");var trimShim=function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(trimRegexp,"")};var nonWS=["…","​","￾"].join("");var nonWSregex=new RegExp("["+nonWS+"]","g");var isBadHexRegex=/^[\-+]0x[0-9a-f]+$/i;var hasStringTrimBug=nonWS.trim().length!==nonWS.length;defineProperty(String.prototype,"trim",trimShim,hasStringTrimBug);var StringIterator=function StringIterator(s){ES.RequireObjectCoercible(s);this._s=String(s);this._i=0};StringIterator.prototype.next=function(){var s=this._s,i=this._i;if(typeof s==="undefined"||i>=s.length){this._s=void 0;return{value:void 0,done:true}}var first=s.charCodeAt(i),second,len;if(first<55296||first>56319||i+1===s.length){len=1}else{second=s.charCodeAt(i+1);len=second<56320||second>57343?1:2}this._i=i+len;return{value:s.substr(i,len),done:false}};addIterator(StringIterator.prototype);addIterator(String.prototype,function(){return new StringIterator(this)});var ArrayShims={from:function from(items){var C=this;var mapFn=arguments.length>1?arguments[1]:void 0;var mapping,T;if(mapFn===void 0){mapping=false}else{if(!ES.IsCallable(mapFn)){throw new TypeError("Array.from: when provided, the second argument must be a function")}T=arguments.length>2?arguments[2]:void 0;mapping=true}var usingIterator=typeof(isArguments(items)||ES.GetMethod(items,$iterator$))!=="undefined";var length,result,i;if(usingIterator){result=ES.IsConstructor(C)?Object(new C):[];var iterator=ES.GetIterator(items);var next,nextValue;i=0;while(true){next=ES.IteratorStep(iterator);if(next===false){break}nextValue=next.value;try{if(mapping){nextValue=T===undefined?mapFn(nextValue,i):_call(mapFn,T,nextValue,i)}result[i]=nextValue}catch(e){ES.IteratorClose(iterator,true);throw e}i+=1}length=i}else{var arrayLike=ES.ToObject(items);length=ES.ToLength(arrayLike.length);result=ES.IsConstructor(C)?Object(new C(length)):new Array(length);var value;for(i=0;i<length;++i){value=arrayLike[i];if(mapping){value=T!==undefined?_call(mapFn,T,value,i):mapFn(value,i)}result[i]=value}}result.length=length;return result},of:function of(){var len=arguments.length;var C=this;var A=isArray(C)||!ES.IsCallable(C)?new Array(len):ES.Construct(C,[len]);for(var k=0;k<len;++k){createDataPropertyOrThrow(A,k,arguments[k])}A.length=len;return A}};defineProperties(Array,ArrayShims);addDefaultSpecies(Array);var iteratorResult=function iteratorResult(x){return{value:x,done:arguments.length===0}};ArrayIterator=function(array,kind){this.i=0;this.array=array;this.kind=kind};defineProperties(ArrayIterator.prototype,{next:function next(){var i=this.i,array=this.array;if(!(this instanceof ArrayIterator)){throw new TypeError("Not an ArrayIterator")}if(typeof array!=="undefined"){var len=ES.ToLength(array.length);for(;i<len;i++){var kind=this.kind;var retval;if(kind==="key"){retval=i}else if(kind==="value"){retval=array[i]}else if(kind==="entry"){retval=[i,array[i]]}this.i=i+1;return{value:retval,done:false}}}this.array=void 0;return{value:void 0,done:true}}});addIterator(ArrayIterator.prototype);var getAllKeys=function getAllKeys(object){var keys=[];for(var key in object){_push(keys,key)}return keys};var ObjectIterator=function ObjectIterator(object,kind){defineProperties(this,{object:object,array:getAllKeys(object),kind:kind})};defineProperties(ObjectIterator.prototype,{next:function next(){var key;var array=this.array;if(!(this instanceof ObjectIterator)){throw new TypeError("Not an ObjectIterator")}while(array.length>0){key=_shift(array);if(!(key in this.object)){continue}if(this.kind==="key"){return iteratorResult(key)}else if(this.kind==="value"){return iteratorResult(this.object[key])}else{return iteratorResult([key,this.object[key]])}}return iteratorResult()}});addIterator(ObjectIterator.prototype);var arrayOfSupportsSubclassing=Array.of===ArrayShims.of||function(){var Foo=function Foo(len){this.length=len};Foo.prototype=[];var fooArr=Array.of.apply(Foo,[1,2]);return fooArr instanceof Foo&&fooArr.length===2}();if(!arrayOfSupportsSubclassing){overrideNative(Array,"of",ArrayShims.of)}var ArrayPrototypeShims={copyWithin:function copyWithin(target,start){var end=arguments[2];var o=ES.ToObject(this);var len=ES.ToLength(o.length);var relativeTarget=ES.ToInteger(target);
  126.  
  127. var relativeStart=ES.ToInteger(start);var to=relativeTarget<0?_max(len+relativeTarget,0):_min(relativeTarget,len);var from=relativeStart<0?_max(len+relativeStart,0):_min(relativeStart,len);end=typeof end==="undefined"?len:ES.ToInteger(end);var fin=end<0?_max(len+end,0):_min(end,len);var count=_min(fin-from,len-to);var direction=1;if(from<to&&to<from+count){direction=-1;from+=count-1;to+=count-1}while(count>0){if(_hasOwnProperty(o,from)){o[to]=o[from]}else{delete o[from]}from+=direction;to+=direction;count-=1}return o},fill:function fill(value){var start=arguments.length>1?arguments[1]:void 0;var end=arguments.length>2?arguments[2]:void 0;var O=ES.ToObject(this);var len=ES.ToLength(O.length);start=ES.ToInteger(typeof start==="undefined"?0:start);end=ES.ToInteger(typeof end==="undefined"?len:end);var relativeStart=start<0?_max(len+start,0):_min(start,len);var relativeEnd=end<0?len+end:end;for(var i=relativeStart;i<len&&i<relativeEnd;++i){O[i]=value}return O},find:function find(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#find: predicate must be a function")}var thisArg=arguments.length>1?arguments[1]:null;for(var i=0,value;i<length;i++){value=list[i];if(thisArg){if(_call(predicate,thisArg,value,i,list)){return value}}else if(predicate(value,i,list)){return value}}},findIndex:function findIndex(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#findIndex: predicate must be a function")}var thisArg=arguments.length>1?arguments[1]:null;for(var i=0;i<length;i++){if(thisArg){if(_call(predicate,thisArg,list[i],i,list)){return i}}else if(predicate(list[i],i,list)){return i}}return-1},keys:function keys(){return new ArrayIterator(this,"key")},values:function values(){return new ArrayIterator(this,"value")},entries:function entries(){return new ArrayIterator(this,"entry")}};if(Array.prototype.keys&&!ES.IsCallable([1].keys().next)){delete Array.prototype.keys}if(Array.prototype.entries&&!ES.IsCallable([1].entries().next)){delete Array.prototype.entries}if(Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[$iterator$]){defineProperties(Array.prototype,{values:Array.prototype[$iterator$]});if(Type.symbol(Symbol.unscopables)){Array.prototype[Symbol.unscopables].values=true}}if(functionsHaveNames&&Array.prototype.values&&Array.prototype.values.name!=="values"){var originalArrayPrototypeValues=Array.prototype.values;overrideNative(Array.prototype,"values",function values(){return _call(originalArrayPrototypeValues,this)});defineProperty(Array.prototype,$iterator$,Array.prototype.values,true)}defineProperties(Array.prototype,ArrayPrototypeShims);addIterator(Array.prototype,function(){return this.values()});if(Object.getPrototypeOf){addIterator(Object.getPrototypeOf([].values()))}var arrayFromSwallowsNegativeLengths=function(){return valueOrFalseIfThrows(function(){return Array.from({length:-1}).length===0})}();var arrayFromHandlesIterables=function(){var arr=Array.from([0].entries());return arr.length===1&&isArray(arr[0])&&arr[0][0]===0&&arr[0][1]===0}();if(!arrayFromSwallowsNegativeLengths||!arrayFromHandlesIterables){overrideNative(Array,"from",ArrayShims.from)}var arrayFromHandlesUndefinedMapFunction=function(){return valueOrFalseIfThrows(function(){return Array.from([0],undefined)})}();if(!arrayFromHandlesUndefinedMapFunction){var origArrayFrom=Array.from;overrideNative(Array,"from",function from(items){if(arguments.length>0&&typeof arguments[1]!=="undefined"){return _apply(origArrayFrom,this,arguments)}else{return _call(origArrayFrom,this,items)}})}var toLengthsCorrectly=function toLengthsCorrectly(method,reversed){var obj={length:-1};obj[reversed?(-1>>>0)-1:0]=true;return valueOrFalseIfThrows(function(){_call(method,obj,function(){throw new RangeError("should not reach here")},[])})};if(!toLengthsCorrectly(Array.prototype.forEach)){var originalForEach=Array.prototype.forEach;overrideNative(Array.prototype,"forEach",function forEach(callbackFn){return _apply(originalForEach,this.length>=0?this:[],arguments)},true)}if(!toLengthsCorrectly(Array.prototype.map)){var originalMap=Array.prototype.map;overrideNative(Array.prototype,"map",function map(callbackFn){return _apply(originalMap,this.length>=0?this:[],arguments)},true)}if(!toLengthsCorrectly(Array.prototype.filter)){var originalFilter=Array.prototype.filter;overrideNative(Array.prototype,"filter",function filter(callbackFn){return _apply(originalFilter,this.length>=0?this:[],arguments)},true)}if(!toLengthsCorrectly(Array.prototype.some)){var originalSome=Array.prototype.some;overrideNative(Array.prototype,"some",function some(callbackFn){return _apply(originalSome,this.length>=0?this:[],arguments)},true)}if(!toLengthsCorrectly(Array.prototype.every)){var originalEvery=Array.prototype.every;overrideNative(Array.prototype,"every",function every(callbackFn){return _apply(originalEvery,this.length>=0?this:[],arguments)},true)}if(!toLengthsCorrectly(Array.prototype.reduce)){var originalReduce=Array.prototype.reduce;overrideNative(Array.prototype,"reduce",function reduce(callbackFn){return _apply(originalReduce,this.length>=0?this:[],arguments)},true)}if(!toLengthsCorrectly(Array.prototype.reduceRight,true)){var originalReduceRight=Array.prototype.reduceRight;overrideNative(Array.prototype,"reduceRight",function reduceRight(callbackFn){return _apply(originalReduceRight,this.length>=0?this:[],arguments)},true)}var lacksOctalSupport=Number("0o10")!==8;var lacksBinarySupport=Number("0b10")!==2;var trimsNonWhitespace=_some(nonWS,function(c){return Number(c+0+c)===0});if(lacksOctalSupport||lacksBinarySupport||trimsNonWhitespace){var OrigNumber=Number;var binaryRegex=/^0b[01]+$/i;var octalRegex=/^0o[0-7]+$/i;var isBinary=binaryRegex.test.bind(binaryRegex);var isOctal=octalRegex.test.bind(octalRegex);var toPrimitive=function toPrimitive(O){var result;if(typeof O.valueOf==="function"){result=O.valueOf();if(Type.primitive(result)){return result}}if(typeof O.toString==="function"){result=O.toString();if(Type.primitive(result)){return result}}throw new TypeError("No default value")};var hasNonWS=nonWSregex.test.bind(nonWSregex);var isBadHex=isBadHexRegex.test.bind(isBadHexRegex);var NumberShim=function(){var NumberShim=function Number(value){var primValue;if(arguments.length>0){primValue=Type.primitive(value)?value:toPrimitive(value,"number")}else{primValue=0}if(typeof primValue==="string"){primValue=_call(trimShim,primValue);if(isBinary(primValue)){primValue=parseInt(_strSlice(primValue,2),2)}else if(isOctal(primValue)){primValue=parseInt(_strSlice(primValue,2),8)}else if(hasNonWS(primValue)||isBadHex(primValue)){primValue=NaN}}var receiver=this;var valueOfSucceeds=valueOrFalseIfThrows(function(){OrigNumber.prototype.valueOf.call(receiver);return true});if(receiver instanceof NumberShim&&!valueOfSucceeds){return new OrigNumber(primValue)}return OrigNumber(primValue)};return NumberShim}();wrapConstructor(OrigNumber,NumberShim,{});Number=NumberShim;Value.redefine(globals,"Number",NumberShim)}var maxSafeInteger=Math.pow(2,53)-1;defineProperties(Number,{MAX_SAFE_INTEGER:maxSafeInteger,MIN_SAFE_INTEGER:-maxSafeInteger,EPSILON:2.220446049250313e-16,parseInt:globals.parseInt,parseFloat:globals.parseFloat,isFinite:numberIsFinite,isInteger:function isInteger(value){return numberIsFinite(value)&&ES.ToInteger(value)===value},isSafeInteger:function isSafeInteger(value){return Number.isInteger(value)&&_abs(value)<=Number.MAX_SAFE_INTEGER},isNaN:numberIsNaN});defineProperty(Number,"parseInt",globals.parseInt,Number.parseInt!==globals.parseInt);if(![,1].find(function(item,idx){return idx===0})){overrideNative(Array.prototype,"find",ArrayPrototypeShims.find)}if([,1].findIndex(function(item,idx){return idx===0})!==0){overrideNative(Array.prototype,"findIndex",ArrayPrototypeShims.findIndex)}var isEnumerableOn=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable);var sliceArgs=function sliceArgs(){var initial=Number(this);var len=arguments.length;var desiredArgCount=len-initial;var args=new Array(desiredArgCount<0?0:desiredArgCount);for(var i=initial;i<len;++i){args[i-initial]=arguments[i]}return args};var assignTo=function assignTo(source){return function assignToSource(target,key){target[key]=source[key];return target}};var assignReducer=function assignReducer(target,source){var keys=Object.keys(Object(source));var symbols;if(ES.IsCallable(Object.getOwnPropertySymbols)){symbols=_filter(Object.getOwnPropertySymbols(Object(source)),isEnumerableOn(source))}return _reduce(_concat(keys,symbols||[]),assignTo(source),target)};var ObjectShims={assign:function assign(target,source){var to=ES.ToObject(target,"Cannot convert undefined or null to object");return _reduce(_apply(sliceArgs,1,arguments),assignReducer,to)},is:function is(a,b){return ES.SameValue(a,b)}};var assignHasPendingExceptions=Object.assign&&Object.preventExtensions&&function(){var thrower=Object.preventExtensions({1:2});try{Object.assign(thrower,"xy")}catch(e){return thrower[1]==="y"}}();if(assignHasPendingExceptions){overrideNative(Object,"assign",ObjectShims.assign)}defineProperties(Object,ObjectShims);if(supportsDescriptors){var ES5ObjectShims={setPrototypeOf:function(Object,magic){var set;var checkArgs=function checkArgs(O,proto){if(!ES.TypeIsObject(O)){throw new TypeError("cannot set prototype on a non-object")}if(!(proto===null||ES.TypeIsObject(proto))){throw new TypeError("can only set prototype to an object or null"+proto)}};var setPrototypeOf=function setPrototypeOf(O,proto){checkArgs(O,proto);_call(set,O,proto);return O};try{set=Object.getOwnPropertyDescriptor(Object.prototype,magic).set;_call(set,{},null)}catch(e){if(Object.prototype!=={}[magic]){return}set=function(proto){this[magic]=proto};setPrototypeOf.polyfill=setPrototypeOf(setPrototypeOf({},null),Object.prototype)instanceof Object}return setPrototypeOf}(Object,"__proto__")};defineProperties(Object,ES5ObjectShims)}if(Object.setPrototypeOf&&Object.getPrototypeOf&&Object.getPrototypeOf(Object.setPrototypeOf({},null))!==null&&Object.getPrototypeOf(Object.create(null))===null){(function(){var FAKENULL=Object.create(null);var gpo=Object.getPrototypeOf,spo=Object.setPrototypeOf;Object.getPrototypeOf=function(o){var result=gpo(o);return result===FAKENULL?null:result};Object.setPrototypeOf=function(o,p){var proto=p===null?FAKENULL:p;return spo(o,proto)};Object.setPrototypeOf.polyfill=false})()}var objectKeysAcceptsPrimitives=!throwsError(function(){Object.keys("foo")});if(!objectKeysAcceptsPrimitives){var originalObjectKeys=Object.keys;overrideNative(Object,"keys",function keys(value){return originalObjectKeys(ES.ToObject(value))})}if(Object.getOwnPropertyNames){var objectGOPNAcceptsPrimitives=!throwsError(function(){Object.getOwnPropertyNames("foo")});if(!objectGOPNAcceptsPrimitives){var cachedWindowNames=(typeof window==="undefined"?"undefined":_typeof(window))==="object"?Object.getOwnPropertyNames(window):[];var originalObjectGetOwnPropertyNames=Object.getOwnPropertyNames;overrideNative(Object,"getOwnPropertyNames",function getOwnPropertyNames(value){var val=ES.ToObject(value);if(_toString(val)==="[object Window]"){try{return originalObjectGetOwnPropertyNames(val)}catch(e){return _concat([],cachedWindowNames)}}return originalObjectGetOwnPropertyNames(val)})}}if(Object.getOwnPropertyDescriptor){var objectGOPDAcceptsPrimitives=!throwsError(function(){Object.getOwnPropertyDescriptor("foo","bar")});if(!objectGOPDAcceptsPrimitives){var originalObjectGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;overrideNative(Object,"getOwnPropertyDescriptor",function getOwnPropertyDescriptor(value,property){return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value),property)})}}if(Object.seal){var objectSealAcceptsPrimitives=!throwsError(function(){Object.seal("foo")});if(!objectSealAcceptsPrimitives){var originalObjectSeal=Object.seal;overrideNative(Object,"seal",function seal(value){if(!Type.object(value)){return value}return originalObjectSeal(value)})}}if(Object.isSealed){var objectIsSealedAcceptsPrimitives=!throwsError(function(){Object.isSealed("foo")});if(!objectIsSealedAcceptsPrimitives){var originalObjectIsSealed=Object.isSealed;overrideNative(Object,"isSealed",function isSealed(value){if(!Type.object(value)){return true}return originalObjectIsSealed(value)})}}if(Object.freeze){var objectFreezeAcceptsPrimitives=!throwsError(function(){Object.freeze("foo")});if(!objectFreezeAcceptsPrimitives){var originalObjectFreeze=Object.freeze;overrideNative(Object,"freeze",function freeze(value){if(!Type.object(value)){return value}return originalObjectFreeze(value)})}}if(Object.isFrozen){var objectIsFrozenAcceptsPrimitives=!throwsError(function(){Object.isFrozen("foo")});if(!objectIsFrozenAcceptsPrimitives){var originalObjectIsFrozen=Object.isFrozen;overrideNative(Object,"isFrozen",function isFrozen(value){if(!Type.object(value)){return true}return originalObjectIsFrozen(value)})}}if(Object.preventExtensions){var objectPreventExtensionsAcceptsPrimitives=!throwsError(function(){Object.preventExtensions("foo")});if(!objectPreventExtensionsAcceptsPrimitives){var originalObjectPreventExtensions=Object.preventExtensions;overrideNative(Object,"preventExtensions",function preventExtensions(value){if(!Type.object(value)){return value}return originalObjectPreventExtensions(value)})}}if(Object.isExtensible){var objectIsExtensibleAcceptsPrimitives=!throwsError(function(){Object.isExtensible("foo")});if(!objectIsExtensibleAcceptsPrimitives){var originalObjectIsExtensible=Object.isExtensible;overrideNative(Object,"isExtensible",function isExtensible(value){if(!Type.object(value)){return false}return originalObjectIsExtensible(value)})}}if(Object.getPrototypeOf){var objectGetProtoAcceptsPrimitives=!throwsError(function(){Object.getPrototypeOf("foo")});if(!objectGetProtoAcceptsPrimitives){var originalGetProto=Object.getPrototypeOf;overrideNative(Object,"getPrototypeOf",function getPrototypeOf(value){return originalGetProto(ES.ToObject(value))})}}var hasFlags=supportsDescriptors&&function(){var desc=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags");return desc&&ES.IsCallable(desc.get)}();if(supportsDescriptors&&!hasFlags){var regExpFlagsGetter=function flags(){if(!ES.TypeIsObject(this)){throw new TypeError("Method called on incompatible type: must be an object.")}var result="";if(this.global){result+="g"}if(this.ignoreCase){result+="i"}if(this.multiline){result+="m"}if(this.unicode){result+="u"}if(this.sticky){result+="y"}return result};Value.getter(RegExp.prototype,"flags",regExpFlagsGetter)}var regExpSupportsFlagsWithRegex=valueOrFalseIfThrows(function(){return String(new RegExp(/a/g,"i"))==="/a/i"});if(!regExpSupportsFlagsWithRegex&&supportsDescriptors){var OrigRegExp=RegExp;var RegExpShim=function(){return function RegExp(pattern,flags){var calledWithNew=this instanceof RegExp;if(!calledWithNew&&(Type.regex(pattern)||pattern&&pattern.constructor===RegExp)){return pattern}if(Type.regex(pattern)&&Type.string(flags)){return new RegExp(pattern.source,flags)}return new OrigRegExp(pattern,flags)}}();wrapConstructor(OrigRegExp,RegExpShim,{$input:true});RegExp=RegExpShim;Value.redefine(globals,"RegExp",RegExpShim)}if(supportsDescriptors){var regexGlobals={input:"$_",lastMatch:"$&",lastParen:"$+",leftContext:"$`",rightContext:"$'"};_forEach(Object.keys(regexGlobals),function(prop){if(prop in RegExp&&!(regexGlobals[prop]in RegExp)){Value.getter(RegExp,regexGlobals[prop],function get(){return RegExp[prop]})}})}addDefaultSpecies(RegExp);var inverseEpsilon=1/Number.EPSILON;var roundTiesToEven=function roundTiesToEven(n){return n+inverseEpsilon-inverseEpsilon};var BINARY_32_EPSILON=Math.pow(2,-23);var BINARY_32_MAX_VALUE=Math.pow(2,127)*(2-BINARY_32_EPSILON);var BINARY_32_MIN_VALUE=Math.pow(2,-126);var numberCLZ=Number.prototype.clz;delete Number.prototype.clz;var MathShims={acosh:function acosh(value){var x=Number(value);if(Number.isNaN(x)||value<1){return NaN}if(x===1){return 0}if(x===Infinity){return x}return _log(x/Math.E+_sqrt(x+1)*_sqrt(x-1)/Math.E)+1},asinh:function asinh(value){var x=Number(value);if(x===0||!globalIsFinite(x)){return x}return x<0?-Math.asinh(-x):_log(x+_sqrt(x*x+1))},atanh:function atanh(value){var x=Number(value);if(Number.isNaN(x)||x<-1||x>1){return NaN}if(x===-1){return-Infinity}if(x===1){return Infinity}if(x===0){return x}return.5*_log((1+x)/(1-x))},cbrt:function cbrt(value){var x=Number(value);if(x===0){return x}var negate=x<0,result;if(negate){x=-x}if(x===Infinity){result=Infinity}else{result=Math.exp(_log(x)/3);result=(x/(result*result)+2*result)/3}return negate?-result:result},clz32:function clz32(value){var x=Number(value);var number=ES.ToUint32(x);if(number===0){return 32}return numberCLZ?_call(numberCLZ,number):31-_floor(_log(number+.5)*Math.LOG2E)},cosh:function cosh(value){var x=Number(value);if(x===0){return 1}if(Number.isNaN(x)){return NaN}if(!globalIsFinite(x)){return Infinity}if(x<0){x=-x}if(x>21){return Math.exp(x)/2}return(Math.exp(x)+Math.exp(-x))/2},expm1:function expm1(value){var x=Number(value);if(x===-Infinity){return-1}if(!globalIsFinite(x)||x===0){return x}if(_abs(x)>.5){return Math.exp(x)-1}var t=x;var sum=0;var n=1;while(sum+t!==sum){sum+=t;n+=1;t*=x/n}return sum},hypot:function hypot(x,y){var result=0;var largest=0;for(var i=0;i<arguments.length;++i){var value=_abs(Number(arguments[i]));if(largest<value){result*=largest/value*(largest/value);result+=1;largest=value}else{result+=value>0?value/largest*(value/largest):value}}return largest===Infinity?Infinity:largest*_sqrt(result)},log2:function log2(value){return _log(value)*Math.LOG2E},log10:function log10(value){return _log(value)*Math.LOG10E},log1p:function log1p(value){var x=Number(value);if(x<-1||Number.isNaN(x)){return NaN}if(x===0||x===Infinity){return x}if(x===-1){return-Infinity}return 1+x-1===0?x:x*(_log(1+x)/(1+x-1))},sign:function sign(value){var number=Number(value);if(number===0){return number}if(Number.isNaN(number)){return number}return number<0?-1:1},sinh:function sinh(value){var x=Number(value);if(!globalIsFinite(x)||x===0){return x}if(_abs(x)<1){return(Math.expm1(x)-Math.expm1(-x))/2}return(Math.exp(x-1)-Math.exp(-x-1))*Math.E/2},tanh:function tanh(value){var x=Number(value);if(Number.isNaN(x)||x===0){return x}if(x===Infinity){return 1}if(x===-Infinity){return-1}var a=Math.expm1(x);var b=Math.expm1(-x);if(a===Infinity){return 1}if(b===Infinity){return-1}return(a-b)/(Math.exp(x)+Math.exp(-x))},trunc:function trunc(value){var x=Number(value);return x<0?-_floor(-x):_floor(x)},imul:function imul(x,y){var a=ES.ToUint32(x);var b=ES.ToUint32(y);var ah=a>>>16&65535;var al=a&65535;var bh=b>>>16&65535;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16>>>0)|0},fround:function fround(x){var v=Number(x);if(v===0||v===Infinity||v===-Infinity||numberIsNaN(v)){return v}var sign=Math.sign(v);var abs=_abs(v);if(abs<BINARY_32_MIN_VALUE){return sign*roundTiesToEven(abs/BINARY_32_MIN_VALUE/BINARY_32_EPSILON)*BINARY_32_MIN_VALUE*BINARY_32_EPSILON}var a=(1+BINARY_32_EPSILON/Number.EPSILON)*abs;var result=a-(a-abs);if(result>BINARY_32_MAX_VALUE||numberIsNaN(result)){return sign*Infinity}return sign*result}};defineProperties(Math,MathShims);defineProperty(Math,"log1p",MathShims.log1p,Math.log1p(-1e-17)!==-1e-17);defineProperty(Math,"asinh",MathShims.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7));defineProperty(Math,"tanh",MathShims.tanh,Math.tanh(-2e-17)!==-2e-17);defineProperty(Math,"acosh",MathShims.acosh,Math.acosh(Number.MAX_VALUE)===Infinity);defineProperty(Math,"cbrt",MathShims.cbrt,Math.abs(1-Math.cbrt(1e-300)/1e-100)/Number.EPSILON>8);defineProperty(Math,"sinh",MathShims.sinh,Math.sinh(-2e-17)!==-2e-17);var expm1OfTen=Math.expm1(10);defineProperty(Math,"expm1",MathShims.expm1,expm1OfTen>22025.465794806718||expm1OfTen<22025.465794806718);var origMathRound=Math.round;var roundHandlesBoundaryConditions=Math.round(.5-Number.EPSILON/4)===0&&Math.round(-.5+Number.EPSILON/3.99)===1;var smallestPositiveNumberWhereRoundBreaks=inverseEpsilon+1;var largestPositiveNumberWhereRoundBreaks=2*inverseEpsilon-1;var roundDoesNotIncreaseIntegers=[smallestPositiveNumberWhereRoundBreaks,largestPositiveNumberWhereRoundBreaks].every(function(num){return Math.round(num)===num});defineProperty(Math,"round",function round(x){var floor=_floor(x);var ceil=floor===-1?-0:floor+1;return x-floor<.5?floor:ceil},!roundHandlesBoundaryConditions||!roundDoesNotIncreaseIntegers);Value.preserveToString(Math.round,origMathRound);var origImul=Math.imul;if(Math.imul(4294967295,5)!==-5){Math.imul=MathShims.imul;Value.preserveToString(Math.imul,origImul)}if(Math.imul.length!==2){overrideNative(Math,"imul",function imul(x,y){return _apply(origImul,Math,arguments)})}var PromiseShim=function(){var setTimeout=globals.setTimeout;if(typeof setTimeout!=="function"&&(typeof setTimeout==="undefined"?"undefined":_typeof(setTimeout))!=="object"){return}ES.IsPromise=function(promise){if(!ES.TypeIsObject(promise)){return false}if(typeof promise._promise==="undefined"){return false}return true};var PromiseCapability=function PromiseCapability(C){if(!ES.IsConstructor(C)){throw new TypeError("Bad promise constructor")}var capability=this;var resolver=function resolver(resolve,reject){if(capability.resolve!==void 0||capability.reject!==void 0){throw new TypeError("Bad Promise implementation!")}capability.resolve=resolve;capability.reject=reject};capability.promise=new C(resolver);if(!(ES.IsCallable(capability.resolve)&&ES.IsCallable(capability.reject))){throw new TypeError("Bad promise constructor")}};var makeZeroTimeout;if(typeof window!=="undefined"&&ES.IsCallable(window.postMessage)){makeZeroTimeout=function(){var timeouts=[];var messageName="zero-timeout-message";var setZeroTimeout=function setZeroTimeout(fn){_push(timeouts,fn);window.postMessage(messageName,"*")};var handleMessage=function handleMessage(event){if(event.source===window&&event.data===messageName){event.stopPropagation();if(timeouts.length===0){return}var fn=_shift(timeouts);fn()}};window.addEventListener("message",handleMessage,true);return setZeroTimeout}}var makePromiseAsap=function makePromiseAsap(){var P=globals.Promise;return P&&P.resolve&&function(task){return P.resolve().then(task)}};var enqueue=ES.IsCallable(globals.setImmediate)?globals.setImmediate.bind(globals):(typeof process==="undefined"?"undefined":_typeof(process))==="object"&&process.nextTick?process.nextTick:makePromiseAsap()||(ES.IsCallable(makeZeroTimeout)?makeZeroTimeout():function(task){setTimeout(task,0)});var PROMISE_IDENTITY=1;var PROMISE_THROWER=2;var PROMISE_PENDING=3;var PROMISE_FULFILLED=4;var PROMISE_REJECTED=5;var promiseReactionJob=function promiseReactionJob(reaction,argument){var promiseCapability=reaction.capabilities;var handler=reaction.handler;var handlerResult,handlerException=false,f;if(handler===PROMISE_IDENTITY){handlerResult=argument}else if(handler===PROMISE_THROWER){handlerResult=argument;handlerException=true}else{try{handlerResult=handler(argument)}catch(e){handlerResult=e;handlerException=true}}f=handlerException?promiseCapability.reject:promiseCapability.resolve;f(handlerResult)};var triggerPromiseReactions=function triggerPromiseReactions(reactions,argument){_forEach(reactions,function(reaction){enqueue(function(){promiseReactionJob(reaction,argument)})})};var fulfillPromise=function fulfillPromise(promise,value){var _promise=promise._promise;var reactions=_promise.fulfillReactions;_promise.result=value;_promise.fulfillReactions=void 0;_promise.rejectReactions=void 0;_promise.state=PROMISE_FULFILLED;triggerPromiseReactions(reactions,value)};var rejectPromise=function rejectPromise(promise,reason){var _promise=promise._promise;var reactions=_promise.rejectReactions;_promise.result=reason;_promise.fulfillReactions=void 0;_promise.rejectReactions=void 0;_promise.state=PROMISE_REJECTED;triggerPromiseReactions(reactions,reason)};var createResolvingFunctions=function createResolvingFunctions(promise){var alreadyResolved=false;var resolve=function resolve(resolution){var then;if(alreadyResolved){return}alreadyResolved=true;if(resolution===promise){return rejectPromise(promise,new TypeError("Self resolution"))}if(!ES.TypeIsObject(resolution)){return fulfillPromise(promise,resolution)}try{then=resolution.then}catch(e){return rejectPromise(promise,e)}if(!ES.IsCallable(then)){return fulfillPromise(promise,resolution)}enqueue(function(){promiseResolveThenableJob(promise,resolution,then)})};var reject=function reject(reason){if(alreadyResolved){return}alreadyResolved=true;return rejectPromise(promise,reason)};return{resolve:resolve,reject:reject}};var promiseResolveThenableJob=function promiseResolveThenableJob(promise,thenable,then){var resolvingFunctions=createResolvingFunctions(promise);var resolve=resolvingFunctions.resolve;var reject=resolvingFunctions.reject;try{_call(then,thenable,resolve,reject)}catch(e){reject(e)}};var getPromiseSpecies=function getPromiseSpecies(C){if(!ES.TypeIsObject(C)){throw new TypeError("Promise is not object")}var S=C[symbolSpecies];if(S!==void 0&&S!==null){return S}return C};var Promise$prototype;var Promise=function(){var PromiseShim=function Promise(resolver){if(!(this instanceof PromiseShim)){throw new TypeError('Constructor Promise requires "new"')}if(this&&this._promise){throw new TypeError("Bad construction")}if(!ES.IsCallable(resolver)){throw new TypeError("not a valid resolver")}var promise=emulateES6construct(this,PromiseShim,Promise$prototype,{_promise:{result:void 0,state:PROMISE_PENDING,fulfillReactions:[],rejectReactions:[]}});var resolvingFunctions=createResolvingFunctions(promise);var reject=resolvingFunctions.reject;try{resolver(resolvingFunctions.resolve,reject)}catch(e){reject(e)}return promise};return PromiseShim}();Promise$prototype=Promise.prototype;var _promiseAllResolver=function _promiseAllResolver(index,values,capability,remaining){var alreadyCalled=false;return function(x){if(alreadyCalled){return}alreadyCalled=true;values[index]=x;if(--remaining.count===0){var resolve=capability.resolve;resolve(values)}}};var performPromiseAll=function performPromiseAll(iteratorRecord,C,resultCapability){var it=iteratorRecord.iterator;var values=[],remaining={count:1},next,nextValue;var index=0;while(true){try{next=ES.IteratorStep(it);if(next===false){iteratorRecord.done=true;break}nextValue=next.value}catch(e){iteratorRecord.done=true;throw e}values[index]=void 0;var nextPromise=C.resolve(nextValue);var resolveElement=_promiseAllResolver(index,values,resultCapability,remaining);remaining.count+=1;nextPromise.then(resolveElement,resultCapability.reject);index+=1}if(--remaining.count===0){var resolve=resultCapability.resolve;resolve(values)}return resultCapability.promise};var performPromiseRace=function performPromiseRace(iteratorRecord,C,resultCapability){var it=iteratorRecord.iterator,next,nextValue,nextPromise;while(true){try{next=ES.IteratorStep(it);if(next===false){iteratorRecord.done=true;break}nextValue=next.value}catch(e){iteratorRecord.done=true;throw e}nextPromise=C.resolve(nextValue);nextPromise.then(resultCapability.resolve,resultCapability.reject)}return resultCapability.promise};defineProperties(Promise,{all:function all(iterable){var C=getPromiseSpecies(this);var capability=new PromiseCapability(C);var iterator,iteratorRecord;try{iterator=ES.GetIterator(iterable);iteratorRecord={iterator:iterator,done:false};return performPromiseAll(iteratorRecord,C,capability)}catch(e){var exception=e;if(iteratorRecord&&!iteratorRecord.done){try{ES.IteratorClose(iterator,true)}catch(ee){exception=ee}}var reject=capability.reject;reject(exception);return capability.promise}},race:function race(iterable){var C=getPromiseSpecies(this);var capability=new PromiseCapability(C);var iterator,iteratorRecord;try{iterator=ES.GetIterator(iterable);iteratorRecord={iterator:iterator,done:false};return performPromiseRace(iteratorRecord,C,capability)}catch(e){var exception=e;if(iteratorRecord&&!iteratorRecord.done){try{ES.IteratorClose(iterator,true)}catch(ee){exception=ee}}var reject=capability.reject;reject(exception);return capability.promise}},reject:function reject(reason){var C=this;var capability=new PromiseCapability(C);var rejectFunc=capability.reject;rejectFunc(reason);return capability.promise},resolve:function resolve(v){var C=this;if(ES.IsPromise(v)){var constructor=v.constructor;if(constructor===C){return v}}var capability=new PromiseCapability(C);var resolveFunc=capability.resolve;resolveFunc(v);return capability.promise}});defineProperties(Promise$prototype,{"catch":function _catch(onRejected){return this.then(void 0,onRejected)},then:function then(onFulfilled,onRejected){var promise=this;if(!ES.IsPromise(promise)){throw new TypeError("not a promise")}var C=ES.SpeciesConstructor(promise,Promise);var resultCapability=new PromiseCapability(C);var fulfillReaction={capabilities:resultCapability,handler:ES.IsCallable(onFulfilled)?onFulfilled:PROMISE_IDENTITY};var rejectReaction={capabilities:resultCapability,handler:ES.IsCallable(onRejected)?onRejected:PROMISE_THROWER};var _promise=promise._promise;var value;if(_promise.state===PROMISE_PENDING){_push(_promise.fulfillReactions,fulfillReaction);_push(_promise.rejectReactions,rejectReaction)}else if(_promise.state===PROMISE_FULFILLED){value=_promise.result;enqueue(function(){promiseReactionJob(fulfillReaction,value)})}else if(_promise.state===PROMISE_REJECTED){value=_promise.result;enqueue(function(){promiseReactionJob(rejectReaction,value)})}else{throw new TypeError("unexpected Promise state")}return resultCapability.promise}});return Promise}();if(globals.Promise){delete globals.Promise.accept;delete globals.Promise.defer;delete globals.Promise.prototype.chain}if(typeof PromiseShim==="function"){defineProperties(globals,{Promise:PromiseShim});var promiseSupportsSubclassing=supportsSubclassing(globals.Promise,function(S){return S.resolve(42).then(function(){})instanceof S});var promiseIgnoresNonFunctionThenCallbacks=!throwsError(function(){globals.Promise.reject(42).then(null,5).then(null,noop)});var promiseRequiresObjectContext=throwsError(function(){globals.Promise.call(3,noop)});var promiseResolveBroken=function(Promise){var p=Promise.resolve(5);p.constructor={};var p2=Promise.resolve(p);return p===p2}(globals.Promise);if(!promiseSupportsSubclassing||!promiseIgnoresNonFunctionThenCallbacks||!promiseRequiresObjectContext||promiseResolveBroken){Promise=PromiseShim;overrideNative(globals,"Promise",PromiseShim)}addDefaultSpecies(Promise)}var testOrder=function testOrder(a){var b=Object.keys(_reduce(a,function(o,k){o[k]=true;return o},{}));return a.join(":")===b.join(":")};var preservesInsertionOrder=testOrder(["z","a","bb"]);var preservesNumericInsertionOrder=testOrder(["z",1,"a","3",2]);if(supportsDescriptors){var fastkey=function fastkey(key){if(!preservesInsertionOrder){return null}var type=typeof key==="undefined"?"undefined":_typeof(key);if(type==="undefined"||key===null){return"^"+String(key)}else if(type==="string"){return"$"+key}else if(type==="number"){if(!preservesNumericInsertionOrder){return"n"+key}return key}else if(type==="boolean"){return"b"+key}return null};var emptyObject=function emptyObject(){return Object.create?Object.create(null):{}};var addIterableToMap=function addIterableToMap(MapConstructor,map,iterable){if(isArray(iterable)||Type.string(iterable)){_forEach(iterable,function(entry){map.set(entry[0],entry[1])})}else if(iterable instanceof MapConstructor){_call(MapConstructor.prototype.forEach,iterable,function(value,key){map.set(key,value)})}else{var iter,adder;if(iterable!==null&&typeof iterable!=="undefined"){adder=map.set;if(!ES.IsCallable(adder)){throw new TypeError("bad map")}iter=ES.GetIterator(iterable)}if(typeof iter!=="undefined"){while(true){var next=ES.IteratorStep(iter);if(next===false){break}var nextItem=next.value;try{if(!ES.TypeIsObject(nextItem)){throw new TypeError("expected iterable of pairs");
  128.  
  129. }_call(adder,map,nextItem[0],nextItem[1])}catch(e){ES.IteratorClose(iter,true);throw e}}}}};var addIterableToSet=function addIterableToSet(SetConstructor,set,iterable){if(isArray(iterable)||Type.string(iterable)){_forEach(iterable,function(value){set.add(value)})}else if(iterable instanceof SetConstructor){_call(SetConstructor.prototype.forEach,iterable,function(value){set.add(value)})}else{var iter,adder;if(iterable!==null&&typeof iterable!=="undefined"){adder=set.add;if(!ES.IsCallable(adder)){throw new TypeError("bad set")}iter=ES.GetIterator(iterable)}if(typeof iter!=="undefined"){while(true){var next=ES.IteratorStep(iter);if(next===false){break}var nextValue=next.value;try{_call(adder,set,nextValue)}catch(e){ES.IteratorClose(iter,true);throw e}}}}};var collectionShims={Map:function(){var empty={};var MapEntry=function MapEntry(key,value){this.key=key;this.value=value;this.next=null;this.prev=null};MapEntry.prototype.isRemoved=function isRemoved(){return this.key===empty};var isMap=function isMap(map){return!!map._es6map};var requireMapSlot=function requireMapSlot(map,method){if(!ES.TypeIsObject(map)||!isMap(map)){throw new TypeError("Method Map.prototype."+method+" called on incompatible receiver "+String(map))}};var MapIterator=function MapIterator(map,kind){requireMapSlot(map,"[[MapIterator]]");this.head=map._head;this.i=this.head;this.kind=kind};MapIterator.prototype={next:function next(){var i=this.i,kind=this.kind,head=this.head,result;if(typeof this.i==="undefined"){return{value:void 0,done:true}}while(i.isRemoved()&&i!==head){i=i.prev}while(i.next!==head){i=i.next;if(!i.isRemoved()){if(kind==="key"){result=i.key}else if(kind==="value"){result=i.value}else{result=[i.key,i.value]}this.i=i;return{value:result,done:false}}}this.i=void 0;return{value:void 0,done:true}}};addIterator(MapIterator.prototype);var Map$prototype;var MapShim=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}if(this&&this._es6map){throw new TypeError("Bad construction")}var map=emulateES6construct(this,Map,Map$prototype,{_es6map:true,_head:null,_storage:emptyObject(),_size:0});var head=new MapEntry(null,null);head.next=head.prev=head;map._head=head;if(arguments.length>0){addIterableToMap(Map,map,arguments[0])}return map};Map$prototype=MapShim.prototype;Value.getter(Map$prototype,"size",function(){if(typeof this._size==="undefined"){throw new TypeError("size method called on incompatible Map")}return this._size});defineProperties(Map$prototype,{get:function get(key){requireMapSlot(this,"get");var fkey=fastkey(key);if(fkey!==null){var entry=this._storage[fkey];if(entry){return entry.value}else{return}}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return i.value}}},has:function has(key){requireMapSlot(this,"has");var fkey=fastkey(key);if(fkey!==null){return typeof this._storage[fkey]!=="undefined"}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return true}}return false},set:function set(key,value){requireMapSlot(this,"set");var head=this._head,i=head,entry;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]!=="undefined"){this._storage[fkey].value=value;return this}else{entry=this._storage[fkey]=new MapEntry(key,value);i=head.prev}}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.value=value;return this}}entry=entry||new MapEntry(key,value);if(ES.SameValue(-0,key)){entry.key=+0}entry.next=this._head;entry.prev=this._head.prev;entry.prev.next=entry;entry.next.prev=entry;this._size+=1;return this},"delete":function _delete(key){requireMapSlot(this,"delete");var head=this._head,i=head;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]==="undefined"){return false}i=this._storage[fkey].prev;delete this._storage[fkey]}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.key=i.value=empty;i.prev.next=i.next;i.next.prev=i.prev;this._size-=1;return true}}return false},clear:function clear(){requireMapSlot(this,"clear");this._size=0;this._storage=emptyObject();var head=this._head,i=head,p=i.next;while((i=p)!==head){i.key=i.value=empty;p=i.next;i.next=i.prev=head}head.next=head.prev=head},keys:function keys(){requireMapSlot(this,"keys");return new MapIterator(this,"key")},values:function values(){requireMapSlot(this,"values");return new MapIterator(this,"value")},entries:function entries(){requireMapSlot(this,"entries");return new MapIterator(this,"key+value")},forEach:function forEach(callback){requireMapSlot(this,"forEach");var context=arguments.length>1?arguments[1]:null;var it=this.entries();for(var entry=it.next();!entry.done;entry=it.next()){if(context){_call(callback,context,entry.value[1],entry.value[0],this)}else{callback(entry.value[1],entry.value[0],this)}}}});addIterator(Map$prototype,Map$prototype.entries);return MapShim}(),Set:function(){var isSet=function isSet(set){return set._es6set&&typeof set._storage!=="undefined"};var requireSetSlot=function requireSetSlot(set,method){if(!ES.TypeIsObject(set)||!isSet(set)){throw new TypeError("Set.prototype."+method+" called on incompatible receiver "+String(set))}};var Set$prototype;var SetShim=function Set(){if(!(this instanceof Set)){throw new TypeError('Constructor Set requires "new"')}if(this&&this._es6set){throw new TypeError("Bad construction")}var set=emulateES6construct(this,Set,Set$prototype,{_es6set:true,"[[SetData]]":null,_storage:emptyObject()});if(!set._es6set){throw new TypeError("bad set")}if(arguments.length>0){addIterableToSet(Set,set,arguments[0])}return set};Set$prototype=SetShim.prototype;var ensureMap=function ensureMap(set){if(!set["[[SetData]]"]){var m=set["[[SetData]]"]=new collectionShims.Map;_forEach(Object.keys(set._storage),function(key){var k=key;if(k==="^null"){k=null}else if(k==="^undefined"){k=void 0}else{var first=k.charAt(0);if(first==="$"){k=_strSlice(k,1)}else if(first==="n"){k=+_strSlice(k,1)}else if(first==="b"){k=k==="btrue"}else{k=+k}}m.set(k,k)});set._storage=null}};Value.getter(SetShim.prototype,"size",function(){requireSetSlot(this,"size");ensureMap(this);return this["[[SetData]]"].size});defineProperties(SetShim.prototype,{has:function has(key){requireSetSlot(this,"has");var fkey;if(this._storage&&(fkey=fastkey(key))!==null){return!!this._storage[fkey]}ensureMap(this);return this["[[SetData]]"].has(key)},add:function add(key){requireSetSlot(this,"add");var fkey;if(this._storage&&(fkey=fastkey(key))!==null){this._storage[fkey]=true;return this}ensureMap(this);this["[[SetData]]"].set(key,key);return this},"delete":function _delete(key){requireSetSlot(this,"delete");var fkey;if(this._storage&&(fkey=fastkey(key))!==null){var hasFKey=_hasOwnProperty(this._storage,fkey);return delete this._storage[fkey]&&hasFKey}ensureMap(this);return this["[[SetData]]"]["delete"](key)},clear:function clear(){requireSetSlot(this,"clear");if(this._storage){this._storage=emptyObject()}else{this["[[SetData]]"].clear()}},values:function values(){requireSetSlot(this,"values");ensureMap(this);return this["[[SetData]]"].values()},entries:function entries(){requireSetSlot(this,"entries");ensureMap(this);return this["[[SetData]]"].entries()},forEach:function forEach(callback){requireSetSlot(this,"forEach");var context=arguments.length>1?arguments[1]:null;var entireSet=this;ensureMap(entireSet);this["[[SetData]]"].forEach(function(value,key){if(context){_call(callback,context,key,key,entireSet)}else{callback(key,key,entireSet)}})}});defineProperty(SetShim.prototype,"keys",SetShim.prototype.values,true);addIterator(SetShim.prototype,SetShim.prototype.values);return SetShim}()};if(globals.Map||globals.Set){var mapAcceptsArguments=valueOrFalseIfThrows(function(){return new Map([[1,2]]).get(1)===2});if(!mapAcceptsArguments){var OrigMapNoArgs=globals.Map;globals.Map=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}var m=new OrigMapNoArgs;if(arguments.length>0){addIterableToMap(Map,m,arguments[0])}Object.setPrototypeOf(m,globals.Map.prototype);defineProperty(m,"constructor",Map,true);return m};globals.Map.prototype=create(OrigMapNoArgs.prototype);Value.preserveToString(globals.Map,OrigMapNoArgs)}var testMap=new Map;var mapUsesSameValueZero=function(m){m["delete"](0);m["delete"](-0);m.set(0,3);m.get(-0,4);return m.get(0)===3&&m.get(-0)===4}(testMap);var mapSupportsChaining=testMap.set(1,2)===testMap;if(!mapUsesSameValueZero||!mapSupportsChaining){var origMapSet=Map.prototype.set;overrideNative(Map.prototype,"set",function set(k,v){_call(origMapSet,this,k===0?0:k,v);return this})}if(!mapUsesSameValueZero){var origMapGet=Map.prototype.get;var origMapHas=Map.prototype.has;defineProperties(Map.prototype,{get:function get(k){return _call(origMapGet,this,k===0?0:k)},has:function has(k){return _call(origMapHas,this,k===0?0:k)}},true);Value.preserveToString(Map.prototype.get,origMapGet);Value.preserveToString(Map.prototype.has,origMapHas)}var testSet=new Set;var setUsesSameValueZero=function(s){s["delete"](0);s.add(-0);return!s.has(0)}(testSet);var setSupportsChaining=testSet.add(1)===testSet;if(!setUsesSameValueZero||!setSupportsChaining){var origSetAdd=Set.prototype.add;Set.prototype.add=function add(v){_call(origSetAdd,this,v===0?0:v);return this};Value.preserveToString(Set.prototype.add,origSetAdd)}if(!setUsesSameValueZero){var origSetHas=Set.prototype.has;Set.prototype.has=function has(v){return _call(origSetHas,this,v===0?0:v)};Value.preserveToString(Set.prototype.has,origSetHas);var origSetDel=Set.prototype["delete"];Set.prototype["delete"]=function SetDelete(v){return _call(origSetDel,this,v===0?0:v)};Value.preserveToString(Set.prototype["delete"],origSetDel)}var mapSupportsSubclassing=supportsSubclassing(globals.Map,function(M){var m=new M([]);m.set(42,42);return m instanceof M});var mapFailsToSupportSubclassing=Object.setPrototypeOf&&!mapSupportsSubclassing;var mapRequiresNew=function(){try{return!(globals.Map()instanceof globals.Map)}catch(e){return e instanceof TypeError}}();if(globals.Map.length!==0||mapFailsToSupportSubclassing||!mapRequiresNew){var OrigMap=globals.Map;globals.Map=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}var m=new OrigMap;if(arguments.length>0){addIterableToMap(Map,m,arguments[0])}Object.setPrototypeOf(m,Map.prototype);defineProperty(m,"constructor",Map,true);return m};globals.Map.prototype=OrigMap.prototype;Value.preserveToString(globals.Map,OrigMap)}var setSupportsSubclassing=supportsSubclassing(globals.Set,function(S){var s=new S([]);s.add(42,42);return s instanceof S});var setFailsToSupportSubclassing=Object.setPrototypeOf&&!setSupportsSubclassing;var setRequiresNew=function(){try{return!(globals.Set()instanceof globals.Set)}catch(e){return e instanceof TypeError}}();if(globals.Set.length!==0||setFailsToSupportSubclassing||!setRequiresNew){var OrigSet=globals.Set;globals.Set=function Set(){if(!(this instanceof Set)){throw new TypeError('Constructor Set requires "new"')}var s=new OrigSet;if(arguments.length>0){addIterableToSet(Set,s,arguments[0])}Object.setPrototypeOf(s,Set.prototype);defineProperty(s,"constructor",Set,true);return s};globals.Set.prototype=OrigSet.prototype;Value.preserveToString(globals.Set,OrigSet)}var mapIterationThrowsStopIterator=!valueOrFalseIfThrows(function(){return(new Map).keys().next().done});if(typeof globals.Map.prototype.clear!=="function"||(new globals.Set).size!==0||(new globals.Map).size!==0||typeof globals.Map.prototype.keys!=="function"||typeof globals.Set.prototype.keys!=="function"||typeof globals.Map.prototype.forEach!=="function"||typeof globals.Set.prototype.forEach!=="function"||isCallableWithoutNew(globals.Map)||isCallableWithoutNew(globals.Set)||typeof(new globals.Map).keys().next!=="function"||mapIterationThrowsStopIterator||!mapSupportsSubclassing){delete globals.Map;delete globals.Set;defineProperties(globals,{Map:collectionShims.Map,Set:collectionShims.Set},true)}if(globals.Set.prototype.keys!==globals.Set.prototype.values){defineProperty(globals.Set.prototype,"keys",globals.Set.prototype.values,true)}addIterator(Object.getPrototypeOf((new globals.Map).keys()));addIterator(Object.getPrototypeOf((new globals.Set).keys()));if(functionsHaveNames&&globals.Set.prototype.has.name!=="has"){var anonymousSetHas=globals.Set.prototype.has;overrideNative(globals.Set.prototype,"has",function has(key){return _call(anonymousSetHas,this,key)})}}defineProperties(globals,collectionShims);addDefaultSpecies(globals.Map);addDefaultSpecies(globals.Set)}var throwUnlessTargetIsObject=function throwUnlessTargetIsObject(target){if(!ES.TypeIsObject(target)){throw new TypeError("target must be an object")}};var ReflectShims={apply:function apply(){return _apply(ES.Call,null,arguments)},construct:function construct(constructor,args){if(!ES.IsConstructor(constructor)){throw new TypeError("First argument must be a constructor.")}var newTarget=arguments.length<3?constructor:arguments[2];if(!ES.IsConstructor(newTarget)){throw new TypeError("new.target must be a constructor.")}return ES.Construct(constructor,args,newTarget,"internal")},deleteProperty:function deleteProperty(target,key){throwUnlessTargetIsObject(target);if(supportsDescriptors){var desc=Object.getOwnPropertyDescriptor(target,key);if(desc&&!desc.configurable){return false}}return delete target[key]},enumerate:function enumerate(target){throwUnlessTargetIsObject(target);return new ObjectIterator(target,"key")},has:function has(target,key){throwUnlessTargetIsObject(target);return key in target}};if(Object.getOwnPropertyNames){Object.assign(ReflectShims,{ownKeys:function ownKeys(target){throwUnlessTargetIsObject(target);var keys=Object.getOwnPropertyNames(target);if(ES.IsCallable(Object.getOwnPropertySymbols)){_pushApply(keys,Object.getOwnPropertySymbols(target))}return keys}})}var callAndCatchException=function ConvertExceptionToBoolean(func){return!throwsError(func)};if(Object.preventExtensions){Object.assign(ReflectShims,{isExtensible:function isExtensible(target){throwUnlessTargetIsObject(target);return Object.isExtensible(target)},preventExtensions:function preventExtensions(target){throwUnlessTargetIsObject(target);return callAndCatchException(function(){Object.preventExtensions(target)})}})}if(supportsDescriptors){var internalGet=function get(target,key,receiver){var desc=Object.getOwnPropertyDescriptor(target,key);if(!desc){var parent=Object.getPrototypeOf(target);if(parent===null){return undefined}return internalGet(parent,key,receiver)}if("value"in desc){return desc.value}if(desc.get){return _call(desc.get,receiver)}return undefined};var internalSet=function set(target,key,value,receiver){var desc=Object.getOwnPropertyDescriptor(target,key);if(!desc){var parent=Object.getPrototypeOf(target);if(parent!==null){return internalSet(parent,key,value,receiver)}desc={value:void 0,writable:true,enumerable:true,configurable:true}}if("value"in desc){if(!desc.writable){return false}if(!ES.TypeIsObject(receiver)){return false}var existingDesc=Object.getOwnPropertyDescriptor(receiver,key);if(existingDesc){return Reflect.defineProperty(receiver,key,{value:value})}else{return Reflect.defineProperty(receiver,key,{value:value,writable:true,enumerable:true,configurable:true})}}if(desc.set){_call(desc.set,receiver,value);return true}return false};Object.assign(ReflectShims,{defineProperty:function defineProperty(target,propertyKey,attributes){throwUnlessTargetIsObject(target);return callAndCatchException(function(){Object.defineProperty(target,propertyKey,attributes)})},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(target,propertyKey){throwUnlessTargetIsObject(target);return Object.getOwnPropertyDescriptor(target,propertyKey)},get:function get(target,key){throwUnlessTargetIsObject(target);var receiver=arguments.length>2?arguments[2]:target;return internalGet(target,key,receiver)},set:function set(target,key,value){throwUnlessTargetIsObject(target);var receiver=arguments.length>3?arguments[3]:target;return internalSet(target,key,value,receiver)}})}if(Object.getPrototypeOf){var objectDotGetPrototypeOf=Object.getPrototypeOf;ReflectShims.getPrototypeOf=function getPrototypeOf(target){throwUnlessTargetIsObject(target);return objectDotGetPrototypeOf(target)}}if(Object.setPrototypeOf&&ReflectShims.getPrototypeOf){var willCreateCircularPrototype=function willCreateCircularPrototype(object,lastProto){var proto=lastProto;while(proto){if(object===proto){return true}proto=ReflectShims.getPrototypeOf(proto)}return false};Object.assign(ReflectShims,{setPrototypeOf:function setPrototypeOf(object,proto){throwUnlessTargetIsObject(object);if(proto!==null&&!ES.TypeIsObject(proto)){throw new TypeError("proto must be an object or null")}if(proto===Reflect.getPrototypeOf(object)){return true}if(Reflect.isExtensible&&!Reflect.isExtensible(object)){return false}if(willCreateCircularPrototype(object,proto)){return false}Object.setPrototypeOf(object,proto);return true}})}var defineOrOverrideReflectProperty=function defineOrOverrideReflectProperty(key,shim){if(!ES.IsCallable(globals.Reflect[key])){defineProperty(globals.Reflect,key,shim)}else{var acceptsPrimitives=valueOrFalseIfThrows(function(){globals.Reflect[key](1);globals.Reflect[key](NaN);globals.Reflect[key](true);return true});if(acceptsPrimitives){overrideNative(globals.Reflect,key,shim)}}};Object.keys(ReflectShims).forEach(function(key){defineOrOverrideReflectProperty(key,ReflectShims[key])});if(functionsHaveNames&&globals.Reflect.getPrototypeOf.name!=="getPrototypeOf"){var originalReflectGetProto=globals.Reflect.getPrototypeOf;overrideNative(globals.Reflect,"getPrototypeOf",function getPrototypeOf(target){return _call(originalReflectGetProto,globals.Reflect,target)})}if(globals.Reflect.setPrototypeOf){if(valueOrFalseIfThrows(function(){globals.Reflect.setPrototypeOf(1,{});return true})){overrideNative(globals.Reflect,"setPrototypeOf",ReflectShims.setPrototypeOf)}}if(globals.Reflect.defineProperty){if(!valueOrFalseIfThrows(function(){var basic=!globals.Reflect.defineProperty(1,"test",{value:1});var extensible=typeof Object.preventExtensions!=="function"||!globals.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return basic&&extensible})){overrideNative(globals.Reflect,"defineProperty",ReflectShims.defineProperty)}}if(globals.Reflect.construct){if(!valueOrFalseIfThrows(function(){var F=function F(){};return globals.Reflect.construct(function(){},[],F)instanceof F})){overrideNative(globals.Reflect,"construct",ReflectShims.construct)}}if(String(new Date(NaN))!=="Invalid Date"){var dateToString=Date.prototype.toString;var shimmedDateToString=function toString(){var valueOf=+this;if(valueOf!==valueOf){return"Invalid Date"}return _call(dateToString,this)};overrideNative(Date.prototype,"toString",shimmedDateToString)}var stringHTMLshims={anchor:function anchor(name){return ES.CreateHTML(this,"a","name",name)},big:function big(){return ES.CreateHTML(this,"big","","")},blink:function blink(){return ES.CreateHTML(this,"blink","","")},bold:function bold(){return ES.CreateHTML(this,"b","","")},fixed:function fixed(){return ES.CreateHTML(this,"tt","","")},fontcolor:function fontcolor(color){return ES.CreateHTML(this,"font","color",color)},fontsize:function fontsize(size){return ES.CreateHTML(this,"font","size",size)},italics:function italics(){return ES.CreateHTML(this,"i","","")},link:function link(url){return ES.CreateHTML(this,"a","href",url)},small:function small(){return ES.CreateHTML(this,"small","","")},strike:function strike(){return ES.CreateHTML(this,"strike","","")},sub:function sub(){return ES.CreateHTML(this,"sub","","")},sup:function sub(){return ES.CreateHTML(this,"sup","","")}};_forEach(Object.keys(stringHTMLshims),function(key){var method=String.prototype[key];var shouldOverwrite=false;if(ES.IsCallable(method)){var output=_call(method,"",' " ');var quotesCount=_concat([],output.match(/"/g)).length;shouldOverwrite=output!==output.toLowerCase()||quotesCount>2}else{shouldOverwrite=true}if(shouldOverwrite){overrideNative(String.prototype,key,stringHTMLshims[key])}});var JSONstringifiesSymbols=function(){if(!Type.symbol(Symbol.iterator)){return false}var stringify=(typeof JSON==="undefined"?"undefined":_typeof(JSON))==="object"&&typeof JSON.stringify==="function"?JSON.stringify:null;if(!stringify){return false}if(typeof stringify(Symbol())!=="undefined"){return true}if(stringify([Symbol()])!=="[null]"){return true}var obj={a:Symbol()};obj[Symbol()]=true;if(stringify(obj)!=="{}"){return true}return false}();var JSONstringifyAcceptsObjectSymbol=valueOrFalseIfThrows(function(){if(!Type.symbol(Symbol.iterator)){return true}return JSON.stringify(Object(Symbol()))==="{}"&&JSON.stringify([Object(Symbol())])==="[{}]"});if(JSONstringifiesSymbols||!JSONstringifyAcceptsObjectSymbol){var origStringify=JSON.stringify;overrideNative(JSON,"stringify",function stringify(value){if((typeof value==="undefined"?"undefined":_typeof(value))==="symbol"){return}var replacer;if(arguments.length>1){replacer=arguments[1]}var args=[value];if(!isArray(replacer)){var replaceFn=ES.IsCallable(replacer)?replacer:null;var wrappedReplacer=function wrappedReplacer(key,val){var parsedValue=replacer?_call(replacer,this,key,val):val;if((typeof parsedValue==="undefined"?"undefined":_typeof(parsedValue))!=="symbol"){if(Type.symbol(parsedValue)){return assignTo({})(parsedValue)}else{return parsedValue}}};args.push(wrappedReplacer)}else{args.push(replacer)}if(arguments.length>2){args.push(arguments[2])}return origStringify.apply(this,args)})}return globals});define("jqueryplugins",["jquery"],function($){"use strict";$.prototype.extend({popAttr:function popAttr(attr){var ret=this.attr(attr);this.removeAttr(attr);return ret},popData:function popData(name){var ret=this.data(name);this.removeData(name);return ret},tag:function tag(){return this[0]&&this[0].tagName&&this[0].tagName.toLowerCase()},textNodes:function textNodes(){if(this.length===1&&this[0]instanceof Text){return[this[0]]}return Array.from(this.add(this.contents().add(this.find("*").contents())).filter(function(){return this instanceof Text})).sort(function(left,right){return left.compareDocumentPosition(right)&2?1:-1})},prevTextNode:function prevTextNode(){var elem=this.first()[0],parent=this.parent();if(!parent.length){return null}var textNodes=parent.textNodes().filter(function(e){var pos=e.compareDocumentPosition(elem);return pos&4&&!(pos&8)});textNodes=textNodes[textNodes.length-1];return!textNodes?parent.prevTextNode():textNodes},nextTextNode:function nextTextNode(){var elem=this.last()[0],parent=this.parent();if(!parent.length){return null}var textNodes=parent.textNodes().filter(function(e){var pos=e.compareDocumentPosition(elem);return pos&2&&!(pos&8)})[0];return!textNodes?parent.nextTextNode():textNodes}})});(function(){"use strict";var Lexer=undefined;var rules={};function Token(){for(var i=0;i<arguments.length;i++){for(var j in arguments[i]){this[j]=arguments[i][j]}}}function cacheChildPos(token,childToken){token.childAt=token.childAt||{};for(var i=childToken.start;i<childToken.end;i+=1){token.childAt[i]=childToken}}Token.prototype={constructor:Token,addChild:function addChild(tokenData){var index=this.lastChildEnd();var childToken=new Token({start:index,end:tokenData.text&&index+tokenData.text.length,children:[]},tokenData);if(childToken.innerText){_lex(childToken)}this.children.push(childToken);cacheChildPos(this,childToken);return childToken},lastChild:function lastChild(){return this.children?this.children[this.children.length-1]||null:null},lastChildEnd:function lastChildEnd(){var lastToken=this.lastChild();return lastToken?lastToken.end:this.start+Math.max(0,this.text.indexOf(this.innerText))},tokenAt:function tokenAt(index){if(index<this.start||index>=this.end){return null}if(this.childAt){return this.childAt[index]&&this.childAt[index].tokenAt(index)||this}if(this.children.length){for(var i=0;i<this.children.length;i+=1){var childToken=this.children[i].tokenAt(index);if(childToken){return childToken}}}return this},pathAt:function pathAt(index){if(index<this.start||index>=this.end){return[]}if(this.childAt){return(this.childAt[index]&&this.childAt[index].pathAt(index)||[]).concat(this)}var path=[];if(this.children.length){for(var i=0;i<this.children.length;i+=1){var childPath=this.children[i].pathAt(index);if(childPath.length){path.concat(childPath);break}}}return path.concat(this)},nearestTokenAt:function nearestTokenAt(index){if(index<this.start||index>=this.end){return null}if(this.children){return this.children.reduce(function(prevValue,child){return prevValue||(index>=child.start&&index<child.end?child:null)},null)}return this},everyLeaf:function everyLeaf(fn){if(!this.children||this.children.length===0){return!!fn(this)}var ret=undefined;return this.children.everyLeaf(function(){ret=ret&&!!everyLeaf(fn)})},isWhitespace:function isWhitespace(){return this.everyLeaf(function(e){return e.type==="whitespace"||!e.text.trim()})},isFrontToken:function isFrontToken(){return this.isFront},isBackToken:function isBackToken(){return"matches"in this},demote:function demote(){this.type="text"},error:function error(message){this.type="error";this.message=message},toString:function toString(){var ret=this.type+"("+this.start+"→"+this.end+")";if(this.children&&this.children.length>0){ret+="["+this.children+"]"}return ret}};function shouldTest(rule,text,lastToken,unmatchedLength){return(!rule.canFollow||rule.canFollow.indexOf(lastToken&&lastToken.type)>-1)&&(!rule.cannotFollow||rule.cannotFollow.indexOf(lastToken&&lastToken.type)===-1&&!(rule.cannotFollow.indexOf("text")>-1&&unmatchedLength))&&(!rule.peek||rule.peek===text.slice(0,rule.peek.length))}function _lex(parentToken){var src=parentToken.innerText;var frontTokenStack=[],index=0,firstUnmatchedIndex=index,endIndex=src.length,lastToken=null;while(index<endIndex){var slice=src.slice(index);var mode=(frontTokenStack.length?frontTokenStack[0]:parentToken).innerMode;var i=0,l=mode.length;for(;i<l;i+=1){var rule=rules[mode[i]];if(!(shouldTest(rule,slice,lastToken,firstUnmatchedIndex<index)&&rule.pattern.test(slice))){continue}var match=rule.pattern.exec(slice);var tokenData=rule.fn(match);var isMatchingBack=false;var ft=0;if(tokenData.matches){for(;ft<frontTokenStack.length;ft+=1){if(frontTokenStack[ft].type in tokenData.matches){isMatchingBack=true;break}}if(ft>=frontTokenStack.length&&!tokenData.isFront){continue}}if(firstUnmatchedIndex<index){parentToken.addChild({type:"text",text:src.slice(firstUnmatchedIndex,index),innerMode:mode})}lastToken=parentToken.addChild(tokenData);index+=lastToken.text.length;firstUnmatchedIndex=index;if(isMatchingBack){foldTokens(parentToken,lastToken,frontTokenStack[ft]);frontTokenStack=frontTokenStack.slice(ft+1)}if(lastToken.isFrontToken()){frontTokenStack.unshift(lastToken)}break}if(i===l){index+=1;if(lastToken===null){lastToken={type:"text"}}}}if(firstUnmatchedIndex<index){parentToken.addChild({type:"text",text:src.slice(firstUnmatchedIndex,index),innerMode:(frontTokenStack.length?frontTokenStack[0]:parentToken).innerMode})}while(frontTokenStack.length>0){frontTokenStack.shift().demote()}return parentToken}function foldTokens(parentToken,backToken,frontToken){var backTokenIndex=parentToken.children.indexOf(backToken),frontTokenIndex=parentToken.children.indexOf(frontToken);backToken.children=parentToken.children.splice(frontTokenIndex+1,backTokenIndex-(frontTokenIndex+1));backToken.children.forEach(function(token){cacheChildPos(backToken,token)});backToken.type=backToken.matches[frontToken.type];backToken.innerText="";for(var i=0,l=backToken.children.length;i<l;i++){backToken.innerText+=backToken.children[i].text}backToken.start=frontToken.start;backToken.text=frontToken.text+backToken.innerText+backToken.text;Object.keys(frontToken).forEach(function(key){if(!Object.hasOwnProperty.call(backToken,key)){backToken[key]=frontToken[key]}});if(backToken.isFront){backToken.isFront=false}parentToken.children.splice(frontTokenIndex,1);cacheChildPos(parentToken,backToken)}Lexer={lex:function lex(src,initIndex){return _lex(new Token({type:"root",start:initIndex||0,end:src.length,text:src,innerText:src,children:[],childAt:{},innerMode:Lexer.startMode}))},rules:rules};if((typeof module==="undefined"?"undefined":_typeof(module))==="object"){module.exports=Lexer}else if(typeof define==="function"&&define.amd){define("lexer",[],function(){return Lexer})}else if(typeof StoryFormat==="function"&&this instanceof StoryFormat){this.modules||(this.modules={});this.modules.Lexer=Lexer}else{this.TwineLexer=Lexer}}).call(eval("this")||(typeof global!=="undefined"?global:window));(function(){"use strict";var Patterns=undefined;function escape(str){if(str&&(typeof str==="undefined"?"undefined":_typeof(str))==="object"){Object.keys(str).forEach(function(e){str[e]=escape(str[e])});return str}return(str+"").replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function notChars(){return"[^"+Array.apply(0,arguments).map(escape).join("")+"]*"}function makeWrapper(starter){return function(){return"("+starter+Array.apply(0,arguments).join("|")+")"}}var either=makeWrapper("?:"),notBefore=makeWrapper("?!"),before=makeWrapper("?=");var ws="[ \\f\\t\\v  ᠎ - \u2028\u2029   ]*",mws=ws.replace("*","+"),wb="\\b",escapedLine="\\\\\\n\\\\?|\\n\\\\",br="\\n(?!\\\\)",anyLetter="[\\w\\-À-Þß-ÿŐŰőű]",anyLetterStrict="[\\wÀ-Þß-ÿŐŰőű]",eol=either("\\n","$"),noUnescapedLineBreak="("+either(escapedLine,"[^\\n]")+"+)",bullet="\\*",bulleted=ws+"("+bullet+"+)"+mws+noUnescapedLineBreak+eol,numberPoint="(?:0\\.)",numbered=ws+"("+numberPoint+"+)"+mws+noUnescapedLineBreak+eol,hr=ws+"-{3,}"+ws+eol,heading=ws+"(#{1,6})"+ws+noUnescapedLineBreak+eol,align=ws+"(==+>|<=+|=+><=+|<==+>)"+ws+eol,passageLink={opener:"\\[\\[(?!\\[)",text:"("+notChars("]")+")",rightSeparator:either("\\->","\\|"),leftSeparator:"<\\-",closer:"\\]\\]",legacySeparator:"\\|",legacyText:"("+either("[^\\|\\]]","\\]"+notBefore("\\]"))+"+)"},validPropertyName=anyLetter.replace("\\-","")+"*"+anyLetter.replace("\\-","").replace("\\w","a-zA-Z")+anyLetter.replace("\\-","")+"*",variable="\\$("+validPropertyName+")",property="'s"+mws+"("+validPropertyName+")",belongingProperty="("+validPropertyName+")"+mws+"of"+wb+notBefore("it"+wb),possessiveOperator="'s"+mws,belongingOperator="of"+wb,identifier=either("it","time")+wb,itsProperty="its"+mws+"("+validPropertyName+")",itsOperator="its"+mws,belongingItProperty="("+validPropertyName+")"+mws+"of"+mws+"it"+wb,belongingItOperator="of"+wb+mws+"it"+wb,macro={opener:"\\(",name:"("+either(anyLetter.replace("]","\\/]")+anyLetter+"*",variable)+"):",closer:"\\)"},twine1Macro="<<[^>\\s]+\\s*(?:\\\\.|'(?:[^'\\\\]*\\\\.)*[^'\\\\]*'|\"(?:[^\"\\\\]*\\\\.)*[^\"\\\\]*\"|[^'\"\\\\>]|>(?!>))*>>",tag={name:"[a-zA-Z][\\w\\-]*",attrs:"(?:\"[^\"]*\"|'[^']*'|[^'\">])*?"},hookTagFront="\\|("+anyLetter.replace("]","_]")+"*)>",hookTagBack="<("+anyLetter.replace("]","_]")+"*)\\|",number="\\b(\\d+(?:\\.\\d+)?(?:[eE][+\\-]?\\d+)?|NaN)"+notBefore("m?s")+"\\b";passageLink.main=passageLink.opener+either(passageLink.text+passageLink.rightSeparator,passageLink.text.replace("*","*?")+passageLink.leftSeparator)+passageLink.text;Patterns={upperLetter:"[A-ZÀ-ÞŐŰ]",lowerLetter:"[a-z0-9_\\-ß-ÿőű]",anyLetter:anyLetter,anyLetterStrict:anyLetterStrict,whitespace:mws,escapedLine:escapedLine,br:br,commentFront:"<!--",commentBack:"-->",tag:"<\\/?"+tag.name+tag.attrs+">",tagPeek:"<",scriptStyleTag:"<("+either("script","style")+")"+tag.attrs+">"+"[^]*?"+"<\\/\\1>",scriptStyleTagOpener:"<",url:"("+either("https?","mailto","javascript","ftp","data")+":\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])",bullet:bullet,hr:hr,heading:heading,align:align,bulleted:bulleted,numbered:numbered,delOpener:escape("~~"),italicOpener:escape("//"),boldOpener:escape("''"),supOpener:escape("^^"),strongFront:escape("**"),strongBack:escape("**"),emFront:escape("*"),emBack:escape("*"),verbatimOpener:"`+",collapsedFront:"{",collapsedBack:"}",hookAppendedFront:"\\[",hookPrependedFront:hookTagFront+"\\[",
  130. hookAnonymousFront:"\\[",hookBack:"\\]"+notBefore(hookTagBack),hookAppendedBack:"\\]"+hookTagBack,passageLink:passageLink.main+passageLink.closer,passageLinkPeek:"[[",legacyLink:passageLink.opener+passageLink.legacyText+passageLink.legacySeparator+passageLink.legacyText+passageLink.closer,legacyLinkPeek:"[[",simpleLink:passageLink.opener+passageLink.legacyText+passageLink.closer,simpleLinkPeek:"[[",macroFront:macro.opener+before(macro.name),macroFrontPeek:"(",macroName:macro.name,groupingFront:"\\("+notBefore(macro.name),groupingFrontPeek:"(",groupingBack:"\\)",twine1Macro:twine1Macro,twine1MacroPeek:"<<",property:property,propertyPeek:"'s",belongingProperty:belongingProperty,possessiveOperator:possessiveOperator,belongingOperator:belongingOperator,belongingOperatorPeek:"of",itsOperator:itsOperator,itsOperatorPeek:"its",belongingItOperator:belongingItOperator,belongingItOperatorPeek:"of",variable:variable,variablePeek:"$",hookRef:"\\?("+anyLetter+"+)\\b",hookRefPeek:"?",cssTime:"(\\d+\\.?\\d*|\\d*\\.?\\d+)(m?s)"+wb,colour:either(either("Red","Orange","Yellow","Lime","Green","Cyan","Aqua","Blue","Navy","Purple","Fuchsia","Magenta","White","Gray","Grey","Black"),"#[\\dA-Fa-f]{3}(?:[\\dA-Fa-f]{3})?"),number:number,"boolean":either("true","false")+wb,identifier:identifier,itsProperty:itsProperty,itsPropertyPeek:"its",belongingItProperty:belongingItProperty,escapedStringChar:"\\\\[^\\n]",singleStringOpener:"'",doubleStringOpener:'"',is:"is"+notBefore(" not"," in")+wb,isNot:"is not"+wb,and:"and"+wb,or:"or"+wb,not:"not"+wb,inequality:either("<(?!=)","<=",">(?!=)",">="),isIn:"is in"+wb,contains:"contains"+wb,addition:escape("+")+notBefore("="),subtraction:escape("-")+notBefore("="),multiplication:escape("*")+notBefore("="),division:either("/","%")+notBefore("="),comma:",",spread:"\\.\\.\\."+notBefore("\\."),to:either("to"+wb,"="),into:"into"+wb,augmentedAssign:either("\\+","\\-","\\*","\\/","%")+"="};if((typeof module==="undefined"?"undefined":_typeof(module))==="object"){module.exports=Patterns}else if(typeof define==="function"&&define.amd){define("patterns",[],function(){return Patterns})}else if(typeof StoryFormat==="function"&&this instanceof StoryFormat){this.modules||(this.modules={});this.modules.Patterns=Patterns}else{this.Patterns=Patterns}}).call(eval("this")||(typeof global!=="undefined"?global:window));(function(){"use strict";var Patterns=undefined;Object.assign=Object.assign||function polyfilledAssign(obj){for(var i=1;i<arguments.length;i++){var target=arguments[i];for(var key in target){if(Object.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj};function rules(Lexer){function textTokenFn(name){name=name||"innerText";return function(match){var innerText=match.reduceRight(function(a,b,index){return a||(index?b:"")},""),data={};data[name]=innerText;return data}}function openerFn(name,foldedName){var matches={};matches[name]=foldedName;return function(){return{isFront:true,matches:matches}}}var emptyFn=Object.bind(0,null);function setupRules(mode,target){Object.keys(target).forEach(function(ruleName){var innerFn=target[ruleName].fn;target[ruleName].fn=function(match){var ret=innerFn(match);if(!ret.text){ret.text=match[0]}if(!ret.type){ret.type=ruleName}if(!ret.innerMode){ret.innerMode=mode}return ret}});return target}var markupMode=[],macroMode=[];var blockRules=setupRules(markupMode,{hr:{fn:emptyFn},bulleted:{fn:function fn(match){return{depth:match[1].length,innerText:match[2]}}},numbered:{fn:function fn(match){return{depth:match[1].length/2,innerText:match[2]}}},heading:{fn:function fn(match){return{depth:match[1].length,innerText:match[2]}}},align:{fn:function fn(match){var align=undefined;var arrow=match[1],centerIndex=arrow.indexOf("><");if(~centerIndex){align=Math.round(centerIndex/(arrow.length-2)*50);if(align===25){align="center"}}else if(arrow[0]==="<"&&arrow.slice(-1)===">"){align="justify"}else if(arrow.indexOf(">")>-1){align="right"}else if(arrow.indexOf("<")>-1){align="left"}return{align:align}}}});Object.keys(blockRules).forEach(function(key){blockRules[key].canFollow=[null,"br","hr","bulleted","numbered","heading","align"];blockRules[key].cannotFollow=["text"]});var inlineRules=setupRules(markupMode,{twine1Macro:{fn:function fn(){return{type:"error",message:"Twine 2 macros use a different syntax to Twine 1 macros."}}},br:{fn:emptyFn},emBack:{fn:function fn(){return{matches:{emFront:"em"}}}},strongBack:{fn:function fn(){return{matches:{strongFront:"strong"}}}},strongFront:{fn:function fn(){return{isFront:true}}},emFront:{fn:function fn(){return{isFront:true}}},boldOpener:{fn:openerFn("boldOpener","bold")},italicOpener:{fn:openerFn("italicOpener","italic")},delOpener:{fn:openerFn("delOpener","del")},supOpener:{fn:openerFn("supOpener","sup")},commentFront:{fn:function fn(){return{isFront:true}}},commentBack:{fn:function fn(){return{matches:{commentFront:"comment"}}}},scriptStyleTag:{fn:emptyFn},tag:{fn:emptyFn},url:{fn:emptyFn},passageLink:{fn:function fn(match){var p1=match[1],p2=match[2],p3=match[3];return{type:"twineLink",innerText:p2?p3:p1,passage:p1?p3:p2}}},simpleLink:{fn:function fn(match){return{type:"twineLink",innerText:match[1],passage:match[1]}}},hookPrependedFront:{fn:function fn(match){return{name:match[1],isFront:true,tagPosition:"prepended"}}},hookAnonymousFront:{fn:function fn(){return{isFront:true,demote:function demote(){this.error("This tagged hook doesn't have a matching ].")}}},canFollow:["macro","variable"]},hookAppendedFront:{fn:function fn(){return{isFront:true}},cannotFollow:["macro","variable"]},hookBack:{fn:function fn(){return{type:"hookAppendedBack",matches:{hookPrependedFront:"hook",hookAnonymousFront:"hook"}}}},hookAppendedBack:{fn:function fn(match){return{name:match[1],tagPosition:"appended",matches:{hookAppendedFront:"hook"}}}},verbatimOpener:{fn:function fn(match){var number=match[0].length,matches={};matches["verbatim"+number]="verbatim";return{type:"verbatim"+number,isFront:true,matches:matches}}},collapsedFront:{fn:function fn(){return{isFront:true}}},collapsedBack:{fn:function fn(){return{matches:{collapsedFront:"collapsed"}}}},escapedLine:{fn:emptyFn},legacyLink:{fn:function fn(match){return{type:"twineLink",innerText:match[1],passage:match[2]}}}});var expressionRules=setupRules(macroMode,{macroFront:{fn:function fn(match){return{isFront:true,name:match[1]}}},groupingBack:{fn:function fn(){return{matches:{groupingFront:"grouping",macroFront:"macro"}}}},hookRef:{fn:textTokenFn("name")},variable:{fn:textTokenFn("name")},whitespace:{fn:emptyFn,cannotFollow:"text"}});var macroRules=setupRules(macroMode,Object.assign({macroName:{canFollow:["macroFront"],fn:function fn(match){if(match[2]){return{isMethodCall:true,innerText:match[2]}}return{isMethodCall:false}}},groupingFront:{fn:function fn(){return{isFront:true}}},property:{fn:textTokenFn("name"),canFollow:["variable","hookRef","property","itsProperty","belongingItProperty","macro","grouping","string","boolean","number"]},possessiveOperator:{fn:emptyFn},itsProperty:{fn:textTokenFn("name")},itsOperator:{fn:emptyFn},belongingItProperty:{cannotFollow:["text"],fn:textTokenFn("name")},belongingItOperator:{cannotFollow:["text"],fn:emptyFn},belongingProperty:{cannotFollow:["text"],fn:textTokenFn("name")},belongingOperator:{cannotFollow:["text"],fn:emptyFn},escapedStringChar:{fn:function fn(){return{type:"text"}}},singleStringOpener:{fn:function fn(){return{isFront:true,matches:{singleStringOpener:"string"}}}},doubleStringOpener:{fn:function fn(){return{isFront:true,matches:{doubleStringOpener:"string"}}}},cssTime:{fn:function fn(match){return{value:+match[1]*(match[2].toLowerCase()==="s"?1e3:1)}}},colour:{cannotFollow:["text"],fn:function fn(match){var colour,m=match[0].toLowerCase(),mapping={red:"e61919",orange:"e68019",yellow:"e5e619",lime:"80e619",green:"19e619",cyan:"19e5e6",aqua:"19e5e6",blue:"197fe6",navy:"1919e6",purple:"7f19e6",fuchsia:"e619e5",magenta:"e619e5",white:"fff",black:"000",gray:"888",grey:"888"};if(Object.hasOwnProperty.call(mapping,m)){colour="#"+mapping[m]}else{colour=m}return{colour:colour}}},number:{fn:function fn(match){return{value:parseFloat(match[0])}}},addition:{fn:emptyFn},subtraction:{fn:emptyFn},multiplication:{fn:emptyFn},division:{fn:emptyFn},inequality:{fn:function fn(match){return{operator:match[0]}}},augmentedAssign:{fn:function fn(match){return{operator:match[0][0]}}},identifier:{fn:textTokenFn("name")}},["boolean","is","to","into","and","or","not","isNot","contains","isIn"].reduce(function(a,e){a[e]={fn:emptyFn,cannotFollow:["text"]};return a},{}),["comma","spread","addition","subtraction","multiplication","division"].reduce(function(a,e){a[e]={fn:emptyFn};return a},{})));markupMode.push.apply(markupMode,_toConsumableArray(Object.keys(blockRules)).concat(_toConsumableArray(Object.keys(inlineRules)),_toConsumableArray(Object.keys(expressionRules))));macroMode.push.apply(macroMode,_toConsumableArray(Object.keys(expressionRules)).concat(_toConsumableArray(Object.keys(macroRules))));var allRules=Object.assign({},blockRules,inlineRules,expressionRules,macroRules);Object.keys(allRules).forEach(function(key){var re=Patterns[key];if(typeof re!=="string"){allRules[key].pattern=re}else{allRules[key].pattern=new RegExp("^(?:"+re+")","i")}if(Patterns[key+"Peek"]){allRules[key].peek=Patterns[key+"Peek"]}});Object.assign(Lexer.rules,allRules);Lexer.startMode=markupMode;return Lexer}function exporter(Lexer){var TwineMarkup=Object.freeze({lex:rules(Lexer).lex,Patterns:Patterns});return TwineMarkup}if((typeof module==="undefined"?"undefined":_typeof(module))==="object"){Patterns=require("patterns");module.exports=exporter(require("lexer"))}else if(typeof define==="function"&&define.amd){define("markup",["lexer","patterns"],function(Lexer,P){Patterns=P;return exporter(Lexer)})}else if(typeof StoryFormat==="function"&&this instanceof StoryFormat){Patterns=this.modules.Patterns;this.modules.Markup=exporter(this.modules.Lexer);this.lex=this.modules.Markup.lex}else{Patterns=this.Patterns;this.TwineMarkup=exporter(this.TwineLexer)}}).call(eval("this")||(typeof global!=="undefined"?global:window));define("utils/selectors",[],function(){"use strict";return Object.freeze({passage:"tw-passage",story:"tw-story",sidebar:"tw-sidebar",internalLink:"tw-link",brokenLink:"tw-broken-link",hook:"tw-hook",pseudoHook:"tw-pseudo-hook",enchantment:"tw-enchantment",expression:"tw-expression",enchanter:"[enchanter]",script:"[role=script]",stylesheet:"[role=stylesheet]",storyData:"tw-storydata",passageData:"tw-passagedata",whitespace:"tw-char[char=space], tw-char[char=tab], br",collapsed:"tw-collapsed"})});define("utils/customelements",[],function(){"use strict";if(!document.registerElement){return}var CustomElements={};(function register(name){var proto=Object.create(HTMLElement.prototype),propDef={};for(var _len=arguments.length,props=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){props[_key-1]=arguments[_key]}props.forEach(function(p){propDef[p]={value:null}});Object.defineProperties(proto,propDef);var el=document.registerElement(name,{prototype:proto});CustomElements[name]=el;return register})("tw-storydata","storyname","startnode","creator","creator-version","options")("tw-passagedata","name","pid","position")("tw-story")("tw-debugger")("tw-passage")("tw-link","passage-name")("tw-broken-link","passage-name")("tw-expression","type","name","js")("tw-sidebar")("tw-icon")("tw-align")("tw-collapsed")("tw-verbatim")("tw-hook","name","source")("tw-pseudo-hook")("tw-transition-container")("tw-error")("tw-error-explanation")("tw-error-explanation-button")("tw-notifier","message");return Object.freeze(CustomElements)});define("utils",["jquery","markup","utils/selectors","utils/customelements"],function(_$2,TwineMarkup,Selectors){"use strict";var lockDesc={configurable:0,writable:0},t8nAnimationTimes={"transition-in":Object.create(null),"transition-out":Object.create(null)},usuallyBlockElements=("audio,blockquote,canvas,div,h1,h2,h3,h4,h5,hr,ol,p,pre,table,ul,video,"+"tw-align,tw-story,tw-passage").split(","),usuallyInlineElements=("a,b,i,em,strong,sup,sub,abbr,acronym,s,strike,del,big,small,script,img,button,input,"+"tw-link,tw-broken-link,tw-verbatim,tw-collapsed,tw-error").split(","),nonDetachableElements=["audio"];var storyElement=undefined;var Utils={lockProperties:function lockProperties(obj){var keys=Object.keys(obj),propDesc={};for(var i=0;i<keys.length;i++){propDesc[keys[i]]=lockDesc}return Object.defineProperties(obj,propDesc)},lockProperty:function lockProperty(obj,prop,value){var propDesc=Object.create(lockDesc);value&&(propDesc.value=value);Object.defineProperty(obj,prop,propDesc);return obj},getInheritedPropertyDescriptor:function getInheritedPropertyDescriptor(obj,prop){while(obj&&!obj.hasOwnProperty(prop)){obj=Object.getPrototypeOf(obj)}return obj&&Object.getOwnPropertyDescriptor(obj,prop)||null},toJSLiteral:JSON.stringify,toTSStringLiteral:function toTSStringLiteral(str){var _Math;var consecutiveGraves=(_Math=Math).max.apply(_Math,_toConsumableArray((str.match(/(`+)/g)||[]).map(function(e){return e.length}).concat(0)))+1;return"`".repeat(consecutiveGraves)+str+"`".repeat(consecutiveGraves)},cssTimeUnit:function cssTimeUnit(s){if(typeof s==="string"){s=s.toLowerCase();if(s.slice(-2)==="ms")return+s.slice(0,-2)||0;if(s.slice(-1)==="s")return+s.slice(0,-1)*1e3||0}else if(Array.isArray(s)){var _ret=function(){var ret=[];s.forEach(function(e){var time=Utils.cssTimeUnit(e);time>0&&ret.push(time)});return{v:ret}}();if((typeof _ret==="undefined"?"undefined":_typeof(_ret))==="object")return _ret.v}return 0},nth:function nth(num){var lastDigit=(num+"").slice(-1);return num+(lastDigit==="1"?"st":lastDigit==="2"?"nd":lastDigit==="3"?"rd":"th")},plural:function plural(num,noun){return num+" "+noun+(num>1?"s":"")},unescape:function unescape(text){return text.replace(/&(?:amp|lt|gt|quot|nbsp|zwnj|#39|#96);/g,function(e){return{"&amp;":"&","&gt;":">","&lt;":"<","&quot;":'"',"&#39;":"'","&nbsp;":String.fromCharCode(160),"&zwnj;":String.fromCharCode(8204)}[e]})},escape:function escape(text){return text.replace(/[&><"']/g,function(e){return{"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#39;"}[e]})},insensitiveName:function insensitiveName(e){return(e+"").toLowerCase().replace(/-|_/g,"")},wrapHTMLTag:function wrapHTMLTag(text,tagName){return"<"+tagName+">"+text+"</"+tagName+">"},findAndFilter:function findAndFilter(q,selector){q=_$2(q||Utils.storyElement);return q.filter(selector).add(q.find(selector))},closestHookSpan:function closestHookSpan(elems){var ret=elems.closest(Selectors.hook+","+Selectors.pseudoHook);return ret.length?ret:elems},childrenProbablyInline:function childrenProbablyInline(jq){var unknown=[];return Array.prototype.every.call(jq.find("*"),function(elem){if(elem.hidden||/none|inline/.test(elem.style.display)){return true}if(usuallyBlockElements.indexOf(elem.tagName.toLowerCase())>-1||/none|inline/.test(elem.style.display)){return false}if(usuallyInlineElements.indexOf(elem.tagName.toLowerCase())>-1){return true}unknown.push(elem);return true})&&unknown.every(function(elem){return/none|inline/.test(elem.style.display)})},transitionReplace:function transitionReplace(oldElem,newElem,transIndex){oldElem=Utils.closestHookSpan(oldElem);var container1=_$2("<tw-transition-container>").css("position","relative");container1.insertBefore(oldElem.first());var container2a=undefined;if(newElem){container2a=_$2("<tw-transition-container>").appendTo(container1);newElem.appendTo(container2a)}var container2b=_$2("<tw-transition-container>").css("position","absolute").prependTo(container1);oldElem.detach().appendTo(container2b);Utils.transitionOut(container2b,transIndex);if(newElem){Utils.transitionIn(container2a,transIndex,function(){container2a.unwrap().children().first().unwrap()})}},transitionOut:function transitionOut(el,transIndex){var childrenInline=Utils.childrenProbablyInline(el),mustWrap=el.length>1||!childrenInline||["tw-hook","tw-passage"].indexOf(el.tag())===-1;function onComplete(){el.remove()}if(mustWrap){el=el.wrapAll("<tw-transition-container>").parent()}el.attr("data-t8n",transIndex).addClass("transition-out");if(Utils.childrenProbablyInline(el)){el.css("display","inline-block")}var delay=Utils.transitionTime(transIndex,"transition-out");!delay?onComplete():window.setTimeout(onComplete,delay)},transitionIn:function transitionIn(el,transIndex){var childrenInline=Utils.childrenProbablyInline(el),mustWrap=el.length>1||!childrenInline||["tw-hook","tw-passage"].indexOf(el.tag())===-1;function onComplete(){var detachable=Utils.findAndFilter(el,nonDetachableElements.join(",")).length===0;if(mustWrap&&detachable){el.contents().unwrap()}else{el.removeClass("transition-in").removeAttr("data-t8n")}}if(mustWrap){el=el.wrapAll("<tw-transition-container>").parent()}el.attr("data-t8n",transIndex).addClass("transition-in");if(Utils.childrenProbablyInline(el)){el.css("display","inline-block")}var delay=Utils.transitionTime(transIndex,"transition-in");!delay?onComplete():window.setTimeout(onComplete,delay)},transitionTime:function transitionTime(transIndex,className){var animClass=t8nAnimationTimes[className];if(!animClass[transIndex]){var p=_$2("<p>").appendTo(document.body).attr("data-t8n",transIndex).addClass(className);animClass[transIndex]=Utils.cssTimeUnit(p.css("animation-duration"))+Utils.cssTimeUnit(p.css("animation-delay"));p.remove()}return animClass[transIndex]},$:function $(str,context){return _$2(str,context||Utils.storyElement).not(".transition-out, .transition-out *")},log:function log(data){if(!window.console){return}console.log(data)},impossible:function impossible(where,data){if(!window.console){return}console.error(where+"(): "+data)},assert:function assert(assertion){if(!window.console){return}if(!assertion){console.error("Assertion failed!")}},assertMustHave:function assertMustHave(object,props){if(!window.console){return}for(var i=0;i<props.length;i+=1){if(!(props[i]in object)){console.error("Assertion failed: "+object+" lacks property "+props[i])}}},assertOnlyHas:function assertOnlyHas(object,props){if(!window.console){return}for(var i in object){if(props.indexOf(i)===-1){console.error("Assertion failed: "+object+" had unexpected property '"+i+"'!")}}},get storyElement(){return storyElement}};_$2(function(){return storyElement=_$2(Selectors.story)});return Object.freeze(Utils)});define("twinescript/compiler",["utils"],function(_ref){"use strict";var toJSLiteral=_ref.toJSLiteral;var assert=_ref.assert;function indexOfType(array){for(var _len2=arguments.length,types=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){types[_key2-1]=arguments[_key2]}for(var i=0;i<array.length;i+=1){if(types.indexOf(array[i].type)>-1){return i}}return NaN}function rightAssociativeIndexOfType(array){for(var _len3=arguments.length,types=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){types[_key3-1]=arguments[_key3]}return array.length-1-indexOfType.apply(undefined,[[].concat(_toConsumableArray(array)).reverse()].concat(types))}function compile(tokens,isVarRef){if(!tokens){return""}tokens=[].concat(tokens);var token=tokens[0];if(tokens.length===1){if(token.type==="identifier"){if(isVarRef){return"TwineError.create('keyword','I can\\'t use \\'"+token.text+"\\' in this position.') "}return" Operations.Identifiers."+token.text.toLowerCase()+" "}else if(token.type==="variable"){return"VarRef.create(State.variables,"+toJSLiteral(token.name)+")"+(isVarRef?"":".get()")}else if(token.type==="hookRef"){if(isVarRef){return"VarRef.create(section.selectHook('?"+token.name+"'), 'TwineScript_Assignee')"}return" section.selectHook('?"+token.name+"') "}else if(token.type==="string"){return token.text.replace(/\n/g,"\\n")}else if(token.type==="colour"){return"Colour.create("+toJSLiteral(token.colour)+")"}else if(token.type==="root"){return compile(token.children)}}var i=undefined,macroNameToken=undefined,left=undefined,right=undefined,midString=undefined,operation=undefined,assignment=undefined,possessive=undefined,needsLeft=true,needsRight=true,implicitLeftIt=false;if((i=indexOfType(tokens,"comma"))>-1){midString=",";needsRight=false}else if((i=indexOfType(tokens,"spread"))>-1){midString="Operations.makeSpreader(";right=compile(tokens.splice(i+1))+")";needsLeft=false}else if((i=indexOfType(tokens,"to"))>-1){assignment="to";left="Operations.setIt("+compile(tokens.slice(0,i),"varRef")+")"}else if((i=indexOfType(tokens,"into"))>-1){assignment="into";right=compile(tokens.slice(0,i),"varRef");left="Operations.setIt("+compile(tokens.slice(i+1),"varRef")+")"}else if((i=indexOfType(tokens,"augmentedAssign"))>-1){assignment=tokens[i].operator;left=compile(tokens.slice(0,i),"varRef");right="Operations['"+assignment+"']("+(compile(tokens.slice(0,i))+","+compile(tokens.splice(i+1)))+")"}else if((i=indexOfType(tokens,"and","or"))>-1){operation=tokens[i].type}else if((i=indexOfType(tokens,"is","isNot"))>-1){implicitLeftIt=true;operation=tokens[i].type}else if((i=indexOfType(tokens,"contains","isIn"))>-1){implicitLeftIt=true;operation=tokens[i].type}else if((i=indexOfType(tokens,"inequality"))>-1){implicitLeftIt=true;operation=tokens[i].operator}else if((i=indexOfType(tokens,"addition","subtraction"))>-1){operation=tokens[i].text;left=compile(tokens.slice(0,i));if(!left.trim()){left="0"}}else if((i=indexOfType(tokens,"multiplication","division"))>-1){operation=tokens[i].text}else if((i=indexOfType(tokens,"not"))>-1){midString="Operations.not(";right=compile(tokens.splice(i+1))+")";needsLeft=false}else if((i=indexOfType(tokens,"belongingProperty"))>-1){right="VarRef.create("+compile(tokens.slice(i+1),"varref")+","+toJSLiteral(tokens[i].name)+")"+(isVarRef?"":".get()");midString=" ";needsLeft=needsRight=false}else if((i=indexOfType(tokens,"belongingOperator","belongingItOperator"))>-1){if(tokens[i].type.includes("It")){right="Operations.Identifiers.it";needsRight=false}possessive="belonging"}else if((i=rightAssociativeIndexOfType(tokens,"property"))>-1){left="VarRef.create("+compile(tokens.slice(0,i),"varref")+","+toJSLiteral(tokens[i].name)+")"+(isVarRef?"":".get()");midString=" ";needsLeft=needsRight=false}else if((i=rightAssociativeIndexOfType(tokens,"itsProperty"))>-1||(i=indexOfType(tokens,"belongingItProperty"))>-1){left="VarRef.create(Operations.Identifiers.it,"+toJSLiteral(tokens[i].name)+").get()";midString=" ";needsLeft=needsRight=false}else if((i=rightAssociativeIndexOfType(tokens,"possessiveOperator","itsOperator"))>-1){if(tokens[i].type.includes("it")){left="Operations.Identifiers.it";needsLeft=false}possessive="possessive"}else if((i=indexOfType(tokens,"macro"))>-1){macroNameToken=tokens[i].children[0];assert(macroNameToken.type==="macroName");midString="Macros.run("+(macroNameToken.isMethodCall?compile(macroNameToken.children):'"'+tokens[i].name+'"')+", ["+"section,"+compile(tokens[i].children.slice(1))+"])";needsLeft=needsRight=false}else if((i=indexOfType(tokens,"grouping"))>-1){midString="("+compile(tokens[i].children,isVarRef)+")";needsLeft=needsRight=false}if(i>-1){left=left||compile(tokens.slice(0,i),isVarRef).trim();right=right||compile(tokens.splice(i+1)).trim();if(implicitLeftIt&&!left){left=" Operations.Identifiers.it "}if(needsLeft&&!left||needsRight&&!right){return"TwineError.create('operation','I need some code to be "+(needsLeft?"left ":"")+(needsLeft&&needsRight?"and ":"")+(needsRight?"right ":"")+"of "+'"'+tokens[i].text+'"'+"')"}if(midString){return left+midString+right}else if(assignment){return"Operations.makeAssignmentRequest("+[left,right,toJSLiteral(assignment)]+")"}else if(possessive){return"VarRef.create("+(possessive==="belonging"?right:left)+",{computed:true,value:"+(possessive==="belonging"?left:right)+"})"+(isVarRef?"":".get()")}else if(operation){return" Operations["+toJSLiteral(operation)+"]("+left+","+right+") "}}else if(tokens.length===1){return((token.value||token.text)+"").trim()||" "}else{return tokens.reduce(function(a,token){return a+compile(token,isVarRef)},"")}return""}return compile});define("internaltypes/twineerror",["jquery","utils"],function($,_ref2){"use strict";var impossible=_ref2.impossible;var assert=_ref2.assert;var escape=_ref2.escape;var errorExplanations={syntax:"The markup seems to contain a mistake.",saving:"I tried to save or load the game, but I couldn't do it.",operation:"I tried to use an operation on some data, but the data's type was incorrect.",macrocall:"I tried to use a macro, but its call wasn't written correctly.",datatype:"I tried to use a macro, but was given the wrong type of data to it.",keyword:"I was given a keyword in a way that I didn't understand.",changer:"This is a command to change a hook, but it isn't being used correctly.",infinite:"I almost ended up doing the same thing over and over, forever.",property:"I tried to access a value in a string/array/datamap, but I couldn't find it.",unimplemented:"I currently don't have this particular feature. I'm sorry.",javascript:"This error message was reported by your browser's Javascript engine. "+"I don't understand it either, but it usually means that an expression was badly written."},TwineError={create:function create(type,message,explanation){if(!message){impossible("TwineError.create","called with only 1 string.")}assert(explanation||type in errorExplanations);return Object.assign(Object.create(this),{type:type,message:message,explanation:explanation})},fromError:function fromError(error){return TwineError.create("javascript","☕ "+error.message)},containsError:function containsError(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}return args.reduce(function(last,e){return last?last:e instanceof Error?e:TwineError.isPrototypeOf(e)?e:Array.isArray(e)?TwineError.containsError.apply(TwineError,_toConsumableArray(e)):false},false)},createWarning:function createWarning(type,message){return Object.assign(this.create(type,message),{warning:true})},render:function render(titleText){titleText=titleText||"";var errorElement=$("<tw-error class='"+(this.type==="javascript"?"javascript ":"")+(this.warning?"warning":"error")+"' title='"+escape(titleText)+"'>"+escape(this.message)+"</tw-error>"),explanationElement=$("<tw-error-explanation>").text(this.explanation||errorExplanations[this.type]).hide(),explanationButton=$("<tw-error-explanation-button tabindex=0>").html("<span class='folddown-arrowhead'>&#9658;</span>");explanationButton.on("click",function(){explanationElement.toggle();explanationButton.children(".folddown-arrowhead").css("transform","rotate("+(explanationElement.is(":visible")?"90deg":"0deg")+")")});errorElement.append(explanationButton).append(explanationElement);return errorElement}};return TwineError});define("renderer",["utils","markup","twinescript/compiler","internaltypes/twineerror"],function(_ref3,TwineMarkup,Compiler,TwineError){"use strict";var wrapHTMLTag=_ref3.wrapHTMLTag;var escape=_ref3.escape;var impossible=_ref3.impossible;var toJSLiteral=_ref3.toJSLiteral;var Renderer=undefined;function renderTag(token,tagName){var contents=Renderer.render(token.children);return contents&&wrapHTMLTag(contents,tagName)}var center="text-align: center; max-width:50%; ";Renderer={options:{},exec:function(){var cachedInput=undefined,cachedOutput=undefined;return function(src){if(typeof src!=="string"){impossible("Renderer.exec","source was not a string, but "+(typeof src==="undefined"?"undefined":_typeof(src)));return""}if(src===cachedInput){return cachedOutput}cachedInput=src;cachedOutput=Renderer.render(TwineMarkup.lex(src).children);return cachedOutput}}(),render:function render(tokens){var out="";if(!tokens){return out}var len=tokens.length;for(var i=0;i<len;i+=1){var token=tokens[i];switch(token.type){case"error":{out+=TwineError.create("syntax",token.message).render(escape(token.text))[0].outerHTML;break}case"numbered":case"bulleted":{var tagName=token.type==="numbered"?"ol":"ul";out+="<"+tagName+">";var depth=1;while(i<len&&tokens[i]&&tokens[i].type===token.type){out+=("<"+tagName+">").repeat(Math.max(0,tokens[i].depth-depth));out+=("</"+tagName+">").repeat(Math.max(0,depth-tokens[i].depth));depth=tokens[i].depth;out+=renderTag(tokens[i],"li");i+=1}i-=1;out+=("</"+tagName+">").repeat(depth+1);break}case"align":{while(token&&token.type==="align"){var style="";var body="";var align=token.align;var j=i+=1;if(align==="left"){break}while(i<len&&tokens[i]&&tokens[i].type!=="align"){i+=1}body+=render(tokens.slice(j,i));switch(align){case"center":style+=center+"margin-left: auto; margin-right: auto;";break;case"justify":case"right":style+="text-align: "+align+";";break;default:if(+align){style+=center+"margin-left: "+align+"%;"}}out+="<tw-align "+(style?'style="'+style+'"':"")+(Renderer.options.debug?' title="'+token.text+'"':"")+">"+body+"</tw-align>\n";token=tokens[i]}break}case"heading":{out+=renderTag(token,"h"+token.depth);break}case"br":case"hr":{out+="<"+token.type+">";break}case"escapedLine":case"comment":{break}case"inlineUrl":{out+='<a class="link" href="'+escape(token.text)+'">'+token.text+"</a>";break}case"scriptStyleTag":case"tag":{out+=token.text.startsWith("</")?token.text:token.text.replace(/>$/," data-raw>");break}case"sub":case"sup":case"del":case"strong":case"em":{out+=renderTag(token,token.type);break}case"bold":{out+=renderTag(token,"b");break}case"italic":{out+=renderTag(token,"i");break}case"twineLink":{var newTwineLinkToken=TwineMarkup.lex("(link-goto:"+toJSLiteral(token.innerText)+","+toJSLiteral(token.passage)+")");out+=render(newTwineLinkToken.children);break}case"hook":{out+="<tw-hook "+(token.name?'name="'+token.name+'"':"")+(Renderer.options.debug&&token.name?' title="Hook: ?'+token.name+'"':"")+' source="'+escape(token.innerText)+'">'+"</tw-hook>";break}case"verbatim":{out+=wrapHTMLTag(escape(token.innerText).replace(/\n/g,"<br>"),"tw-verbatim");break}case"collapsed":{out+=renderTag(token,"tw-collapsed");break}case"hookRef":case"variable":case"macro":{out+='<tw-expression type="'+token.type+'" name="'+escape(token.name||token.text)+'"'+(Renderer.options.debug?' title="'+escape(token.text)+'"':"")+' js="'+escape(Compiler(token))+'">'+"</tw-expression>";break}default:{out+=token.children&&token.children.length?render(token.children):token.text;break}}}return out}};return Object.freeze(Renderer)});define("passages",["jquery","utils","utils/selectors"],function($,_ref4,Selectors){"use strict";var unescape=_ref4.unescape;function Passage(elem){return Object.assign(new Map([["source",unescape(elem.html())],["tags",(elem.attr("tags")||"").split(/\s/)],["name",elem.attr("name")]]),{TwineScript_TypeName:"passage datamap",TwineScript_ObjectName:"a passage datamap"})}var Passages=Object.assign(new Map,{TwineScript_ObjectName:"the Passages datamap",getTagged:function getTagged(tag){var ret=[];this.forEach(function(v){var tags=v instanceof Map&&v.get("tags");if(Array.isArray(tags)&&tags.indexOf(tag)>-1){ret.push(v)}});return ret.sort(function(left,right){return left.get("name")>right.get("name")})},create:Passage});$(function(){Array.from($(Selectors.storyData+" > "+Selectors.passageData)).forEach(function(e){e=$(e);Passages.set(e.attr("name"),new Passage(e))})});return Passages});define("state",["utils","passages"],function(_ref5,Passages){"use strict";var impossible=_ref5.impossible;var SystemVariables={TwineScript_ObjectName:"this story's variables",TwineScript_Writeproof:[]};var Moment={passage:"",variables:SystemVariables,create:function create(p,v){var ret=Object.create(Moment);ret.passage=p||"";ret.variables=Object.assign(Object.create(this.variables),v);return ret}};var timeline=[];var recent=-1;var present=Moment.create();var serialisable=true;var State=Object.assign({get passage(){return present.passage},get variables(){return present.variables},get pastLength(){return recent},get futureLength(){return timeline.length-1-recent},passageNameVisited:function passageNameVisited(name){var ret=0;if(!Passages.get(name)){return 0}for(var i=0;i<=recent;i++){ret+=+(name===timeline[i].passage);
  131.  
  132. }return ret},passageNameLastVisited:function passageNameLastVisited(name){if(!Passages.get(name)){return Infinity}if(name===present.passage){return 0}for(var i=recent;i>0;i--){if(timeline[i].passage===name){return recent-i+1}}return Infinity},pastPassageNames:function pastPassageNames(){var ret=[];for(var i=recent-1;i>=0;i--){ret.unshift(timeline[i].passage)}return ret},newPresent:function newPresent(newPassageName){present=(timeline[recent]||Moment).create(newPassageName)},play:function play(newPassageName){if(!present){impossible("State.play","present is undefined!")}present.passage=newPassageName;timeline=timeline.slice(0,recent+1).concat(present);recent+=1;this.newPresent(newPassageName)},rewind:function rewind(arg){var steps=1,moved=false;if(arg){if(typeof arg==="string"){steps=this.passageNameLastVisited(arg);if(steps===Infinity){return}}else if(typeof arg==="number"){steps=arg}}for(;steps>0&&recent>0;steps--){moved=true;recent-=1}if(moved){this.newPresent(timeline[recent].passage)}return moved},fastForward:function fastForward(arg){var steps=1,moved=false;if(typeof arg==="number"){steps=arg}for(;steps>0&&timeline.length>0;steps--){moved=true;recent+=1}if(moved){this.newPresent(timeline[recent].passage)}return moved},reset:function reset(){timeline=[];recent=-1;present=Moment.create();serialisable=true}},function(){function isSerialisable(variable){return typeof variable==="number"||typeof variable==="boolean"||typeof variable==="string"||variable===null||Array.isArray(variable)&&variable.every(isSerialisable)||variable instanceof Set&&Array.from(variable).every(isSerialisable)||variable instanceof Map&&Array.from(variable.values()).every(isSerialisable)}function replacer(name,variable){if(variable instanceof Set){return{"(dataset:)":Array.from(variable)}}if(variable instanceof Map){return{"(datamap:)":Array.from(variable)}}return variable}function reviver(name,variable){if(Object.prototype.isPrototypeOf(variable)){if(Array.isArray(variable["(dataset:)"])){return new Set(variable["(dataset:)"])}if(Array.isArray(variable["(datamap:)"])){return new Map(variable["(datamap:)"])}}return variable}function serialise(){var ret=timeline.slice(0,recent+1);serialisable=serialisable&&ret.every(function(moment){return Object.keys(moment.variables).every(function(e){return isSerialisable(moment.variables[e])})});if(!serialisable){return false}try{return JSON.stringify(ret,replacer)}catch(e){return false}}function deserialise(str){var newTimeline=undefined,lastVariables=SystemVariables;try{newTimeline=JSON.parse(str,reviver)}catch(e){return false}if(!Array.isArray(newTimeline)){return false}if((newTimeline=newTimeline.map(function(moment){if((typeof moment==="undefined"?"undefined":_typeof(moment))!=="object"||!moment.hasOwnProperty("passage")||!moment.hasOwnProperty("variables")){return false}moment.variables=Object.assign(Object.create(lastVariables),moment.variables);lastVariables=moment.variables;return Object.assign(Object.create(Moment),moment)})).indexOf(false)>-1){return false}timeline=newTimeline;recent=timeline.length-1;this.newPresent(timeline[recent].passage)}return{serialise:serialise,deserialise:deserialise}}());Object.seal(Moment);return Object.freeze(State)});define("utils/operationutils",["utils","internaltypes/twineerror"],function(_ref6,TwineError){"use strict";var assert=_ref6.assert;var impossible=_ref6.impossible;var toJSLiteral=_ref6.toJSLiteral;function isObject(value){return!!value&&((typeof value==="undefined"?"undefined":_typeof(value))==="object"||typeof value==="function")}function collectionType(value){return Array.isArray(value)?"array":value instanceof Map?"datamap":value instanceof Set?"dataset":value&&(typeof value==="undefined"?"undefined":_typeof(value))==="object"?"object":""}function isValidDatamapName(map,name){assert(map instanceof Map);if(typeof name!=="string"&&typeof name!=="number"){return TwineError.create("property","Only strings and numbers can be used as data names for "+objectName(map)+", not "+objectName(name)+".")}var otherName=typeof name==="string"?+name:""+name;if(!Number.isNaN(otherName)&&map.has(otherName)){return TwineError.create("property","You mustn't use both "+objectName(name)+" and "+objectName(otherName)+" as data names in the same datamap.")}return true}function isSequential(value){return typeof value==="string"||Array.isArray(value)}function clone(value){if(!isObject(value)){return value}if(typeof value.TwineScript_Clone==="function"){return value.TwineScript_Clone()}if(Array.isArray(value)){return[].concat(_toConsumableArray(value))}if(value instanceof Map){return Object.assign(new Map(value),value)}if(value instanceof Set){return Object.assign(new Set(value),value)}if(typeof value==="function"){return Object.assign(value.bind(),value)}switch(Object.getPrototypeOf(value)){case Object.prototype:return Object.assign({},value);case null:return Object.assign(Object.create(null),value)}impossible("OperationUtils.clone","The value "+(value.toSource?value.toSource():value)+" cannot be cloned!");return value}function coerceToString(fn,left,right){if(typeof left==="string"&&isObject(right)&&"TwineScript_ToString"in right){return fn(left,right.TwineScript_ToString())}if(typeof right==="string"&&isObject(left)&&"TwineScript_ToString"in left){return fn(left.TwineScript_ToString(),right)}return false}function objectName(obj){return isObject(obj)&&"TwineScript_ObjectName"in obj?obj.TwineScript_ObjectName:Array.isArray(obj)?"an array":obj instanceof Map?"a datamap":obj instanceof Set?"a dataset":typeof obj==="boolean"?"the logic value '"+obj+"'":typeof obj==="string"||typeof obj==="number"?"the "+(typeof obj==="undefined"?"undefined":_typeof(obj))+" "+toJSLiteral(obj):obj===undefined?"an empty variable":"...whatever this is"}function typeName(obj){if(obj.innerType){if(obj.pattern==="either"){assert(Array.isArray(obj.innerType));return obj.innerType.map(typeName).join(" or ")}else if(obj.pattern==="optional"){return"(an optional) "+typeName(obj.innerType)}return typeName(obj.innerType)}return obj===String||obj===Number||obj===Boolean?"a "+_typeof(obj()):obj===Map?"a datamap":obj===Set?"a dataset":obj===Array?"an array":isObject(obj)&&"TwineScript_TypeName"in obj?obj.TwineScript_TypeName:objectName(obj)}function is(l,r){if((typeof l==="undefined"?"undefined":_typeof(l))!=="object"&&(typeof r==="undefined"?"undefined":_typeof(r))!=="object"){return l===r}if(Array.isArray(l)&&Array.isArray(r)){if(l.length!==r.length){return false}return l.every(function(element,index){return is(r[index],element)})}if(l instanceof Map&&r instanceof Map){return is(Array.from(l.entries()).sort(),Array.from(r.entries()).sort())}if(l instanceof Set&&r instanceof Set){return is(Array.from(l.values()),Array.from(r.values()))}if(l&&typeof l.TwineScript_is==="function"){return l.TwineScript_is(r)}if(l&&(typeof l==="undefined"?"undefined":_typeof(l))==="object"&&r&&(typeof r==="undefined"?"undefined":_typeof(r))==="object"&&Object.getPrototypeOf(l)===Object.prototype&&Object.getPrototypeOf(r)===Object.prototype){return is(Object.getOwnPropertyNames(l).map(function(name){return[name,l[name]]}),Object.getOwnPropertyNames(r).map(function(name){return[name,r[name]]}))}return Object.is(l,r)}function contains(container,obj){if(container){if(typeof container==="string"){return container.indexOf(obj)>-1}if(Array.isArray(container)){return container.some(function(e){return is(e,obj)})}if(container instanceof Set||container instanceof Map){return Array.from(container.keys()).some(function(e){return is(e,obj)})}}return is(container,obj)}function subset(sequence,a,b){if(!a||!b){return TwineError.create("macrocall","The sub"+collectionType(sequence)+" index values must not be 0 or NaN.")}if(a<0){a=sequence.length+a+1}if(b<0){b=sequence.length+b+1}if(a>b){return subset(sequence,b,a)}var isString=typeof sequence==="string";if(isString){sequence=Array.from(sequence)}var ret=sequence.slice(a>0?a-1:a,b);if(isString){return ret.join("")}return ret}var OperationUtils=Object.freeze({isObject:isObject,isValidDatamapName:isValidDatamapName,collectionType:collectionType,isSequential:isSequential,clone:clone,coerceToString:coerceToString,objectName:objectName,typeName:typeName,is:is,contains:contains,subset:subset,numericIndex:/^(?:[1-9]\d*|0)$/});return OperationUtils});define("macros",["jquery","utils","utils/operationutils","internaltypes/twineerror"],function($,_ref7,_ref8,TwineError){"use strict";var insensitiveName=_ref7.insensitiveName;var nth=_ref7.nth;var plural=_ref7.plural;var assert=_ref7.assert;var lockProperty=_ref7.lockProperty;var objectName=_ref8.objectName;var typeName=_ref8.typeName;var Macros=undefined;var macroRegistry={},commandRegistry={};function readArguments(fn){return function(args){args=args.reduce(function(newArgs,el){if(el&&el.spreader===true){if(Array.isArray(el.value)||typeof el.value==="string"){for(var i=0;i<el.value.length;i++){newArgs.push(el.value[i])}}else if(el.value instanceof Set){el.value.forEach(function(item){return newArgs.push(item)})}else{newArgs.push(TwineError.create("operation","I can't spread out "+objectName(el.value)+", which is not a string, dataset or array."))}}else{newArgs.push(el)}return newArgs},[]);var error=TwineError.containsError(args);if(error){return error}return fn.apply(undefined,_toConsumableArray(args))}}function singleTypeCheck(arg,type){if(type===null){return arg===undefined}if(type.innerType){if(type.pattern==="optional"||type.pattern==="zero or more"){if(arg===undefined){return true}return singleTypeCheck(arg,type.innerType)}if(type.pattern==="either"){return type.innerType.some(function(type){return singleTypeCheck(arg,type)})}if(type.pattern==="wrapped"){return singleTypeCheck(arg,type.innerType)}}if(type!==undefined&&arg===undefined){return false}if(type===Macros.TypeSignature.Any&&arg!==undefined&&!arg.TwineScript_Unobservable){return true}if(type===String){return typeof arg==="string"}if(type===Boolean){return typeof arg==="boolean"}if(type===Number){return typeof arg==="number"}if(type===Array){return Array.isArray(arg)}if(type===Map||type===Set){return arg instanceof type}return Object.isPrototypeOf.call(type,arg)}function typeSignatureCheck(name,fn,typeSignature){if(!typeSignature){return fn}typeSignature=[].concat(typeSignature);name="("+(Array.isArray(name)&&name.length>1?name[0]:name)+":)";var signatureInfo=undefined;if(typeSignature.length>0){signatureInfo="The "+name+" macro must only be given "+typeSignature.map(typeName).reduce(function(a,e,i,arr){return a+(i===0?"":i<arr.length-1?", ":", and ")+e},"")+(typeSignature.length>1?", in that order":".")}else{signatureInfo="The macro must not be given any data - just write "+name+"."}return function(section){for(var _len5=arguments.length,args=Array(_len5>1?_len5-1:0),_key5=1;_key5<_len5;_key5++){args[_key5-1]=arguments[_key5]}var rest=undefined;for(var ind=0,end=Math.max(args.length,typeSignature.length);ind<end;ind+=1){var type=typeSignature[ind];var arg=args[ind];if(ind>=typeSignature.length&&!rest){return TwineError.create("typesignature",args.length-typeSignature.length+" too many values were given to this "+name+" macro.",signatureInfo)}type||(type=rest);if(type.innerType&&(type.pattern==="rest"||type.pattern==="zero or more")){rest=type.innerType;if(type.pattern==="rest"){type=type.innerType}}if(!singleTypeCheck(arg,type)){if(arg===undefined){return TwineError.create("typesignature","The "+name+" macro needs "+plural(typeSignature.length-ind,"more value")+".",signatureInfo)}if(arg&&arg.TwineScript_Unobservable&&type===Macros.TypeSignature.Any){return TwineError.create("typesignature",name+"'s "+nth(ind+1)+" value is not valid data for this macro.",signatureInfo)}return TwineError.create("typesignature",name+"'s "+nth(ind+1)+" value is "+objectName(arg)+", but should be "+typeName(type)+".",type.message||signatureInfo)}}return fn.apply(undefined,[section].concat(args))}}function privateAdd(name,type,fn){if(Array.isArray(name)){name.forEach(function(n){return lockProperty(macroRegistry,insensitiveName(n),fn)})}else{lockProperty(macroRegistry,insensitiveName(name),fn)}}Macros={has:function has(e){e=insensitiveName(e);return macroRegistry.hasOwnProperty(e)},get:function get(e){e=insensitiveName(e);return macroRegistry.hasOwnProperty(e)&&macroRegistry[e]},add:function add(name,fn,typeSignature){privateAdd(name,"value",readArguments(typeSignatureCheck(name,fn,typeSignature)));return add},addChanger:function addChanger(name,fn,changerCommandFn,typeSignature){assert(changerCommandFn);privateAdd(name,"changer",readArguments(typeSignatureCheck(name,fn,typeSignature)));commandRegistry[Array.isArray(name)?name[0]:name]=changerCommandFn;return addChanger},getChangerFn:function getChangerFn(name){return commandRegistry[name]},TypeSignature:{optional:function optional(type){return{pattern:"optional",innerType:type}},zeroOrMore:function zeroOrMore(type){return{pattern:"zero or more",innerType:type}},either:function either(){for(var _len6=arguments.length,innerType=Array(_len6),_key6=0;_key6<_len6;_key6++){innerType[_key6]=arguments[_key6]}return{pattern:"either",innerType:innerType}},rest:function rest(type){return{pattern:"rest",innerType:type}},wrapped:function wrapped(innerType,message){return{pattern:"wrapped",innerType:innerType,message:message}},Any:{TwineScript_TypeName:"anything"}},run:function run(name,args){if(TwineError.containsError(name)){return name}if(!Macros.has(name)){return TwineError.create("macrocall","I can't run the macro '"+name+"' because it doesn't exist.")}return Macros.get(name)(args)}};return Object.freeze(Macros)});define("datatypes/colour",["utils","jquery"],function(_ref9,$){"use strict";var assert=_ref9.assert;var singleDigit=/^([\da-fA-F])$/,tripleDigit=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,sextupleDigit=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,cssNameCache=Object.create(null);function css3ToRGB(colourName){if(colourName in cssNameCache){return cssNameCache[colourName]}var colour=$("<p>").css("background-color",colourName).css("background-color");if(!colour.startsWith("rgb")){colour={r:192,g:192,b:192}}else{colour=colour.match(/\d+/g).reduce(function(colour,num,ind){colour["rgb"[ind]]=+num;return colour},{})}cssNameCache[colourName]=colour;return colour}function hexToRGB(str){if(typeof str!=="string"){return str}str=str.replace("#","");str=str.replace(tripleDigit,"$1$1$2$2$3$3");return{r:parseInt(str.slice(0,2),16),g:parseInt(str.slice(2,4),16),b:parseInt(str.slice(4,6),16)}}var Colour=Object.freeze({colour:true,TwineScript_TypeName:"a colour",TwineScript_ObjectName:"a colour","TwineScript_+":function TwineScript_(other){var l=this,r=other;return Colour.create({r:Math.min(Math.round((l.r+r.r)*.6),255),g:Math.min(Math.round((l.g+r.g)*.6),255),b:Math.min(Math.round((l.b+r.b)*.6),255)})},TwineScript_Print:function TwineScript_Print(){return"<tw-colour style='background-color:rgb("+[this.r,this.g,this.b].join(",")+");'></span>"},TwineScript_is:function TwineScript_is(other){return Colour.isPrototypeOf(other)&&other.r===this.r&&other.g===this.g&&other.b===this.b},TwineScript_Clone:function TwineScript_Clone(){return Colour.create(this)},toHexString:function toHexString(){assert(this!==Colour);return"#"+this.r.toString(16).replace(singleDigit,"0$1")+this.g.toString(16).replace(singleDigit,"0$1")+this.b.toString(16).replace(singleDigit,"0$1")},create:function create(rgbObj){if(typeof rgbObj==="string"){if(Colour.isHexString(rgbObj)){return this.create(hexToRGB(rgbObj))}return this.create(css3ToRGB(rgbObj))}return Object.assign(Object.create(this),rgbObj)},isHexString:function isHexString(str){return typeof str==="string"&&str[0]==="#"&&(str.slice(1).match(tripleDigit)||str.slice(1).match(sextupleDigit))}});return Colour});define("utils/hookutils",["jquery","utils/selectors"],function($,Selectors){"use strict";function sliceNode(node,start,end){var l=node.textContent.length;if(start>=l){return}var newNode=undefined;var ret=[newNode=start===0?node:node.splitText(start)];if(end){if(end<=0){end=l-end}if(end<l){ret.push(newNode.splitText(end-start))}}return ret}function findTextInNodes(textNodes,searchString){var examinedNodes=[],examinedText="",ret=[];if(!textNodes.length||!searchString){return ret}while(textNodes.length>0){examinedNodes.push(textNodes[0]);examinedText+=textNodes[0].textContent;textNodes.shift();var index=examinedText.indexOf(searchString);if(index>-1){var _ret2;var remainingLength=examinedText.length-(index+searchString.length);while(index>=examinedNodes[0].textContent.length){index-=examinedNodes[0].textContent.length;examinedNodes.shift()}if(examinedNodes.length===1){var _slices=sliceNode(examinedNodes[0],index,index+searchString.length);ret.push(_slices[0]);if(_slices[1]){textNodes.unshift(_slices[1])}break}ret.push(sliceNode(examinedNodes[0],index,examinedNodes[0].length)[0]);(_ret2=ret).push.apply(_ret2,_toConsumableArray(examinedNodes.slice(1,-1)));var slices=sliceNode(examinedNodes[examinedNodes.length-1],0,examinedNodes[examinedNodes.length-1].textContent.length-remainingLength);ret.push(slices[0]);if(slices[1]){textNodes.unshift(slices[1])}ret=ret.filter(Boolean);break}}return[ret].concat(_toConsumableArray(findTextInNodes(textNodes,searchString)))}var HookUtils={wrapTextNodes:function wrapTextNodes(searchString,dom,htmlTag){var nodes=findTextInNodes(dom.textNodes(),searchString);var ret=$();nodes.forEach(function(e){ret=ret.add($(e).wrapAll(htmlTag))});return ret},selectorType:function selectorType(val){if(val&&typeof val==="string"){var r=/\?(\w*)/.exec(val);if(r&&r.length){return"hookRef"}if(val[0]==="<"&&val[val.length-1]===">"){return"html"}return"string"}return"undefined"},hookToSelector:function hookToSelector(c){c=c.replace(/"/g,"&quot;");return Selectors.hook+'[name="'+c+'"]'}};return Object.freeze(HookUtils)});define("datatypes/hookset",["jquery","utils/hookutils"],function($,_ref10){"use strict";var hookToSelector=_ref10.hookToSelector;function hooks(){return this.section.$(hookToSelector(this.selector.slice(1)))}function jQueryCall(methodName){var myHooks=hooks.call(this);for(var _len7=arguments.length,args=Array(_len7>1?_len7-1:0),_key7=1;_key7<_len7;_key7++){args[_key7-1]=arguments[_key7]}return methodName in myHooks&&myHooks[methodName].apply(myHooks,args)}var HookSet=Object.freeze({forEach:function forEach(fn){return jQueryCall.call(this,"each",function(i){fn($(this),i)})},text:function text(){return jQueryCall.call(this,"text")},TwineScript_ToString:function TwineScript_ToString(){return this.text()},TwineScript_Print:function TwineScript_Print(){return this.text()},get TwineScript_ObjectName(){return this.selector+" (a hook reference)"},TwineScript_TypeName:"a hook reference (like ?this)",set TwineScript_Assignee(value){this.section.renderInto(value,hooks.call(this),{append:"replace"})},get TwineScript_Assignee(){return this},TwineScript_AssignValue:function TwineScript_AssignValue(){return jQueryCall.call(this,"text")},TwineScript_DeleteValue:function TwineScript_DeleteValue(prop){if(prop==="TwineScript_Assignee"){jQueryCall.call(this,"text","")}},create:function create(section,hookSelector){var ret=Object.create(this);ret.section=section;ret.selector=hookSelector;return Object.freeze(ret)}});return HookSet});define("internaltypes/varref",["state","internaltypes/twineerror","utils/operationutils","datatypes/hookset"],function(State,TwineError,_ref11,HookSet){"use strict";var isObject=_ref11.isObject;var isSequential=_ref11.isSequential;var objectName=_ref11.objectName;var clone=_ref11.clone;var numericIndex=_ref11.numericIndex;var isValidDatamapName=_ref11.isValidDatamapName;var defaultValue=0;function compilePropertyIndex(obj,prop){var error=undefined;if(obj instanceof Map&&(error=TwineError.containsError(isValidDatamapName(obj,prop)))){return error}if(isSequential(obj)){var match=undefined;if(typeof prop==="number"){prop-=1}else if(typeof prop==="string"&&(match=/(\d+)(?:st|[nr]d|th)last/i.exec(prop))){prop=-match[1]+""}else if(typeof prop==="string"&&(match=/(\d+)(?:st|[nr]d|th)/i.exec(prop))){prop=match[1]-1+""}else if(prop==="last"){prop=-1}else if(prop!=="length"){return TwineError.create("property","You can only access position strings/numbers ('4th', 'last', '2ndlast', (2), etc.) and 'length' of "+objectName(obj)+", not "+objectName(prop)+".")}}else if(obj instanceof Set){if(prop!=="length"){return TwineError.create("property","You can only get the 'length' of a "+objectName(obj)+".","To check contained values, use the 'contains' operator.")}prop="size"}else if(typeof obj==="number"||typeof obj==="boolean"){return TwineError.create("property","You can't get data values from "+objectName(obj)+".")}return prop}function compilePropertyChain(object,propertyChain){var compiledPropertyChain=propertyChain.reduce(function(arr,prop,i){if(prop.computed){prop=prop.value}if(Array.isArray(prop)){prop=prop.map(function(prop){return compilePropertyIndex(object,prop)})}else{prop=compilePropertyIndex(object,prop)}var error=undefined;if(error=TwineError.containsError(arr,prop)){return error}if(i<propertyChain.length-1){object=_get(object,prop)}arr.push(prop);return arr},[]);return{compiledPropertyChain:compiledPropertyChain,deepestObject:object}}function objectOrMapGet(obj,prop){if(obj===undefined){return obj}else if(obj instanceof Map){return obj.get(prop)}else{if(isSequential(obj)&&prop-0<0){prop=obj.length+(prop-0)}return obj[prop]}}function propertyDebugName(prop){if(prop.computed){return"("+objectName(prop.value)+")"}return"'"+prop+"'"}function canSet(obj,prop){if(Array.isArray(prop)){return prop.map(function(prop){return canSet(obj,prop)})}var specialCollectionErrorMsg="I won't add "+propertyDebugName(prop)+" to "+objectName(obj)+" because it's one of my special system collections.",writeproofErrorMsg="I can't modify '"+propertyDebugName(prop)+"' because it holds one of my special system collections.";if(obj instanceof Map){if(obj.TwineScript_Sealed&&!obj.has(prop)){return TwineError.create("operation",specialCollectionErrorMsg)}if(obj.TwineScript_Writeproof&&obj.TwineScript_Writeproof.indexOf(prop)>-1){return TwineError.create("operation",writeproofErrorMsg)}return true}if(isSequential(obj)){if(prop==="length"){return TwineError.create("operation","I can't forcibly alter the length of "+objectName(obj)+".")}else if(+prop!==(prop|0)){return TwineError.create("property",objectName(obj)+" can only have position keys ('3rd', '1st', (5), etc.), not "+propertyDebugName(prop)+".")}}if(obj.TwineScript_Sealed&&!(prop in obj)){return TwineError.create("operation",specialCollectionErrorMsg)}if(obj.TwineScript_Writeproof&&obj.TwineScript_Writeproof.indexOf(prop)>-1){return TwineError.create("operation",writeproofErrorMsg)}if(typeof obj==="number"||typeof obj==="boolean"){return TwineError.create("operation","You can't alter the data values of "+objectName(obj)+".")}return true}function objectOrMapSet(obj,prop,value){if(obj instanceof Map){obj.set(prop,value)}else{if(isSequential(obj)&&prop-0<0){prop=obj.length+(prop-0)}obj[prop]=value}}function objectOrMapDelete(obj,prop){if(isSequential(obj)&&prop-0<0){prop=obj.length+(prop-0)}if(Array.isArray(obj)&&numericIndex.exec(prop)){obj.splice(prop,1)}else if(obj instanceof Map||obj instanceof Set){obj.delete(prop)}else if(obj.TwineScript_DeleteValue){obj.TwineScript_DeleteValue(prop)}else delete obj[prop]}function wrapError(error){function self(){return error}return{get:self,set:self,"delete":self}}function _get(obj,prop,originalProp){if(Array.isArray(prop)){return prop.map(function(e){return _get(obj,e,e)})[typeof obj==="string"?"join":"valueOf"]("")}if(typeof obj==="string"){obj=[].concat(_toConsumableArray(obj))}var result=objectOrMapGet(obj,prop);if(result===undefined){if(obj===State.variables){return defaultValue}return TwineError.create("property","I can't find a "+propertyDebugName(originalProp)+" data name in "+objectName(obj))}return result}function mutateRight(fn,value){var _this=this;var result=this.compiledPropertyChain.reduce(function(arr,prop){var object=undefined;if(arr.length===0){object=_this.object}else{object=_get.apply(undefined,_toConsumableArray(arr[arr.length-1]))}return arr.push([object,prop])&&arr},[]).reduceRight(fn,value);return TwineError.containsError(result)?result:undefined}var VarRefProto=Object.freeze({varref:true,get:function get(){return _get(this.deepestObject,this.compiledPropertyChain.slice(-1)[0],this.propertyChain.slice(-1)[0])},set:function set(value){if(value&&value.TwineScript_AssignValue){value=value.TwineScript_AssignValue()}return mutateRight.call(this,function(value,_ref12,i){var _ref13=_slicedToArray(_ref12,2);var object=_ref13[0];var property=_ref13[1];var error=undefined;if(error=TwineError.containsError(value,object,property)||TwineError.containsError(isObject(object)&&canSet(object,property))){return error}if(HookSet.isPrototypeOf(object)&&typeof value!=="string"){return TwineError.create("datatype","You can only set hook references to strings, not "+objectName(value)+".")}if(typeof object==="string"){var _ret3=function(){if(typeof value!=="string"||value.length!==(Array.isArray(property)?property.length:1)){return{v:TwineError.create("datatype","I can't put this non-string value, "+objectName(value)+", in a string.")}}object=[].concat(_toConsumableArray(object));var valArray=[].concat(_toConsumableArray(value));[].concat(property).forEach(function(index){if(0+index<0){index=object.length+(0+index)}object=[].concat(_toConsumableArray(object.slice(0,index)),[valArray.shift()],_toConsumableArray(object.slice(index+1)))});object=object.join("")}();if((typeof _ret3==="undefined"?"undefined":_typeof(_ret3))==="object")return _ret3.v}else if(isObject(object)){if(Array.isArray(property)&&isSequential(value)){if(typeof value==="string"){value=[].concat(_toConsumableArray(value))}property.map(function(prop,i){return[prop,value[i]]}).forEach(function(_ref14){var _ref15=_slicedToArray(_ref14,2);var e=_ref15[0];var value=_ref15[1];return objectOrMapSet(object,e,value)})}else{objectOrMapSet(object,property,value)}}if(i>0){object=clone(object)}return object},value)},"delete":function _delete(){return mutateRight.call(this,function(value,_ref16,i){var _ref17=_slicedToArray(_ref16,2);var object=_ref17[0];var property=_ref17[1];var error=undefined;if(error=TwineError.containsError(value,object,property)||TwineError.containsError(isObject(object)&&canSet(object,property))){return error}if(value===null){if(isObject(object)){if(Array.isArray(property)){property.forEach(function(prop){return objectOrMapDelete(object,prop)})}else{objectOrMapDelete(object,property)}}}else{objectOrMapSet(object,property,value)}if(i>0){object=clone(object)}return object},null)},create:function create(object,propertyChain){var error=undefined;if(error=TwineError.containsError(object)){return wrapError(error)}propertyChain=[].concat(propertyChain);if(VarRefProto.isPrototypeOf(object)){propertyChain=object.propertyChain.concat(propertyChain);object=object.object}var _compilePropertyChain=compilePropertyChain(object,propertyChain);var compiledPropertyChain=_compilePropertyChain.compiledPropertyChain;var deepestObject=_compilePropertyChain.deepestObject;if(error=TwineError.containsError(compiledPropertyChain,deepestObject)){return wrapError(error)}return Object.assign(Object.create(VarRefProto),{object:object,propertyChain:propertyChain,compiledPropertyChain:compiledPropertyChain,deepestObject:deepestObject})},get TwineScript_ObjectName(){return(this.object===State.variables?"$":objectName(this.object)+"'s ")+this.propertyChain.reduce(function(a,e){return a+"'s "+propertyDebugName(e)})}});return VarRefProto});define("internaltypes/assignmentrequest",["utils"],function(_ref18){"use strict";var assert=_ref18.assert;var assignmentRequest=Object.freeze({assignmentRequest:true,TwineScript_TypeName:"an assignment operation",TwineScript_ObjectName:"an assignment operation",TwineScript_Unobservable:true,create:function create(dest,src,operator){assert("propertyChain"in dest&&"object"in dest);return Object.assign(Object.create(this),{dest:dest,src:src,operator:operator})}});return assignmentRequest});define("twinescript/operations",["state","datatypes/colour","internaltypes/assignmentrequest","utils/operationutils","internaltypes/twineerror"],function(State,Colour,AssignmentRequest,_ref19,TwineError){"use strict";var isObject=_ref19.isObject;var collectionType=_ref19.collectionType;var coerceToString=_ref19.coerceToString;var is=_ref19.is;var contains=_ref19.contains;var objectName=_ref19.objectName;var Operations=undefined,It=0;function onlyPrimitives(type,fn,operationVerb,message){operationVerb=operationVerb||"do this to";return function(left,right){if(fn.length===1){right=left}var error=undefined;if(error=TwineError.containsError(left,right)){return error}if((typeof left==="undefined"?"undefined":_typeof(left))!==type||(typeof right==="undefined"?"undefined":_typeof(right))!==type){return TwineError.create("operation","I can only "+operationVerb+" "+type+"s, not "+objectName((typeof left==="undefined"?"undefined":_typeof(left))!==type?left:right)+".",message)}return fn(left,right)}}function doNotCoerce(fn){return function(left,right){var error=undefined;if(error=TwineError.containsError(left,right)){return error}if(left&&left.varref){return TwineError.create("operation","I can't give an expression a new value.")}if((typeof left==="undefined"?"undefined":_typeof(left))!==(typeof right==="undefined"?"undefined":_typeof(right))||collectionType(left)!==collectionType(right)){return coerceToString(fn,left,right)||TwineError.create("operation",objectName(left)+" isn't the same type of data as "+objectName(right))}return fn(left,right)}}function comparisonOp(fn){return function(left,right){It=left;return fn(left,right)}}var andOrNotMessage="If one of these values is a number, you may want to write a check that it 'is not 0'. "+"Also, if one is a string, you may want to write a check that it 'is not \"\" '.";Operations={create:function create(section){var ret=Object.create(this);ret.Identifiers={get it(){return It},get time(){return Date.now()-section.timestamp}};return ret},and:onlyPrimitives("boolean",doNotCoerce(function(l,r){return l&&r}),"use 'and' to join",andOrNotMessage),or:onlyPrimitives("boolean",doNotCoerce(function(l,r){return l||r}),"use 'or' to join",andOrNotMessage),not:onlyPrimitives("boolean",function(e){return!e},"use 'not' to invert",andOrNotMessage),"+":doNotCoerce(function(l,r){if(Array.isArray(l)){return[].concat(_toConsumableArray(l),_toConsumableArray(r))}var ret=undefined;if(l instanceof Map){ret=new Map(l);r.forEach(function(v,k){return ret.set(k,v)});return ret}if(l instanceof Set){ret=new Set(l);r.forEach(function(v){return ret.add(v)});return ret}else if(typeof l["TwineScript_+"]==="function"){return l["TwineScript_+"](r)}if("string|number|boolean".includes(typeof l==="undefined"?"undefined":_typeof(l))){return l+r}return TwineError.create("operation","I can't use + on "+objectName(l)+".")}),"-":doNotCoerce(function(l,r){if(Array.isArray(l)){return l.filter(function(e){return r.indexOf(e)===-1})}var ret=undefined;if(l instanceof Set){ret=new Set(l);r.forEach(function(v){return ret.delete(v)});return ret}if(typeof l==="string"){return l.split(r).join("")}return l-r}),"*":onlyPrimitives("number",doNotCoerce(function(l,r){return l*r}),"multiply"),"/":onlyPrimitives("number",doNotCoerce(function(l,r){if(r===0){return TwineError.create("operation","I can't divide "+objectName(l)+" by zero.")}return l/r}),"divide"),"%":onlyPrimitives("number",doNotCoerce(function(l,r){if(r===0){return TwineError.create("operation","I can't modulo "+objectName(l)+" by zero.")}return l%r}),"modulus"),"<":comparisonOp(onlyPrimitives("number",doNotCoerce(function(l,r){return l<r}),"do < to")),">":comparisonOp(onlyPrimitives("number",doNotCoerce(function(l,r){return l>r}),"do > to")),"<=":comparisonOp(onlyPrimitives("number",doNotCoerce(function(l,r){
  133. return l<=r}),"do <= to")),">=":comparisonOp(onlyPrimitives("number",doNotCoerce(function(l,r){return l>=r}),"do >= to")),is:comparisonOp(is),isNot:comparisonOp(function(l,r){return!Operations.is(l,r)}),contains:comparisonOp(contains),isIn:comparisonOp(function(l,r){return contains(r,l)}),makeSpreader:function makeSpreader(val){return{value:val,spreader:true}},makeAssignmentRequest:function makeAssignmentRequest(dest,src,operator){var error=TwineError.containsError(dest,src);if(error){return error}if(src&&src.TwineScript_Unobservable){return TwineError.create("operation","That type of value can't be stored.")}if(!isObject(dest)||!("propertyChain"in dest)){return TwineError.create("operation","I can't store a new value inside "+objectName(dest)+".")}return AssignmentRequest.create(dest,src,operator)},setIt:function setIt(e){if(TwineError.containsError(e)){return e}if(!e.varref){return TwineError.create("operation","I can't put a new value into "+objectName(e)+".")}return It=e.get(),e}};return Object.freeze(Operations)});define("twinescript/environ",["macros","state","utils","datatypes/colour","internaltypes/varref","internaltypes/twineerror","twinescript/operations"],function(Macros,State,Utils,Colour,VarRef,TwineError,OperationsProto){"use strict";return function(section){if((typeof section==="undefined"?"undefined":_typeof(section))!=="object"||!section){Utils.impossible("TwineScript.environ","no Section argument was given!")}var Operations=OperationsProto.create(section);Operations;section.eval=function(){try{return eval(Array.from(arguments).join(""))}catch(e){Utils.log(e);Utils.log(Array.from(arguments).join(""));return e}};return section}});define("internaltypes/pseudohookset",["jquery","utils/hookutils"],function($,_ref20){"use strict";var wrapTextNodes=_ref20.wrapTextNodes;var PseudoHookSet=Object.freeze({forEach:function forEach(fn){var e=wrapTextNodes(this.selector,this.section.dom,"<tw-pseudo-hook>").parent();e.each(function(i){fn($(this),i)});e.contents().unwrap().parent().each(function(){this.normalize()})},create:function create(section,pseudoHookSelector){var ret=Object.create(this);ret.section=section;ret.selector=pseudoHookSelector;return ret}});return PseudoHookSet});define("internaltypes/changedescriptor",["jquery","utils","renderer"],function($,_ref21,_ref22){"use strict";var assertOnlyHas=_ref21.assertOnlyHas;var impossible=_ref21.impossible;var transitionIn=_ref21.transitionIn;var exec=_ref22.exec;var changeDescriptorShape=undefined;var ChangeDescriptor={source:"",enabled:true,target:null,append:"append",transition:"instant",transitionTime:0,styles:null,attr:null,data:null,section:null,create:function create(properties,changer){var ret=Object.assign(Object.create(this),{attr:[].concat(this.attr||[]),styles:[].concat(this.styles||[])},properties);if(changer){changer.run(ret)}return ret},update:function update(){var _this2=this;var target=this.target;if(Array.isArray(this.styles)){setTimeout(function(){var _Object;return target.css((_Object=Object).assign.apply(_Object,_toConsumableArray([{}].concat(_this2.styles))))})}if(this.attr){this.attr.forEach(function(e){return target.attr(e)})}if(this.data){target.data(this.data)}},render:function render(){var target=this.target;var source=this.source;var transition=this.transition;var enabled=this.enabled;var append=this.append;assertOnlyHas(this,changeDescriptorShape);if(!target||!enabled){return $()}if(!(append in target)){if(append==="replace"){target.empty();append="append"}else{impossible("Section.render","The target jQuery doesn't have a '"+append+"' method.");return}}var dom=$(source&&$.parseHTML(exec(source),document,true));target[append](dom.length?dom:undefined);this.update();if(transition){transitionIn(append==="replace"?target:dom,transition)}return dom}};changeDescriptorShape=Object.keys(ChangeDescriptor);return Object.seal(ChangeDescriptor)});define("internaltypes/twinenotifier",["jquery","utils"],function($,_ref23){"use strict";var impossible=_ref23.impossible;var TwineNotifier={create:function create(message){if(!message){impossible("TwineNotifier.create","called with only 1 string.")}return Object.assign(Object.create(TwineNotifier),{message:message})},render:function render(){return $("<tw-notifier>").attr("message",this.message)}};return TwineNotifier});define("section",["jquery","utils","utils/selectors","renderer","twinescript/environ","state","utils/hookutils","datatypes/hookset","internaltypes/pseudohookset","internaltypes/changedescriptor","internaltypes/twineerror","internaltypes/twinenotifier"],function($,Utils,Selectors,Renderer,Environ,State,HookUtils,HookSet,PseudoHookSet,ChangeDescriptor,TwineError,TwineNotifier){"use strict";var Section=undefined;function applyExpressionToHook(expr,result){var nextHook=expr.next(Selectors.hook);if(result&&result.changer){if(!nextHook.length){expr.replaceWith(TwineError.create("changer","The ("+result.macroName+":) command should be assigned to a variable or attached to a hook.","Macros like this should usually be touching the left side of a hook: "+expr.attr("title")+"[Some text]").render(expr.attr("title")))}else{var enabled=this.renderInto(nextHook.popAttr("source"),nextHook,result);if(!enabled){expr.addClass("false");if(Utils.insensitiveName(expr.attr("name"))!=="elseif"){this.stack[0].lastHookShown=false}return}}}else if(result&&result.live){runLiveHook.call(this,nextHook,result.delay,result.event)}else if(result===false||result===null||result===undefined){nextHook.removeAttr("source");expr.addClass("false");if(nextHook.length){this.stack[0].lastHookShown=false;return}}if(nextHook.length){this.stack[0].lastHookShown=true}}function runExpression(expr){var result=this.eval(expr.popAttr("js")||"");if(TwineError.containsError(result)){if(result instanceof Error){result=TwineError.fromError(result)}expr.replaceWith(result.render(expr.attr("title"),expr))}else if(TwineNotifier.isPrototypeOf(result)){expr.append(result.render())}else if(result&&result.TwineScript_Print&&!result.changer){result=result.TwineScript_Print();if(result.earlyExit){return false}if(result instanceof $){expr.append(result)}else if(TwineError.containsError(result)){if(result instanceof Error){result=TwineError.fromError(result)}expr.replaceWith(result.render(expr.attr("title"),expr))}else{this.renderInto(result,expr)}}else if(typeof result==="string"||typeof result==="number"||(typeof result==="undefined"?"undefined":_typeof(result))==="object"&&result&&result.toString!==Object.prototype.toString){this.renderInto(result+"",expr)}else{applyExpressionToHook.call(this,expr,result)}}var supportsNormalize=function(){var result=undefined;return function(){if(result!==undefined){return result}var p=$("<p>");if(!p[0].normalize){return result=false}p.append(document.createTextNode("0-"),document.createTextNode("2"),document.createTextNode(""))[0].normalize();return result=p.contents().length===1}}();function collapse(elem){function noVerbatim(e){return $(this||e).parentsUntil("tw-collapsed").filter("tw-verbatim, tw-expression, "+"[collapsing=false]").length===0}var beforeNode=elem.prevTextNode();if(!$(beforeNode).parents("tw-collapsed").length){beforeNode=null}var afterNode=elem.nextTextNode();if(!$(afterNode).parents("tw-collapsed").length){afterNode=null}Utils.findAndFilter(elem,"br:not([data-raw])").filter(noVerbatim).replaceWith(document.createTextNode(" "));var nodes=elem.textNodes();var finalSpaces=0;nodes.reduce(function(prevNode,node){if(!noVerbatim(node)){return document.createTextNode("A")}node.textContent=node.textContent.replace(/\s+/g," ");if(node.textContent[0]===" "&&(!prevNode||!prevNode.textContent||prevNode.textContent.search(/\s$/)>-1)){node.textContent=node.textContent.slice(1)}return node},beforeNode);[].concat(_toConsumableArray(nodes)).reverse().every(function(node){if(!noVerbatim(node)){return false}if(!node.textContent.match(/^\s*$/)){node.textContent=node.textContent.replace(/\s+$/,function(substr){finalSpaces+=substr.length;return""});return false}else{finalSpaces+=node.textContent.length;node.textContent="";return true}});if(finalSpaces>0&&afterNode){nodes[nodes.length-1].textContent+=" "}elem[0]&&supportsNormalize()&&elem[0].normalize()}function runLiveHook(target,delay){var _this3=this;var source=target.popAttr("source")||"";delay=delay===undefined?20:delay;var recursive=function recursive(){if(!_this3.inDOM()){return}_this3.renderInto(source,target,{append:"replace"});if(target.find(Selectors.expression+"[name='stop']").length){return}if(!_this3.inDOM()){return}setTimeout(recursive,delay)};setTimeout(recursive,delay)}Section={create:function create(dom){Utils.assert(dom instanceof $&&dom.length===1);var ret=Object.assign(Object.create(this),{timestamp:Date.now(),dom:dom||Utils.storyElement,stack:[],enchantments:[]});ret=Environ(ret);return ret},inDOM:function inDOM(){return $(Utils.storyElement).find(this.dom).length>0},$:function $(str){return Utils.$(str,this.dom)},evaluateTwineMarkup:function evaluateTwineMarkup(expr){var p=$("<p>");this.renderInto(expr,p);var errors=undefined;if((errors=p.find("tw-error")).length>0){return errors}return p.text()},selectHook:function selectHook(selectorString){if(HookSet.isPrototypeOf(selectorString)||PseudoHookSet.isPrototypeOf(selectorString)){return selectorString}switch(HookUtils.selectorType(selectorString)){case"hookRef":{return HookSet.create(this,selectorString)}case"html":{return Utils.findAndFilter(this.dom.add(Utils.storyElement),selectorString.slice(1,-1))}case"string":{return PseudoHookSet.create(this,selectorString)}}return null},renderInto:function renderInto(source,target,changers){var desc=ChangeDescriptor.create({target:target,source:source});desc.section=this;changers&&[].concat(changers).forEach(function(changer){if(!changer||!changer.changer){Object.assign(desc,changer)}else{changer.run(desc)}});if(typeof desc.target==="string"){desc.target=this.selectHook(desc.target)}if(!desc.target){Utils.impossible("Section.renderInto","ChangeDescriptor has source but not a target!");return false}var dom=$();if(this.stack.length>=50){dom=TwineError.create("infinite","Printing this expression may have trapped me in an infinite loop.").render(target.attr("title")).replaceAll(target)}else if(!(desc.target instanceof $)){desc.target.forEach(function(e){dom=dom.add(desc.create({target:e}).render())})}else{dom=desc.render()}this.stack.unshift(Object.create(null));var section=this;Utils.findAndFilter(dom,Selectors.hook+","+Selectors.expression).each(function doExpressions(){var expr=$(this);switch(expr.tag()){case Selectors.hook:{if(expr.attr("source")){section.renderInto(expr.attr("source"),expr);expr.removeAttr("source")}break}case Selectors.expression:{return runExpression.call(section,expr)}}});if(dom.length&&target instanceof $&&target.is(Selectors.hook)&&target.parents("tw-collapsed").length>0){collapse(dom)}Utils.findAndFilter(dom,Selectors.collapsed).each(function(){collapse($(this))});this.stack.shift();if(this.stack.length===0){this.updateEnchantments()}return desc.enabled},updateEnchantments:function updateEnchantments(){this.enchantments.forEach(function(e){e.disenchant();e.enchantScope()})}};return Object.preventExtensions(Section)});define("engine",["jquery","utils","utils/selectors","state","section","passages"],function($,Utils,Selectors,State,Section,Passages){"use strict";var escape=Utils.escape;var impossible=Utils.impossible;var passageSelector=Utils.passageSelector;var transitionOut=Utils.transitionOut;var assert=Utils.assert;var Engine=undefined;var options=Object.create(null);function createPassageElement(){var container=$("<tw-passage><tw-sidebar>"),sidebar=container.children(Selectors.sidebar);if(options.permalink&&State.save){sidebar.append('<tw-icon tabindex=0 class="permalink" title="Permanent link to this passage"><a href="#'+State.save()+'">&sect;')}var back=$('<tw-icon tabindex=0 class="undo" title="Undo">&#8630;</tw-icon>').click(Engine.goBack),fwd=$('<tw-icon tabindex=0 class="redo" title="Redo">&#8631;</tw-icon>').click(Engine.goForward);if(State.pastLength<=0){back.css("visibility","hidden")}if(State.futureLength<=0){fwd.css("visibility","hidden")}sidebar.append(back).append(fwd);return container}function setupPassageElement(tagType,setupPassage){return"<tw-include type="+tagType+" title='"+escape(setupPassage.get("name"))+"'>"+setupPassage.get("source")+"</tw-include>"}function showPassage(name,stretch){var t8n="instant",passageData=Passages.get(name),story=Utils.storyElement;var parent=story.parent();if(parent.is(Selectors.enchantment)){parent=story.unwrap().parent()}if(!passageData||!(passageData instanceof Map)||!passageData.has("source")){impossible("Engine.showPassage","There's no passage with the name \""+name+'"!')}story.detach();var oldPassages=Utils.$(story.children(passageSelector));if(!stretch&&t8n){transitionOut(oldPassages,t8n)}var newPassage=createPassageElement().appendTo(story);assert(newPassage.length>0);var section=Section.create(newPassage);var source=passageData.get("source");source=(options.debug?Passages.getTagged("debug-header").map(setupPassageElement.bind(0,"debug-header")).join(""):"")+Passages.getTagged("header").map(setupPassageElement.bind(0,"header")).join("")+source+Passages.getTagged("footer").map(setupPassageElement.bind(0,"footer")).join("")+(options.debug?Passages.getTagged("debug-footer").map(setupPassageElement.bind(0,"debug-footer")).join(""):"");if(State.pastLength<=0){if(options.debug){source=Passages.getTagged("debug-startup").map(setupPassageElement.bind(0,"debug-startup")).join("")+source}source=Passages.getTagged("startup").map(setupPassageElement.bind(0,"startup")).join("")+source}section.renderInto(source,newPassage,[{transition:"dissolve"}]);$("html").append(story.parent().length?story.parent():story);scroll(0,stretch?newPassage.offset().top-$(window).height()*.05:parent.offset().top)}Engine={goBack:function goBack(){if(State.rewind()){showPassage(State.passage)}},goForward:function goForward(){if(State.fastForward()){showPassage(State.passage)}},goToPassage:function goToPassage(id,stretch){State.play(id);showPassage(id,stretch)},showPassage:showPassage,options:options};return Object.freeze(Engine)});define("macrolib/values",["macros","utils/operationutils","internaltypes/twineerror"],function(Macros,_ref24,TwineError){"use strict";var subset=_ref24.subset;var objectName=_ref24.objectName;var _Macros$TypeSignature=Macros.TypeSignature;var rest=_Macros$TypeSignature.rest;var zeroOrMore=_Macros$TypeSignature.zeroOrMore;var Any=_Macros$TypeSignature.Any;Macros.add(["text","string"],function(_){for(var _len8=arguments.length,args=Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){args[_key8-1]=arguments[_key8]}return args.join("")},[zeroOrMore(Macros.TypeSignature.either(String,Number,Boolean,Array))])("substring",function(_,string,a,b){return subset(string,a,b)},[String,Number,Number])(["num","number"],function(_,expr){if(Number.isNaN(+expr)){return TwineError.create("macrocall","I couldn't convert "+objectName(expr)+" to a number.")}return+expr},[String]);function mathFilter(fn){return function(args){var result=fn.apply(undefined,_toConsumableArray(args));if(typeof result!=="number"||isNaN(result)){return TwineError.create("macrocall","This mathematical expression doesn't compute!")}return result}}function either(){for(var _len9=arguments.length,args=Array(_len9),_key9=0;_key9<_len9;_key9++){args[_key9]=arguments[_key9]}return args[~~(Math.random()*args.length)]}({weekday:[function(){return["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"][(new Date).getDay()]+"day"},null],monthday:[function(){return(new Date).getDate()},null],currenttime:[function(){var d=new Date,am=d.getHours()<12;return d.getHours()%12+":"+d.getMinutes()+" "+(am?"A":"P")+"M"},null],currentdate:[function(){return(new Date).toDateString()},null],min:[Math.min,rest(Number)],max:[Math.max,rest(Number)],abs:[Math.abs,Number],sign:[Math.sign,Number],sin:[Math.sin,Number],cos:[Math.cos,Number],tan:[Math.tan,Number],floor:[Math.floor,Number],round:[Math.round,Number],ceil:[Math.ceil,Number],pow:[Math.pow,Number],exp:[Math.exp,Number],sqrt:[mathFilter(Math.sqrt),Number],log:[mathFilter(Math.log),Number],log10:[mathFilter(Math.log10),Number],log2:[mathFilter(Math.log2),Number],random:[function(a,b){if(a!==(a|0)||b!==(b|0)){return TwineError.create("macrocall","(random:) only accepts whole numbers, not "+objectName(a!==(a|0)?a:b))}var from=undefined,to=undefined;if(!b){from=0;to=a}else{from=Math.min(a,b);to=Math.max(a,b)}to+=1;return~~(Math.random()*(to-from))+from},[Number,Macros.TypeSignature.optional(Number)]],either:[either,rest(Any)],alert:[function(text){return window.alert(text||"")},String],prompt:[function(text,value){return window.prompt(text||"",value||"")||""},String,String],confirm:[function(text){return window.confirm(text||"")},String],openURL:[window.open,String],reload:[window.location.reload.bind(window.location),null],gotoURL:[window.location.assign.bind(window.location),String],pageURL:[function(){return window.location.href},null],"":function _(){var _this4=this;Object.keys(this).forEach(function(key){if(key){(function(){var fn=_this4[key][0];var typeSignature=_this4[key][1];Macros.add(key,function(_){for(var _len10=arguments.length,rest=Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){rest[_key10-1]=arguments[_key10]}return fn.apply(undefined,rest)},typeSignature)})()}})}})[""]()});(function(global){(function(){if(global.requestAnimationFrame){return}if(global.webkitRequestAnimationFrame){global.requestAnimationFrame=global["webkitRequestAnimationFrame"];global.cancelAnimationFrame=global["webkitCancelAnimationFrame"]||global["webkitCancelRequestAnimationFrame"]}var lastTime=0;global.requestAnimationFrame=function(callback){var currTime=(new Date).getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=global.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);lastTime=currTime+timeToCall;return id};global.cancelAnimationFrame=function(id){clearTimeout(id)}})();if(typeof define==="function"){define("requestAnimationFrame",[],function(){return global.requestAnimationFrame})}})(window);define("macrolib/commands",["requestAnimationFrame","macros","utils","state","passages","engine","internaltypes/twineerror","utils/operationutils"],function(requestAnimationFrame,Macros,_ref25,State,Passages,Engine,TwineError,_ref26){"use strict";var toJSLiteral=_ref25.toJSLiteral;var unescape=_ref25.unescape;var isObject=_ref26.isObject;var _Macros$TypeSignature2=Macros.TypeSignature;var Any=_Macros$TypeSignature2.Any;var optional=_Macros$TypeSignature2.optional;var hasStorage=!!localStorage&&function(){try{localStorage.setItem("test","1");localStorage.removeItem("test");return true}catch(e){return false}}();function storagePrefix(text){return"("+text+" "+Engine.options.ifid+") "}Macros.add("display",function(_,name){return{TwineScript_ObjectName:"a (display: "+toJSLiteral(name)+") command",TwineScript_TypeName:"a (display:) command",TwineScript_Print:function TwineScript_Print(){if(!Passages.has(name)){return TwineError.create("macrocall","I can't (display:) the passage '"+name+"' because it doesn't exist.")}return unescape(Passages.get(name).get("source"))}}},[String])("print",function(_,expr){if(TwineError.containsError(expr)){return expr}if(expr&&typeof expr.TwineScript_Print==="function"){expr=expr.TwineScript_Print()}else if(expr instanceof Map){expr=Array.from(expr.entries());if(TwineError.containsError(expr)){return expr}expr=expr.reduce(function(html,pair){return html+"<tr><td>"+print(_,pair[0]).TwineScript_Print()+"</td><td>"+print(_,pair[1]).TwineScript_Print()+"</td></tr>"},"<table class=datamap>")+"</table>"}else if(expr instanceof Set){expr=Array.from(expr.values())}else if(Array.isArray(expr)){expr+=""}else if(isObject(expr)){throw new TypeError("I don't know how to print this value yet.")}else{expr+=""}return{TwineScript_ObjectName:"a (print: "+toJSLiteral(expr)+") command",TwineScript_TypeName:"a (print:) command",TwineScript_Print:function TwineScript_Print(){return expr}}},[Any])("goto",function(_,name){return{TwineScript_ObjectName:"a (go-to: "+toJSLiteral(name)+") command",TwineScript_TypeName:"a (go-to:) command",TwineScript_Print:function TwineScript_Print(){if(!Passages.has(name)){return TwineError.create("macrocall","I can't (go-to:) the passage '"+name+"' because it doesn't exist.")}requestAnimationFrame(Engine.goToPassage.bind(Engine,name,false));return{earlyExit:1}}}},[String])("live",function(_,delay){return{TwineScript_ObjectName:"a (live: "+delay+") command",TwineScript_TypeName:"a (live:) command",live:true,delay:delay}},[optional(Number)])("stop",function(){return{TwineScript_ObjectName:"a (stop:) command",TwineScript_TypeName:"a (stop:) command",TwineScript_Print:function TwineScript_Print(){return""}}},[])("savegame",function(_,slotName,fileName){fileName=fileName||"";if(!hasStorage){return false}var serialisation=State.serialise();if(!serialisation){return TwineError.create("saving","The game's variables contain a complex data structure; the game can no longer be saved.")}try{localStorage.setItem(storagePrefix("Saved Game")+slotName,serialisation);localStorage.setItem(storagePrefix("Saved Game Filename")+slotName,fileName);return true}catch(e){return false}},[String,optional(String)])("loadgame",function(_,slotName){return{TwineScript_ObjectName:"a (load-game:) command",TwineScript_TypeName:"a (load-game:) command",TwineScript_Print:function TwineScript_Print(){var saveData=localStorage.getItem(storagePrefix("Saved Game")+slotName);if(!saveData){return TwineError.create("saving","I can't find a save slot named '"+slotName+"'!")}State.deserialise(saveData);requestAnimationFrame(Engine.showPassage.bind(Engine,State.passage,false));return{earlyExit:1}}}},[String])});define("utils/naturalsort",[],function(){"use strict";return function NaturalSort(locale){return function naturalSort(a,b){var re=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,sre=/(^[ ]*|[ ]*$)/g,dre=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,hre=/^0x[0-9a-f]+$/i,ore=/^0/,i=function i(s){return naturalSort.insensitive&&(""+s).toLowerCase()||""+s},x=i(a).replace(sre,"")||"",y=i(b).replace(sre,"")||"",xN=x.replace(re,"\x00$1\x00").replace(/\0$/,"").replace(/^\0/,"").split("\x00"),yN=y.replace(re,"\x00$1\x00").replace(/\0$/,"").replace(/^\0/,"").split("\x00"),xD=parseInt(x.match(hre))||xN.length!==1&&x.match(dre)&&Date.parse(x),yD=parseInt(y.match(hre))||xD&&y.match(dre)&&Date.parse(y)||null,oFxNcL,oFyNcL,collator,colCmp;if(locale&&window.Intl&&window.Intl.Collator)collator=window.Intl.Collator(locale);if(yD)if(xD<yD)return-1;else if(xD>yD)return 1;for(var cLoc=0,numS=Math.max(xN.length,yN.length);cLoc<numS;cLoc++){oFxNcL=!(xN[cLoc]||"").match(ore)&&parseFloat(xN[cLoc])||xN[cLoc]||0;oFyNcL=!(yN[cLoc]||"").match(ore)&&parseFloat(yN[cLoc])||yN[cLoc]||0;if(isNaN(oFxNcL)!==isNaN(oFyNcL)){return isNaN(oFxNcL)?1:-1}else if((typeof oFxNcL==="undefined"?"undefined":_typeof(oFxNcL))!==(typeof oFyNcL==="undefined"?"undefined":_typeof(oFyNcL))){oFxNcL+="";oFyNcL+=""}else if(typeof oFxNcL==="string"&&collator){colCmp=collator.compare(oFxNcL,oFyNcL);if(colCmp!==0)return colCmp}if(oFxNcL<oFyNcL)return-1;if(oFxNcL>oFyNcL)return 1}return 0}}});define("macrolib/datastructures",["jquery","utils/naturalsort","macros","utils/operationutils","state","engine","passages","internaltypes/assignmentrequest","internaltypes/twineerror","internaltypes/twinenotifier"],function($,NaturalSort,Macros,_ref27,State,Engine,Passages,AssignmentRequest,TwineError,TwineNotifier){"use strict";var objectName=_ref27.objectName;var subset=_ref27.subset;var collectionType=_ref27.collectionType;var isValidDatamapName=_ref27.isValidDatamapName;var _Macros$TypeSignature3=Macros.TypeSignature;var optional=_Macros$TypeSignature3.optional;var rest=_Macros$TypeSignature3.rest;var zeroOrMore=_Macros$TypeSignature3.zeroOrMore;var Any=_Macros$TypeSignature3.Any;Macros.add("set",function(_){for(var _len11=arguments.length,assignmentRequests=Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){assignmentRequests[_key11-1]=arguments[_key11]}var debugMessage="";for(var i=0;i<assignmentRequests.length;i+=1){var ar=assignmentRequests[i];if(ar.operator==="into"){return TwineError.create("macrocall","Please say 'to' when using the (set:) macro.")}var result=ar.dest.set(ar.src);if(TwineError.isPrototypeOf(result)){return result}if(Engine.options.debug){debugMessage+=(debugMessage?"; ":"")+objectName(ar.dest)+" is now "+objectName(ar.src)}}return{TwineScript_TypeName:"a (set:) operation",TwineScript_ObjectName:"a (set:) operation",TwineScript_Unobservable:true,TwineScript_Print:function TwineScript_Print(){return debugMessage&&TwineNotifier.create(debugMessage).render()}}},[rest(AssignmentRequest)])("put",function(_){for(var _len12=arguments.length,assignmentRequests=Array(_len12>1?_len12-1:0),_key12=1;_key12<_len12;_key12++){assignmentRequests[_key12-1]=arguments[_key12]}var debugMessage="";for(var i=0;i<assignmentRequests.length;i+=1){var ar=assignmentRequests[i];if(ar.operator!=="into"){return TwineError.create("macrocall","Please say 'into' when using the (put:) macro.")}var result=ar.dest.set(ar.src);if(TwineError.isPrototypeOf(result)){return result}if(Engine.options.debug){debugMessage+=(debugMessage?"; ":"")+objectName(ar.dest)+" is now "+objectName(ar.src)}}return{TwineScript_TypeName:"a (put:) operation",TwineScript_ObjectName:"a (put:) operation",TwineScript_Unobservable:true,TwineScript_Print:function TwineScript_Print(){return debugMessage&&TwineNotifier.create(debugMessage).render()}}},[rest(AssignmentRequest)])("move",function(_,ar){if(ar.operator!=="into"){return TwineError.create("macrocall","Please say 'into' when using the (move:) macro.")}if(ar.src&&ar.src.varref){var get=ar.src.get();var error=undefined;if(error=TwineError.containsError(get)){return error}ar.dest.set(get);ar.src.delete()}else{ar.dest.set(ar.src);if(ar.src.TwineScript_DeleteValue){ar.src.TwineScript_DeleteValue()}}return{TwineScript_TypeName:"a (move:) operation",TwineScript_ObjectName:"a (move:) operation",TwineScript_Unobservable:true,TwineScript_Print:""}},[rest(AssignmentRequest)])(["a","array"],function(_){for(var _len13=arguments.length,args=Array(_len13>1?_len13-1:0),_key13=1;_key13<_len13;_key13++){args[_key13-1]=arguments[_key13]}return args},zeroOrMore(Any))("range",function range(_,a,b){if(a>b){return range(_,b,a)}var ret=[a];b-=a;while(b-->0){ret.push(++a)}return ret},[Number,Number])("subarray",function(_,array,a,b){return subset(array,a,b)},[Array,Number,Number])("shuffled",function(_){for(var _len14=arguments.length,args=Array(_len14>1?_len14-1:0),_key14=1;_key14<_len14;_key14++){args[_key14-1]=arguments[_key14]}return args.reduce(function(a,e,ind){var j=Math.random()*(ind+1)|0;if(j===ind){a.push(e)}else{a.push(a[j]);a[j]=e}return a},[])},[Any,rest(Any)])("sorted",function(_){for(var _len15=arguments.length,args=Array(_len15>1?_len15-1:0),_key15=1;_key15<_len15;_key15++){args[_key15-1]=arguments[_key15]}return args.sort(NaturalSort("en"))},[String,rest(String)])("rotated",function(_,number){for(var _len16=arguments.length,array=Array(_len16>2?_len16-2:0),_key16=2;_key16<_len16;_key16++){array[_key16-2]=arguments[_key16]}number*=-1;if(number===0){return TwineError.create("macrocall","I can't rotate these values by 0 positions.")}else if(Math.abs(number)>=array.length){return TwineError.create("macrocall","I can't rotate these "+array.length+" values by "+number+" positions.")}return array.slice(number).concat(array.slice(0,number))},[Any,Any,rest(Any)])("datanames",function(_,map){return Array.from(map.keys()).sort(NaturalSort("en"))},[Map])("datavalues",function(_,map){return Array.from(map.entries()).sort(function(a,b){return[a[0],b[0]].sort(NaturalSort("en"))[0]===a[0]?-1:1}).map(function(e){return e[1]})},[Map])("history",function(){return State.pastPassageNames()},[])("passage",function(_,passageName){return Passages.get(passageName||State.passage)||TwineError.create("macrocall","There's no passage named '"+passageName+"' in this story.")},[optional(String)])("savedgames",function(){function storagePrefix(text){return"("+text+" "+Engine.options.ifid+") "}var i=0,key=undefined;var savesMap=new Map;do{key=localStorage.key(i);i+=1;var prefix=storagePrefix("Saved Game");if(key&&key.startsWith(prefix)){key=key.slice(prefix.length);savesMap.set(key,localStorage.getItem(storagePrefix("Saved Game Filename")+key))}}while(key);return savesMap},[])("datamap",function(_){for(var _len17=arguments.length,args=Array(_len17>1?_len17-1:0),_key17=1;_key17<_len17;_key17++){args[_key17-1]=arguments[_key17]}var key=undefined;var map=new Map;var status=args.reduce(function(status,element){var error=undefined;if(TwineError.containsError(status)){return status}if(key===undefined){key=element}else if(error=TwineError.containsError(isValidDatamapName(map,key))){return error}else if(map.has(key)){return TwineError.create("macrocall","You used the same data name ("+objectName(key)+") twice in the same (datamap:) call.")}else{map.set(key,element);key=undefined}return status},true);if(TwineError.containsError(status)){return status}if(key!==undefined){return TwineError.create("macrocall","This datamap has a data name without a value.")}return map},zeroOrMore(Any))("dataset",function(_){for(var _len18=arguments.length,args=Array(_len18>1?_len18-1:0),_key18=1;_key18<_len18;_key18++){args[_key18-1]=arguments[_key18]}return new Set(args)},zeroOrMore(Any))("count",function(_,collection,value){switch(collectionType(collection)){case"dataset":case"datamap":{return+collection.has(name)}case"string":{if(typeof value!=="string"){return new TypeError(objectName(collection)+" can't contain  "+objectName(value)+" because it isn't a string.")}return collection.split(value).length-1}case"array":{return collection.reduce(function(count,e){return count+(e===value)},0)}}},[Any,Any])});define("datatypes/changercommand",["utils","macros","utils/operationutils"],function(_ref28,Macros,_ref29){"use strict";var assert=_ref28.assert;var is=_ref29.is;var ChangerCommand={changer:true,TwineScript_TypeName:"a changer command",TwineScript_Print:function TwineScript_Print(){return"[A '"+this.macroName+"' command]"},create:function create(macroName,params,next){assert(params===undefined||Array.isArray(params));return Object.assign(Object.create(this),{macroName:macroName,params:params,next:next||null,TwineScript_ObjectName:"a ("+macroName+":) command"})},"TwineScript_+":function TwineScript_(other){var ret=this.TwineScript_Clone();while(ret.next){ret=ret.next}ret.next=other;return ret},TwineScript_is:function TwineScript_is(other){if(ChangerCommand.isPrototypeOf(other)){return this.macroName===other.macroName&&is(this.params,other.params)&&is(this.next,other.next)}},TwineScript_Clone:function TwineScript_Clone(){return this.create(this.macroName,this.params,this.next)},run:function run(desc){Macros.getChangerFn(this.macroName).apply(undefined,[desc].concat(_toConsumableArray(this.params)));if(this.next){this.next.run(desc)}}};return Object.freeze(ChangerCommand)});define("macrolib/stylechangers",["jquery","macros","utils","utils/selectors","datatypes/colour","datatypes/changercommand","internaltypes/twineerror"],function($,Macros,_ref30,Selectors,Colour,ChangerCommand,TwineError){"use strict";var insensitiveName=_ref30.insensitiveName;var assert=_ref30.assert;var childrenProbablyInline=_ref30.childrenProbablyInline;var _Macros$TypeSignature4=Macros.TypeSignature;var either=_Macros$TypeSignature4.either;var wrapped=_Macros$TypeSignature4.wrapped;var IfTypeSignature=[wrapped(Boolean,"If you gave a number, you may instead want to check that the number is not 0. "+'If you gave a string, you may instead want to check that the string is not "".')];Macros.addChanger("if",function(_,expr){
  134. return ChangerCommand.create("if",[expr])},function(d,expr){return d.enabled=d.enabled&&expr},IfTypeSignature)("unless",function(_,expr){return ChangerCommand.create("unless",[!expr])},function(d,expr){return d.enabled=d.enabled&&expr},IfTypeSignature)("elseif",function(section,expr){if(!("lastHookShown"in section.stack[0])){return TwineError.create("macrocall","There's no (if:) or something else before this to do (else-if:) with.")}return ChangerCommand.create("elseif",[section.stack[0].lastHookShown===false&&!!expr])},function(d,expr){return d.enabled=d.enabled&&expr},IfTypeSignature)("else",function(section){if(!("lastHookShown"in section.stack[0])){return TwineError.create("macrocall","There's nothing before this to do (else:) with.")}return ChangerCommand.create("else",[section.stack[0].lastHookShown===false])},function(d,expr){return d.enabled=d.enabled&&expr},null)(["hook"],function(_,name){return ChangerCommand.create("hook",[name])},function(d,name){return d.attr.push({name:name})},[String])(["transition","t8n"],function(_,name){var validT8ns=["dissolve","shudder","pulse"];name=insensitiveName(name);if(validT8ns.indexOf(name)===-1){return TwineError.create("macrocall","'"+name+'" is not a valid (transition:)',"Only the following names are recognised (capitalisation and hyphens ignored): "+validT8ns.join(", "))}return ChangerCommand.create("transition",[name])},function(d,name){d.transition=name;return d},[String])("font",function(_,family){return ChangerCommand.create("font",[family])},function(d,family){d.styles.push({"font-family":family});return d},[String])("align",function(_,arrow){var style=undefined,centerIndex=arrow.indexOf("><");if(!/^(==+>|<=+|=+><=+|<==+>)$/.test(arrow)){return TwineError.create("macrocall","The (align:) macro requires an alignment arrow "+'("==>", "<==", "==><=" etc.) be provided, not "'+arrow+'"')}if(~centerIndex){var alignPercent=Math.round(centerIndex/(arrow.length-2)*50);style=Object.assign({"text-align":"center","max-width":"50%"},alignPercent===25?{"margin-left":"auto","margin-right":"auto"}:{"margin-left":alignPercent+"%"})}else if(arrow[0]==="<"&&arrow.slice(-1)===">"){style={"text-align":"justify","max-width":"50%"}}else if(arrow.includes(">")){style={"text-align":"right"}}else{style={"text-align":"left"}}style.display="block";return ChangerCommand.create("align",[style])},function(d,style){d.styles.push(style)},[String])(["text-colour","text-color","color","colour"],function(_,CSScolour){if(CSScolour&&CSScolour.colour){CSScolour=CSScolour.toHexString(CSScolour)}return ChangerCommand.create("text-colour",[CSScolour])},function(d,CSScolour){d.styles.push({color:CSScolour});return d},[either(String,Colour)])("text-rotate",function(_,rotation){return ChangerCommand.create("rotate",[rotation])},function(d,rotation){d.styles.push({display:"inline-block",transform:function transform(){var currentTransform=$(this).css("transform")||"";if(currentTransform==="none"){currentTransform=""}return currentTransform+" rotate("+rotation+"deg)"}});return d},[Number])("background",function(_,value){if(value&&value.colour){value=value.toHexString(value)}return ChangerCommand.create("background",[value])},function(d,value){var property=undefined;if(Colour.isHexString(value)){property={"background-color":value}}else{property={"background-size":"cover","background-image":"url("+value+")"}}d.styles.push(property,{display:function display(){return childrenProbablyInline($(this))?"initial":"block"}});return d},[either(String,Colour)]).apply(undefined,_toConsumableArray(function(){var colourTransparent={color:"transparent"},styleTagNames=Object.assign(Object.create(null),{bold:{"font-weight":"bold"},italic:{"font-style":"italic"},underline:{"text-decoration":"underline"},strike:{"text-decoration":"line-through"},superscript:{"vertical-align":"super","font-size":".83em"},subscript:{"vertical-align":"sub","font-size":".83em"},blink:{animation:"fade-in-out 1s steps(1,end) infinite alternate"},shudder:{animation:"shudder linear 0.1s 0s infinite",display:"inline-block"},mark:{"background-color":"hsla(60, 100%, 50%, 0.6)"},condense:{"letter-spacing":"-0.08em"},expand:{"letter-spacing":"0.1em"},outline:[{"text-shadow":function textShadow(){var colour=$(this).css("color");return"-1px -1px 0 "+colour+", 1px -1px 0 "+colour+",-1px  1px 0 "+colour+", 1px  1px 0 "+colour}},{color:function color(){return $(this).css("background-color")}}],shadow:{"text-shadow":function textShadow(){return"0.08em 0.08em 0.08em "+$(this).css("color")}},emboss:{"text-shadow":function textShadow(){return"0.08em 0.08em 0em "+$(this).css("color")}},smear:[{"text-shadow":function textShadow(){var colour=$(this).css("color");return"0em   0em 0.02em "+colour+","+"-0.2em 0em  0.5em "+colour+","+" 0.2em 0em  0.5em "+colour}},colourTransparent],blur:[{"text-shadow":function textShadow(){return"0em 0em 0.08em "+$(this).css("color")}},colourTransparent],blurrier:[{"text-shadow":function textShadow(){return"0em 0em 0.2em "+$(this).css("color")},"user-select":"none"},colourTransparent],mirror:{display:"inline-block",transform:"scaleX(-1)"},upsidedown:{display:"inline-block",transform:"scaleY(-1)"},fadeinout:{animation:"fade-in-out 2s ease-in-out infinite alternate"},rumble:{animation:"rumble linear 0.1s 0s infinite",display:"inline-block"}});return["text-style",function(_,styleName){styleName=insensitiveName(styleName);if(!(styleName in styleTagNames)){return TwineError.create("macrocall","'"+styleName+'" is not a valid (textstyle:)',"Only the following names are recognised (capitalisation and hyphens ignored): "+Object.keys(styleTagNames).join(", "))}return ChangerCommand.create("text-style",[styleName])},function(d,styleName){assert(styleName in styleTagNames);d.styles=d.styles.concat(styleTagNames[styleName]);return d}]}()).concat([[String]]))("css",function(_,text){if(!text.trim().endsWith(";")){text+=";"}return ChangerCommand.create("css",[text])},function(d,text){d.attr.push({style:function style(){return($(this).attr("style")||"")+text}});return d},[String])});define("internaltypes/enchantment",["jquery","utils","internaltypes/changedescriptor"],function($,Utils,ChangeDescriptor){"use strict";var Enchantment={create:function create(descriptor){Utils.assertOnlyHas(descriptor,["scope","attr","data","changer"]);return Object.assign(Object.create(this),{enchantments:$()},descriptor)},enchantScope:function enchantScope(){var _this5=this;var attr=this.attr;var data=this.data;var changer=this.changer;var scope=this.scope;if(scope instanceof $){scope=Array.prototype.map.call(scope,function(e){return $(e)})}this.enchantments=$();scope.forEach(function(e){var wrapping=e.wrapAll("<tw-enchantment>").parent();if(attr){wrapping.attr(attr)}if(data){wrapping.data(data)}if(changer){var cd=ChangeDescriptor.create({target:wrapping});changer.run(cd);cd.update()}if(e.is("tw-story")){wrapping.css({width:"100%",height:"100%"})}_this5.enchantments=_this5.enchantments.add(wrapping)})},disenchant:function disenchant(){this.enchantments.each(function(){$(this).contents().unwrap()})}};return Object.freeze(Enchantment)});define("macrolib/enchantments",["jquery","utils","macros","datatypes/hookset","datatypes/changercommand","internaltypes/enchantment"],function($,Utils,Macros,HookSet,ChangerCommand,Enchantment){"use strict";var either=Macros.TypeSignature.either;var revisionTypes=["replace","append","prepend"];revisionTypes.forEach(function(e){Macros.addChanger(e,function(_,scope){return ChangerCommand.create(e,[scope])},function(desc,scope){var collapsing=$(desc.target.context).parents().filter("tw-collapsed").length>0;if(!collapsing){desc.attr=[].concat(_toConsumableArray(desc.attr),[{collapsing:false}])}desc.target=scope;desc.append=e;return desc},either(HookSet,String))});function newEnchantmentMacroFns(enchantDesc,name){Utils.assert(enchantDesc);$(function(){Utils.storyElement.on(enchantDesc.event+".enchantment","."+enchantDesc.classList.replace(/ /g,"."),function generalEnchantmentEvent(){var enchantment=$(this),event=enchantment.data("enchantmentEvent");if(event){event(enchantment)}})});return[function(_,selector){if(selector.selector){selector=selector.selector}return ChangerCommand.create(name,[selector])},function makeEnchanter(desc,selector){desc.enabled=false;if(enchantDesc.rerender){desc.target=selector;desc.append=enchantDesc.rerender}var enchantData=Enchantment.create({attr:Object.assign({"class":enchantDesc.classList},enchantDesc.classList.includes("link")?{tabIndex:"0"}:{}),data:{enchantmentEvent:function enchantmentEvent(){if(enchantDesc.once){var index=desc.section.enchantments.indexOf(enchantData);desc.section.enchantments.splice(index,1);enchantData.disenchant()}desc.section.renderInto(desc.source,null,Object.assign({},desc,{enabled:true}))}},scope:desc.section.selectHook(selector)});desc.section.enchantments.push(enchantData);enchantData.enchantScope();return desc},either(HookSet,String)]}var interactionTypes=[{name:"click",enchantDesc:{event:"click",once:true,rerender:"",classList:"link enchantment-link"}},{name:"mouseover",enchantDesc:{event:"mouseenter",once:true,rerender:"",classList:"enchantment-mouseover"}},{name:"mouseout",enchantDesc:{event:"mouseleave",once:true,rerender:"",classList:"enchantment-mouseout"}}];interactionTypes.forEach(function(e){return Macros.addChanger.apply(Macros,[e.name].concat(_toConsumableArray(newEnchantmentMacroFns(e.enchantDesc,e.name))))});revisionTypes.forEach(function(revisionType){interactionTypes.forEach(function(interactionType){var enchantDesc=Object.assign({},interactionType.enchantDesc,{rerender:revisionType}),name=interactionType.name+"-"+revisionType;Macros.addChanger.apply(Macros,[name].concat(_toConsumableArray(newEnchantmentMacroFns(enchantDesc,name))))})})});define("macrolib/links",["jquery","macros","utils","utils/selectors","state","passages","engine","datatypes/changercommand"],function($,Macros,Utils,Selectors,State,Passages,Engine,ChangerCommand){"use strict";var optional=Macros.TypeSignature.optional;$(function(){return $(Utils.storyElement).on("click.passage-link",Selectors.internalLink,function clickLinkEvent(){var link=$(this),event=link.parent().data("clickEvent");if(event){event(link);return}var next=link.attr("passage-name");if(next){Engine.goToPassage(next,false)}})});[["link","link-replace"],["link-reveal"],["link-repeat"]].forEach(function(arr){return Macros.addChanger(arr,function(_,expr){return ChangerCommand.create(arr[0],[expr])},function(desc,text){var innerSource=desc.source;desc.source="<tw-link tabindex=0>"+text+"</tw-link>";desc.append=arr[0]==="link"?"replace":"append";desc.data={clickEvent:function clickEvent(link){desc.source=innerSource;desc.section.renderInto(innerSource+"",null,desc);if(arr[0]==="link-reveal"){link.contents().unwrap()}}}},[String])});Macros.add(["link-goto"],function(section,text,passage){return{TwineScript_TypeName:"a (link-goto: "+Utils.toJSLiteral(text)+", "+Utils.toJSLiteral(passage)+") command",TwineScript_ObjectName:"a (link-goto:) command",TwineScript_Print:function TwineScript_Print(){var passageName=section.evaluateTwineMarkup(Utils.unescape(passage||text));if(passageName instanceof $){return passageName}if(!Passages.has(passageName)){return'<tw-broken-link passage-name="'+Utils.escape(passageName)+'">'+(text||passage)+"</tw-broken-link>"}var visited=State.passageNameVisited(passageName);return"<tw-link tabindex=0 "+(visited>0?'class="visited" ':"")+'passage-name="'+Utils.escape(passageName)+'">'+(text||passage)+"</tw-link>"}}},[String,optional(String)])});define("macrolib",["utils","macrolib/values","macrolib/commands","macrolib/datastructures","macrolib/stylechangers","macrolib/enchantments","macrolib/links"],function(_ref31){"use strict";var log=_ref31.log;log("Loaded the built-in macros.")});define("repl",["utils","markup","twinescript/compiler","twinescript/environ"],function(Utils,TwineMarkup,Compiler,Environ){"use strict";window.REPL=function(a){var r=Compiler(TwineMarkup.lex("(print:"+a+")"));console.log(r);return Environ({}).eval(r)};window.LEX=function(a){var r=TwineMarkup.lex(a);return r.length===1?r[0]:r}});require.config({paths:{jquery:"../node_modules/jquery/dist/jquery",almond:"../node_modules/almond/almond","es6-shim":"../node_modules/es6-shim/es6-shim",requestAnimationFrame:"../node_modules/requestanimationframe/app/requestAnimationFrame",jqueryplugins:"utils/jqueryplugins",markup:"./markup/markup",lexer:"./markup/lexer",patterns:"./markup/patterns"},deps:["jquery","es6-shim","jqueryplugins"]});require(["jquery","renderer","state","engine","passages","utils/selectors","macrolib","repl"],function($,Renderer,State,Engine,Passages,Selectors){"use strict";function _eval(text){return eval(text+"")}function testPlayCleanup(){["_","Backbone","Store","Mn","Marionette","saveAs","FastClick","JSZip","SVG","requestAnimFrame","UUID","XDate","CodeMirror","ui","nwui","AppPref","Passage","StoryFormat","Story","AppPrefCollection","PassageCollection","StoryCollection","StoryFormatCollection","WelcomeView","StoryItemView","StoryListView","PassageItemView","StoryEditView","TwineRouter","TransRegion","TwineApp","app","storyFormat"].forEach(function(name){try{delete window[name]}catch(e){window[name]=undefined}})}var _installHandlers=function installHandlers(){var html=$(document.documentElement),debugHTML="<tw-debugger><button class='show-invisibles'>&#9903; Debug View</button></tw-debugger>";html.on("keydown",function(event){if(event.which===13&&event.target.getAttribute("tabindex")==="0"){$(event.target).trigger("click")}});if(Engine.options.debug){$(document.body).append(debugHTML);$(".show-invisibles").click(function(){html.toggleClass("debug-mode").is(".debug-mode")})}_installHandlers=null};(function(oldOnError){window.onerror=function(message,_,__,___,error){var stack=error&&error.stack&&"\n"+error.stack.replace(/\([^\)]+\)/g,"")+"\n"||"("+message+")\n";alert("Sorry to interrupt, but this page's code has got itself in a mess. "+stack+"(This is probably due to a bug in the Twine game engine.)");window.onerror=oldOnError;if(typeof oldOnError==="function"){oldOnError.apply(undefined,arguments)}}})(window.onerror);$(function(){var header=$(Selectors.storyData);if(header.length===0){return}if("TwineApp"in window){testPlayCleanup()}var options=header.attr("options");if(options){options.split(/\s/).forEach(function(b){Renderer.options[b]=Engine.options[b]=true})}var startPassage=header.attr("startnode");Renderer.options.ifid=Engine.options.ifid=header.attr("ifid");if(!startPassage){startPassage=[].reduce.call($(Selectors.passageData),function(id,el){var pid=el.getAttribute("pid");return pid<id?pid:id},Infinity)}startPassage=$(Selectors.passageData+"[pid="+startPassage+"]").attr("name");_installHandlers();$(Selectors.script).each(function(i){try{_eval($(this).html())}catch(e){alert("There is a problem with this story's script (#"+(i+1)+"):\n\n"+e.message)}});$(Selectors.stylesheet).each(function(i){$(document.head).append('<style data-title="Story stylesheet '+(i+1)+'">'+$(this).html())});if(window.location.hash&&!window.location.hash.includes("stories")){if(State.load(window.location.hash)){Engine.showPassage(State.passage);return}}Engine.goToPassage(startPassage)})});define("harlowe",function(){});require(["harlowe"])})();</script>
  135.  
  136.  
  137. </body>
  138. </html>
Add Comment
Please, Sign In to add comment