|
|
- /* Riot v3.3.1, @license MIT */
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.riot=t()}(this,function(){"use strict";function e(e){return gt.test(e)}function t(e){return xt.test(e)}function r(e){return typeof e===ut}function n(e){return e&&typeof e===st}function i(e){return typeof e===at}function o(e){return typeof e===ot}function s(e){return i(e)||null===e||""===e}function a(e){return Array.isArray(e)||e instanceof Array}function u(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return i(e[t])||r&&r.writable}function c(e){return dt.test(e)}function l(e,t){return(t||document).querySelectorAll(e)}function p(e,t){return(t||document).querySelector(e)}function f(){return document.createDocumentFragment()}function h(){return document.createTextNode("")}function d(e,t){return t?document.createElementNS("http://www.w3.org/2000/svg","svg"):document.createElement(e)}function g(e){if(e.outerHTML)return e.outerHTML;var t=d("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function m(e,t){if(i(e.innerHTML)){var r=(new DOMParser).parseFromString(t,"application/xml"),n=e.ownerDocument.importNode(r.documentElement,!0);e.appendChild(n)}else e.innerHTML=t}function v(e,t){e.removeAttribute(t)}function x(e,t){return e.getAttribute(t)}function y(e,t,r){var n=lt.exec(t);n&&n[1]?e.setAttributeNS(ct,n[1],r):e.setAttribute(t,r)}function b(e,t,r){e.insertBefore(t,r.parentNode&&r)}function w(e,t){if(e)for(var r;r=mt.exec(e);)t(r[1].toLowerCase(),r[2]||r[3]||r[4])}function _(e,t,r){if(e){var n,i=t(e,r);if(i===!1)return;for(e=e.firstChild;e;)n=e.nextSibling,_(e,t,i),e=n}}function O(e,t){for(var r,n=e?e.length:0,i=0;i<n;++i)r=e[i],t(r,i)===!1&&i--;return e}function C(e,t){return e.indexOf(t)!==-1}function N(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function j(e,t){return e.slice(0,t.length)===t}function E(e,t,r,n){return Object.defineProperty(e,t,S({value:r,enumerable:!1,writable:!1,configurable:!0},n)),e}function S(e){for(var t,r=arguments,n=1;n<r.length;++n)if(t=r[n])for(var i in t)u(e,i)&&(e[i]=t[i]);return e}function T(e,t,r){var n=this.__.parent,i=this.__.item;if(!i)for(;n&&!i;)i=n.__.item,n=n.__.parent;if(u(r,"currentTarget")&&(r.currentTarget=e),u(r,"target")&&(r.target=r.srcElement),u(r,"which")&&(r.which=r.charCode||r.keyCode),r.item=i,t.call(this,r),!r.preventUpdate){var o=se(this);o.isMounted&&o.update()}}function L(e,t,r,n){var i,o=T.bind(n,r,t);return r.addEventListener?(r[e]=null,i=e.replace(Mt,""),r._riotEvents||(r._riotEvents={}),r._riotEvents[e]&&r.removeEventListener(i,r._riotEvents[e]),r._riotEvents[e]=o,void r.addEventListener(i,o,!1)):void(r[e]=o)}function A(e,t){var r,n,i,o,s=Tt(e.value,t);return e.tag&&e.tagName===s?void e.tag.update():(n="VIRTUAL"===e.dom.tagName,e.tag&&(n&&(i=e.tag.__.head,o=h(),i.parentNode.insertBefore(o,i)),e.tag.unmount(!0)),e.impl=Qe[s],r={root:e.dom,parent:t,hasImpl:!0,tagName:s},e.tag=oe(e.impl,r,e.dom.innerHTML,t),O(e.attrs,function(t){return y(e.tag.root,t.name,t.value)}),e.tagName=s,e.tag.mount(),n&&de(e.tag,o||e.tag.root),void(t.__.onUnmount=function(){var t=e.tag.opts.dataIs,r=e.tag.parent.tags,n=e.tag.__.parent.tags;pe(r,t,e.tag),pe(n,t,e.tag),e.tag.unmount()}))}function R(e){if(!this.root||!x(this.root,"virtualized")){var t,n=e.dom,o=e.attr,s=C([nt,it],o),a=Tt(e.expr,this),u="riot-value"===o,c=e.root&&"VIRTUAL"===e.root.tagName,l=n&&(e.parent||n.parentNode);if(e.bool?a=!!a&&o:(i(a)||null===a)&&(a=""),e._riot_id)return void(e.isMounted?e.update():(e.mount(),c&&de(e,e.root)));if(t=e.value,e.value=a,e.update)return void e.update();if(e.isRtag&&a)return A(e,this);if(t!==a&&(!u||n.value!==a)){if(!o)return a+="",void(l&&(e.parent=l,"TEXTAREA"===l.tagName?(l.value=a,yt||(n.nodeValue=a)):n.nodeValue=a));if(e.isAttrRemoved&&a||(v(n,o),e.isAttrRemoved=!0),r(a))L(o,a,n,this);else if(s)o===it&&(a=!a),n.style.display=a?"":"none";else if(u)n.value=a;else if(j(o,Je)&&o!==Ye)o=o.slice(Je.length),vt[o]&&(o=vt[o]),null!=a&&y(n,o,a);else{if(e.bool&&(n[o]=a,!a))return;(0===a||a&&typeof a!==st)&&y(n,o,a)}}}}function M(e){O(
- loose:!0}],"transform-es2015-parameters",["transform-es2015-destructuring",{loose:!0}],"transform-es2015-block-scoping","transform-es2015-typeof-symbol",["transform-es2015-modules-commonjs",{allowTopLevelThis:!0}],["transform-regenerator",{async:!1,asyncGenerators:!1}]]},r)).code},buble:function(e,r,i){return r=n({source:i,modules:!1},r),t("buble").transform(e,r).code},coffee:function(e,r){return t("CoffeeScript").compile(e,n({bare:!0},r))},livescript:function(e,r){return t("livescript").compile(e,n({bare:!0,header:!1},r))},typescript:function(e,r){return t("typescript")(e,r)},none:function(e){return e}},o.js.javascript=o.js.none,o.js.coffeescript=o.js.coffee,o._req=r,o.utils={extend:n},o}(window||global),ur=ar.utils.extend,cr=/"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source,lr=St.R_STRINGS.source,pr=/ *([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,fr=RegExp(/<!--(?!>)[\S\s]*?-->/.source+"|"+cr,"g"),hr=/<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^"'\/>]*(?:(?:"[^"]*"|'[^']*'|\/[^>])[^'"\/>]*)*)|\s*)(\/?)>/g,dr=/>[ \t]+<(-?[A-Za-z]|\/[-A-Za-z])/g,gr=["style","src","d","value"],mr=/^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,vr=/<pre(?:\s+(?:[^">]*|"[^"]*")*)?>([\S\s]+?)<\/pre\s*>/gi,xr=/^"(?:number|date(?:time)?|time|month|email|color)\b/i,yr=/^\s*import(?!\w)(?:(?:\s|[^\s'"])*)['|"].*\n?/gm,br=/[ \t]+$/gm,wr=xe(/@#\d/,"x01"),_r=xe(/@#(\d+)/g,"x01"),Or="#",Cr="⁗",Nr='"',jr="'",Er=/^[ \t]*(((?:async|\*)\s*)?([$_A-Za-z][$\w]*))\s*\([^()]*\)\s*{/m,Sr=RegExp("[{}]|"+St.S_QBLOCKS,"g"),Tr=RegExp(St.R_MLCOMMS.source+"|//[^\r\n]*|"+St.S_QBLOCKS,"g"),Lr=RegExp("([{}]|^)[; ]*((?:[^@ ;{}][^{}]*)?[^@ ;{}:] ?)(?={)|"+cr,"g"),Ar=/\stype\s*=\s*(?:(['"])(.+?)\1|(\S+))/i,Rr="\\s*=\\s*("+lr+"|{[^}]+}|\\S+)",Mr=/\/>\n|^<(?:\/?-?[A-Za-z][-\w\xA0-\xFF]*\s*|-?[A-Za-z][-\w\xA0-\xFF]*\s+[-\w:\xA0-\xFF][\S\s]*?)>\n/,kr=RegExp(/^([ \t]*)<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^'"\/>]+(?:(?:@|\/[^>])[^'"\/>]*)*)|\s*)?(?:\/>|>[ \t]*\n?([\S\s]*)^\1<\/\2\s*>|>(.*)<\/\2\s*>)/.source.replace("@",lr),"gim"),Ir=/<script(\s+[^>]*)?>\n?([\S\s]*?)<\/script\s*>/gi,Hr=/<style(\s+[^>]*)?>\n?([\S\s]*?)<\/style\s*>/gi,$r="v3.2.1",Fr={compile:Be,compileHTML:Ce,compileCSS:Le,compileJS:Ee,parsers:ar,version:$r},Pr=Fr.parsers,zr=function(e,t,i){if(typeof e===ot){if(n(t)&&(i=t,t=!1),/^\s*</m.test(e)){var o=Fr.compile(e,i);return t!==!0&&Ue(o),r(t)&&t(o,e,i),o}Ve(e,function(e,r,n){var i=Fr.compile(e,r,n);Ue(i,n),t&&t(i,e,r)},i)}else if(a(e)){var s=e.length;e.forEach(function(e){Ve(e,function(e,r,n){var i=Fr.compile(e,r,n);Ue(i,n),s--,!s&&t&&t(i,e,r)},i)})}else{if(r(e)?(i=t,t=e):(i=e,t=void 0),jt)return t&&t();Nt?t&&Nt.on("ready",t):(Nt=Lt(),De(t,i))}},Br=S({},sr,{mount:qe,compile:zr,parsers:Pr});return Br});
|