From 8b28c1f5a1622f5123a5b8ece0d9d94a32d9aa4c Mon Sep 17 00:00:00 2001 From: squidfunk Date: Wed, 25 Jan 2017 00:43:01 +0100 Subject: [PATCH] Proof-of-concept search highlighting --- lib/providers/jsx.js | 6 ++ ...a377364e7.js => application-9f4632d68f.js} | 10 +-- material/base.html | 2 +- src/assets/javascripts/application.js | 30 -------- .../components/Material/Search/Result.jsx | 68 ++++++++++++++++++- 5 files changed, 77 insertions(+), 39 deletions(-) rename material/assets/javascripts/{application-5a377364e7.js => application-9f4632d68f.js} (89%) diff --git a/lib/providers/jsx.js b/lib/providers/jsx.js index 371f7c8fe..0b80540b3 100644 --- a/lib/providers/jsx.js +++ b/lib/providers/jsx.js @@ -24,6 +24,8 @@ * Definition * ------------------------------------------------------------------------- */ +/* eslint-disable no-underscore-dangle */ + export default /* JSX */ { /** @@ -56,6 +58,10 @@ export default /* JSX */ { } else if (Array.isArray(node)) { iterateChildNodes(node) + /* Append raw HTML */ + } else if (typeof node.__html !== "undefined") { + el.innerHTML += node.__html + /* Append regular nodes */ } else { el.appendChild(node) diff --git a/material/assets/javascripts/application-5a377364e7.js b/material/assets/javascripts/application-9f4632d68f.js similarity index 89% rename from material/assets/javascripts/application-5a377364e7.js rename to material/assets/javascripts/application-9f4632d68f.js index 9787f3c61..92cbcde61 100644 --- a/material/assets/javascripts/application-5a377364e7.js +++ b/material/assets/javascripts/application-9f4632d68f.js @@ -1,11 +1,11 @@ -var Application=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){n(1),n(65),n(66),t.exports=n(67)},function(t,e,n){"use strict";n(2),n(22),n(48),n(52),t.exports=n(21).Promise},function(t,e,n){"use strict";var r=n(3),o={};o[n(5)("toStringTag")]="z",o+""!="[object z]"&&n(9)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){"use strict";var r=n(4),o=n(5)("toStringTag"),i="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e){"use strict";var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";var r=n(6)("wks"),o=n(8),i=n(7).Symbol,s="function"==typeof i,a=t.exports=function(t){return r[t]||(r[t]=s&&i[t]||(s?i:o)("Symbol."+t))};a.store=r},function(t,e,n){"use strict";var r=n(7),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){"use strict";var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){"use strict";var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";var r=n(7),o=n(10),i=n(20),s=n(8)("src"),a="toString",u=Function[a],c=(""+u).split(a);n(21).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(u&&(i(n,s)||o(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,a,function(){return"function"==typeof this&&this[s]||u.call(this)})},function(t,e,n){"use strict";var r=n(11),o=n(19);t.exports=n(15)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";var r=n(12),o=n(14),i=n(18),s=Object.defineProperty;e.f=n(15)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return"object"===("undefined"==typeof t?"undefined":n(t))?null!==t:"function"==typeof t}},function(t,e,n){"use strict";t.exports=!n(15)&&!n(16)(function(){return 7!=Object.defineProperty(n(17)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";t.exports=!n(16)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";var r=n(13),o=n(7).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){"use strict";var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){"use strict";var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";var r=n(23)(!0);n(26)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(24),o=n(25);t.exports=function(t){return function(e,n){var i,s,a=String(o(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(i=a.charCodeAt(u),i<55296||i>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):i:t?a.slice(u,u+2):(i-55296<<10)+(s-56320)+65536)}}},function(t,e){"use strict";var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){"use strict";t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=n(27),o=n(28),i=n(9),s=n(10),a=n(20),u=n(31),c=n(32),l=n(45),f=n(46),h=n(5)("iterator"),d=!([].keys&&"next"in[].keys()),p="@@iterator",v="keys",y="values",m=function(){return this};t.exports=function(t,e,n,g,b,_,w){c(n,e,g);var x,S,E,k=function(t){if(!d&&t in P)return P[t];switch(t){case v:return function(){return new n(this,t)};case y:return function(){return new n(this,t)}}return function(){return new n(this,t)}},T=e+" Iterator",O=b==y,C=!1,P=t.prototype,A=P[h]||P[p]||b&&P[b],M=A||k(b),j=b?O?k("entries"):M:void 0,L="Array"==e?P.entries||A:A;if(L&&(E=f(L.call(new t)),E!==Object.prototype&&(l(E,T,!0),r||a(E,h)||s(E,h,m))),O&&A&&A.name!==y&&(C=!0,M=function(){return A.call(this)}),r&&!w||!d&&!C&&P[h]||s(P,h,M),u[e]=M,u[T]=m,b)if(x={values:O?M:k(y),keys:_?M:k(v),entries:j},w)for(S in x)S in P||i(P,S,x[S]);else o(o.P+o.F*(d||C),e,x);return x}},function(t,e){"use strict";t.exports=!1},function(t,e,n){"use strict";var r=n(7),o=n(21),i=n(10),s=n(9),a=n(29),u="prototype",c=function t(e,n,c){var l,f,h,d,p=e&t.F,v=e&t.G,y=e&t.S,m=e&t.P,g=e&t.B,b=v?r:y?r[n]||(r[n]={}):(r[n]||{})[u],_=v?o:o[n]||(o[n]={}),w=_[u]||(_[u]={});v&&(c=n);for(l in c)f=!p&&b&&void 0!==b[l],h=(f?b:c)[l],d=g&&f?a(h,r):m&&"function"==typeof h?a(Function.call,h):h,b&&s(b,l,h,e&t.U),_[l]!=h&&i(_,l,d),m&&w[l]!=h&&(w[l]=h)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){"use strict";var r=n(30);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){"use strict";t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){"use strict";t.exports={}},function(t,e,n){"use strict";var r=n(33),o=n(19),i=n(45),s={};n(10)(s,n(5)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){"use strict";var r=n(12),o=n(34),i=n(43),s=n(42)("IE_PROTO"),a=function(){},u="prototype",c=function(){var t,e=n(17)("iframe"),r=i.length,o="<",s=">";for(e.style.display="none",n(44).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+s+"document.F=Object"+o+"/script"+s),t.close(),c=t.F;r--;)delete c[u][i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[u]=r(t),n=new a,a[u]=null,n[s]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){"use strict";var r=n(11),o=n(12),i=n(35);t.exports=n(15)?Object.defineProperties:function(t,e){o(t);for(var n,s=i(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){"use strict";var r=n(36),o=n(43);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(20),o=n(37),i=n(39)(!1),s=n(42)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){"use strict";var r=n(38),o=n(25);t.exports=function(t){return r(o(t))}},function(t,e,n){"use strict";var r=n(4);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var r=n(37),o=n(40),i=n(41);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=o(u.length),l=i(s,c);if(t&&n!=n){for(;c>l;)if(a=u[l++],a!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){"use strict";var r=n(24),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){"use strict";var r=n(24),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){"use strict";var r=n(6)("keys"),o=n(8);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){"use strict";t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){"use strict";t.exports=n(7).document&&document.documentElement},function(t,e,n){"use strict";var r=n(11).f,o=n(20),i=n(5)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(20),o=n(47),i=n(42)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){"use strict";var r=n(25);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";for(var r=n(49),o=n(9),i=n(7),s=n(10),a=n(31),u=n(5),c=u("iterator"),l=u("toStringTag"),f=a.Array,h=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],d=0;d<5;d++){var p,v=h[d],y=i[v],m=y&&y.prototype;if(m){m[c]||s(m,c,f),m[l]||s(m,l,v),a[v]=f;for(p in r)m[p]||o(m,p,r[p],!0)}}},function(t,e,n){"use strict";var r=n(50),o=n(51),i=n(31),s=n(37);t.exports=n(26)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";var r=n(5)("unscopables"),o=Array.prototype;void 0==o[r]&&n(10)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,e){"use strict";t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r,o,i,s=n(27),a=n(7),u=n(29),c=n(3),l=n(28),f=n(13),h=n(30),d=n(53),p=n(54),v=n(58),y=n(59).set,m=n(61)(),g="Promise",b=a.TypeError,_=a.process,w=a[g],_=a.process,x="process"==c(_),S=function(){},E=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[n(5)("species")]=function(t){t(S,S)};return(x||"function"==typeof PromiseRejectionEvent)&&t.then(S)instanceof e}catch(t){}}(),k=function(t,e){return t===e||t===w&&e===i},T=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},O=function(t){return k(w,t)?new C(t):new o(t)},C=o=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw b("Bad Promise constructor");e=t,n=r}),this.resolve=h(e),this.reject=h(n)},P=function(t){try{t()}catch(t){return{error:t}}},A=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,o=1==t._s,i=0,s=function(e){var n,i,s=o?e.ok:e.fail,a=e.resolve,u=e.reject,c=e.domain;try{s?(o||(2==t._h&&L(t),t._h=1),s===!0?n=r:(c&&c.enter(),n=s(r),c&&c.exit()),n===e.promise?u(b("Promise-chain cycle")):(i=T(n))?i.call(n,a,u):a(n)):u(r)}catch(t){u(t)}};n.length>i;)s(n[i++]);t._c=[],t._n=!1,e&&!t._h&&M(t)})}},M=function(t){y.call(a,function(){var e,n,r,o=t._v;if(j(t)&&(e=P(function(){x?_.emit("unhandledRejection",o,t):(n=a.onunhandledrejection)?n({promise:t,reason:o}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=x||j(t)?2:1),t._a=void 0,e)throw e.error})},j=function t(e){if(1==e._h)return!1;for(var n,r=e._a||e._c,o=0;r.length>o;)if(n=r[o++],n.fail||!t(n.promise))return!1;return!0},L=function(t){y.call(a,function(){var e;x?_.emit("rejectionHandled",t):(e=a.onrejectionhandled)&&e({promise:t,reason:t._v})})},F=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),A(e,!0))},N=function t(e){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw b("Promise can't be resolved itself");(n=T(e))?m(function(){var o={_w:r,_d:!1};try{n.call(e,u(t,o,1),u(F,o,1))}catch(t){F.call(o,t)}}):(r._v=e,r._s=1,A(r,!1))}catch(t){F.call({_w:r,_d:!1},t)}}};E||(w=function(t){d(this,w,g,"_h"),h(t),r.call(this);try{t(u(N,this,1),u(F,this,1))}catch(t){F.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(62)(w.prototype,{then:function(t,e){var n=O(v(this,w));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=x?_.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),C=function(){var t=new r;this.promise=t,this.resolve=u(N,t,1),this.reject=u(F,t,1)}),l(l.G+l.W+l.F*!E,{Promise:w}),n(45)(w,g),n(63)(g),i=n(21)[g],l(l.S+l.F*!E,g,{reject:function(t){var e=O(this),n=e.reject;return n(t),e.promise}}),l(l.S+l.F*(s||!E),g,{resolve:function(t){if(t instanceof w&&k(t.constructor,this))return t;var e=O(this),n=e.resolve;return n(t),e.promise}}),l(l.S+l.F*!(E&&n(64)(function(t){w.all(t).catch(S)})),g,{all:function(t){var e=this,n=O(e),r=n.resolve,o=n.reject,i=P(function(){var n=[],i=0,s=1;p(t,!1,function(t){var a=i++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[a]=t,--s||r(n))},o)}),--s||r(n)});return i&&o(i.error),n.promise},race:function(t){var e=this,n=O(e),r=n.reject,o=P(function(){p(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o&&r(o.error),n.promise}})},function(t,e){"use strict";t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){"use strict";var r=n(29),o=n(55),i=n(56),s=n(12),a=n(40),u=n(57),c={},l={},f=t.exports=function(t,e,n,f,h){var d,p,v,y,m=h?function(){return t}:u(t),g=r(n,f,e?2:1),b=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(d=a(t.length);d>b;b++)if(y=e?g(s(p=t[b])[0],p[1]):g(t[b]),y===c||y===l)return y}else for(v=m.call(t);!(p=v.next()).done;)if(y=o(v,g,p.value,e),y===c||y===l)return y};f.BREAK=c,f.RETURN=l},function(t,e,n){"use strict";var r=n(12);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){"use strict";var r=n(31),o=n(5)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){"use strict";var r=n(3),o=n(5)("iterator"),i=n(31);t.exports=n(21).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){"use strict";var r=n(12),o=n(30),i=n(5)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||void 0==(n=r(s)[i])?e:o(n)}},function(t,e,n){"use strict";var r,o,i,s=n(29),a=n(60),u=n(44),c=n(17),l=n(7),f=l.process,h=l.setImmediate,d=l.clearImmediate,p=l.MessageChannel,v=0,y={},m="onreadystatechange",g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){g.call(t.data)};h&&d||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++v]=function(){a("function"==typeof t?t:Function(t),e)},r(v),v},d=function(t){delete y[t]},"process"==n(4)(f)?r=function(t){f.nextTick(s(g,t,1))}:p?(o=new p,i=o.port2,o.port1.onmessage=b,r=s(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):r=m in c("script")?function(t){u.appendChild(c("script"))[m]=function(){u.removeChild(this),g.call(t)}}:function(t){setTimeout(s(g,t,1),0)}),t.exports={set:h,clear:d}},function(t,e){"use strict";t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){"use strict";var r=n(7),o=n(59).set,i=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(4)(s);t.exports=function(){var t,e,n,c=function(){var r,o;for(u&&(r=s.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(i){var l=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}else if(a&&a.resolve){var h=a.resolve();n=function(){h.then(c)}}else n=function(){o.call(r,c)};return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e,n){"use strict";var r=n(9);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){"use strict";var r=n(7),o=n(11),i=n(15),s=n(5)("species");t.exports=function(t){var e=r[t];i&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){"use strict";var r=n(5)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(t){}return n}},function(t,e){"use strict";try{var n=new window.CustomEvent("test");if(n.preventDefault(),n.defaultPrevented!==!0)throw new Error("Could not prevent default")}catch(t){var r=function(t,e){var n,r;return e=e||{bubbles:!1,cancelable:!1,detail:void 0},n=document.createEvent("CustomEvent"),n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(t){this.defaultPrevented=!0}},n};r.prototype=window.Event.prototype,window.CustomEvent=r}},function(t,e){"use strict";!function(t){function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function r(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return m.iterable&&(e[Symbol.iterator]=function(){return e}),e}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function s(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function a(t){var e=new FileReader,n=s(e);return e.readAsArrayBuffer(t),n}function u(t){var e=new FileReader,n=s(e);return e.readAsText(t),n}function c(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?e:t}function d(t,e){e=e||{};var n=e.body;if("string"==typeof t)this.url=t;else{if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=h(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}}),e}function v(t){var e=new o;return t.split("\r\n").forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}}),e}function y(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var m={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(m.arrayBuffer)var g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=function(t){return t&&DataView.prototype.isPrototypeOf(t)},_=ArrayBuffer.isView||function(t){return t&&g.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,r){t=e(t),r=n(r);var o=this.map[t];this.map[t]=o?o+","+r:r},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,r){this.map[e(t)]=n(r)},o.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),r(t)},o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),r(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),r(t)},m.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},f.call(d.prototype),f.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];y.redirect=function(t,e){if(x.indexOf(e)===-1)throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=d,t.Response=y,t.fetch=function(t,e){return new Promise(function(n,r){var o=new d(t,e),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:v(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;n(new y(e,t))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&m.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n1&&t.pop(),t.concat(e)},[]),n=e.map(function(t){return t.text=t.text.replace(/\n/g," ").replace(/\s+/g," ").replace(/\s+([,.:;!?])/g,function(t,e){return e}),t});return n})})).listen(),new c.default.Event.MatchMedia("(max-width: 1219px)",new c.default.Event.Listener("[data-md-component=overlay]","touchstart",function(t){return t.preventDefault()})),new c.default.Event.MatchMedia("(max-width: 959px)",new c.default.Event.Listener("[data-md-component=navigation] [href^='#']","click",function(){var t=document.querySelector("[data-md-toggle=drawer]");t.checked&&(t.checked=!1,t.dispatchEvent(new CustomEvent("change")))})),new c.default.Event.Listener("[data-md-toggle=search]","change",function(t){setTimeout(function(t){var e=document.forms.search.query;t.checked&&e.focus()},400,t.target)}).listen(),new c.default.Event.MatchMedia("(min-width: 960px)",new c.default.Event.Listener(document.forms.search.query,"focus",function(){var t=document.querySelector("[data-md-toggle=search]");t.checked||(t.checked=!0,t.dispatchEvent(new CustomEvent("change")))})),new c.default.Event.MatchMedia("(min-width: 960px)",new c.default.Event.Listener(document.body,"click",function(){var t=document.querySelector("[data-md-toggle=search]");t.checked&&(t.checked=!1,t.dispatchEvent(new CustomEvent("change")))})),new c.default.Event.Listener(window,"keyup",function(t){var e=t.keyCode||t.which;if(27===e){var n=document.querySelector("[data-md-toggle=search]");n.checked&&(n.checked=!1,n.dispatchEvent(new CustomEvent("change")),document.forms.search.query.blur())}}).listen(),new c.default.Event.MatchMedia("(min-width: 960px)",new c.default.Event.Listener("[data-md-toggle=search]","click",function(t){return t.stopPropagation()})),new c.default.Event.MatchMedia("(min-width: 960px)",new c.default.Event.Listener("[data-md-component=search]","click",function(t){return t.stopPropagation()})),function(){var t=document.querySelector("[data-md-source]");if(!t)return Promise.resolve([]);switch(t.dataset.mdSource){case"github":return new c.default.Source.Adapter.GitHub(t).fetch();default:return Promise.resolve([])}}().then(function(t){var e=document.querySelectorAll("[data-md-source]");Array.prototype.forEach.call(e,function(e){new c.default.Source.Repository(e).initialize(t)})})}}]),t}();e.default=l,t.exports=e.default},function(t,e,n){var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){"use strict";/** +var Application=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){n(1),n(65),n(66),t.exports=n(67)},function(t,e,n){"use strict";n(2),n(22),n(48),n(52),t.exports=n(21).Promise},function(t,e,n){"use strict";var r=n(3),o={};o[n(5)("toStringTag")]="z",o+""!="[object z]"&&n(9)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){"use strict";var r=n(4),o=n(5)("toStringTag"),i="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e){"use strict";var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";var r=n(6)("wks"),o=n(8),i=n(7).Symbol,s="function"==typeof i,a=t.exports=function(t){return r[t]||(r[t]=s&&i[t]||(s?i:o)("Symbol."+t))};a.store=r},function(t,e,n){"use strict";var r=n(7),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){"use strict";var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){"use strict";var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";var r=n(7),o=n(10),i=n(20),s=n(8)("src"),a="toString",u=Function[a],c=(""+u).split(a);n(21).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(u&&(i(n,s)||o(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,a,function(){return"function"==typeof this&&this[s]||u.call(this)})},function(t,e,n){"use strict";var r=n(11),o=n(19);t.exports=n(15)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";var r=n(12),o=n(14),i=n(18),s=Object.defineProperty;e.f=n(15)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return"object"===("undefined"==typeof t?"undefined":n(t))?null!==t:"function"==typeof t}},function(t,e,n){"use strict";t.exports=!n(15)&&!n(16)(function(){return 7!=Object.defineProperty(n(17)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";t.exports=!n(16)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";var r=n(13),o=n(7).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){"use strict";var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){"use strict";var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";var r=n(23)(!0);n(26)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(24),o=n(25);t.exports=function(t){return function(e,n){var i,s,a=String(o(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(i=a.charCodeAt(u),i<55296||i>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):i:t?a.slice(u,u+2):(i-55296<<10)+(s-56320)+65536)}}},function(t,e){"use strict";var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){"use strict";t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=n(27),o=n(28),i=n(9),s=n(10),a=n(20),u=n(31),c=n(32),l=n(45),f=n(46),d=n(5)("iterator"),h=!([].keys&&"next"in[].keys()),p="@@iterator",v="keys",y="values",m=function(){return this};t.exports=function(t,e,n,g,b,_,w){c(n,e,g);var x,S,E,k=function(t){if(!h&&t in P)return P[t];switch(t){case v:return function(){return new n(this,t)};case y:return function(){return new n(this,t)}}return function(){return new n(this,t)}},T=e+" Iterator",O=b==y,C=!1,P=t.prototype,A=P[d]||P[p]||b&&P[b],M=A||k(b),j=b?O?k("entries"):M:void 0,L="Array"==e?P.entries||A:A;if(L&&(E=f(L.call(new t)),E!==Object.prototype&&(l(E,T,!0),r||a(E,d)||s(E,d,m))),O&&A&&A.name!==y&&(C=!0,M=function(){return A.call(this)}),r&&!w||!h&&!C&&P[d]||s(P,d,M),u[e]=M,u[T]=m,b)if(x={values:O?M:k(y),keys:_?M:k(v),entries:j},w)for(S in x)S in P||i(P,S,x[S]);else o(o.P+o.F*(h||C),e,x);return x}},function(t,e){"use strict";t.exports=!1},function(t,e,n){"use strict";var r=n(7),o=n(21),i=n(10),s=n(9),a=n(29),u="prototype",c=function t(e,n,c){var l,f,d,h,p=e&t.F,v=e&t.G,y=e&t.S,m=e&t.P,g=e&t.B,b=v?r:y?r[n]||(r[n]={}):(r[n]||{})[u],_=v?o:o[n]||(o[n]={}),w=_[u]||(_[u]={});v&&(c=n);for(l in c)f=!p&&b&&void 0!==b[l],d=(f?b:c)[l],h=g&&f?a(d,r):m&&"function"==typeof d?a(Function.call,d):d,b&&s(b,l,d,e&t.U),_[l]!=d&&i(_,l,h),m&&w[l]!=d&&(w[l]=d)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){"use strict";var r=n(30);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){"use strict";t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){"use strict";t.exports={}},function(t,e,n){"use strict";var r=n(33),o=n(19),i=n(45),s={};n(10)(s,n(5)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){"use strict";var r=n(12),o=n(34),i=n(43),s=n(42)("IE_PROTO"),a=function(){},u="prototype",c=function(){var t,e=n(17)("iframe"),r=i.length,o="<",s=">";for(e.style.display="none",n(44).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+s+"document.F=Object"+o+"/script"+s),t.close(),c=t.F;r--;)delete c[u][i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[u]=r(t),n=new a,a[u]=null,n[s]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){"use strict";var r=n(11),o=n(12),i=n(35);t.exports=n(15)?Object.defineProperties:function(t,e){o(t);for(var n,s=i(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){"use strict";var r=n(36),o=n(43);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(20),o=n(37),i=n(39)(!1),s=n(42)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){"use strict";var r=n(38),o=n(25);t.exports=function(t){return r(o(t))}},function(t,e,n){"use strict";var r=n(4);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var r=n(37),o=n(40),i=n(41);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=o(u.length),l=i(s,c);if(t&&n!=n){for(;c>l;)if(a=u[l++],a!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){"use strict";var r=n(24),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){"use strict";var r=n(24),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){"use strict";var r=n(6)("keys"),o=n(8);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){"use strict";t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){"use strict";t.exports=n(7).document&&document.documentElement},function(t,e,n){"use strict";var r=n(11).f,o=n(20),i=n(5)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(20),o=n(47),i=n(42)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){"use strict";var r=n(25);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";for(var r=n(49),o=n(9),i=n(7),s=n(10),a=n(31),u=n(5),c=u("iterator"),l=u("toStringTag"),f=a.Array,d=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],h=0;h<5;h++){var p,v=d[h],y=i[v],m=y&&y.prototype;if(m){m[c]||s(m,c,f),m[l]||s(m,l,v),a[v]=f;for(p in r)m[p]||o(m,p,r[p],!0)}}},function(t,e,n){"use strict";var r=n(50),o=n(51),i=n(31),s=n(37);t.exports=n(26)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";var r=n(5)("unscopables"),o=Array.prototype;void 0==o[r]&&n(10)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,e){"use strict";t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r,o,i,s=n(27),a=n(7),u=n(29),c=n(3),l=n(28),f=n(13),d=n(30),h=n(53),p=n(54),v=n(58),y=n(59).set,m=n(61)(),g="Promise",b=a.TypeError,_=a.process,w=a[g],_=a.process,x="process"==c(_),S=function(){},E=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[n(5)("species")]=function(t){t(S,S)};return(x||"function"==typeof PromiseRejectionEvent)&&t.then(S)instanceof e}catch(t){}}(),k=function(t,e){return t===e||t===w&&e===i},T=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},O=function(t){return k(w,t)?new C(t):new o(t)},C=o=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw b("Bad Promise constructor");e=t,n=r}),this.resolve=d(e),this.reject=d(n)},P=function(t){try{t()}catch(t){return{error:t}}},A=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,o=1==t._s,i=0,s=function(e){var n,i,s=o?e.ok:e.fail,a=e.resolve,u=e.reject,c=e.domain;try{s?(o||(2==t._h&&L(t),t._h=1),s===!0?n=r:(c&&c.enter(),n=s(r),c&&c.exit()),n===e.promise?u(b("Promise-chain cycle")):(i=T(n))?i.call(n,a,u):a(n)):u(r)}catch(t){u(t)}};n.length>i;)s(n[i++]);t._c=[],t._n=!1,e&&!t._h&&M(t)})}},M=function(t){y.call(a,function(){var e,n,r,o=t._v;if(j(t)&&(e=P(function(){x?_.emit("unhandledRejection",o,t):(n=a.onunhandledrejection)?n({promise:t,reason:o}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=x||j(t)?2:1),t._a=void 0,e)throw e.error})},j=function t(e){if(1==e._h)return!1;for(var n,r=e._a||e._c,o=0;r.length>o;)if(n=r[o++],n.fail||!t(n.promise))return!1;return!0},L=function(t){y.call(a,function(){var e;x?_.emit("rejectionHandled",t):(e=a.onrejectionhandled)&&e({promise:t,reason:t._v})})},F=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),A(e,!0))},N=function t(e){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw b("Promise can't be resolved itself");(n=T(e))?m(function(){var o={_w:r,_d:!1};try{n.call(e,u(t,o,1),u(F,o,1))}catch(t){F.call(o,t)}}):(r._v=e,r._s=1,A(r,!1))}catch(t){F.call({_w:r,_d:!1},t)}}};E||(w=function(t){h(this,w,g,"_h"),d(t),r.call(this);try{t(u(N,this,1),u(F,this,1))}catch(t){F.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(62)(w.prototype,{then:function(t,e){var n=O(v(this,w));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=x?_.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),C=function(){var t=new r;this.promise=t,this.resolve=u(N,t,1),this.reject=u(F,t,1)}),l(l.G+l.W+l.F*!E,{Promise:w}),n(45)(w,g),n(63)(g),i=n(21)[g],l(l.S+l.F*!E,g,{reject:function(t){var e=O(this),n=e.reject;return n(t),e.promise}}),l(l.S+l.F*(s||!E),g,{resolve:function(t){if(t instanceof w&&k(t.constructor,this))return t;var e=O(this),n=e.resolve;return n(t),e.promise}}),l(l.S+l.F*!(E&&n(64)(function(t){w.all(t).catch(S)})),g,{all:function(t){var e=this,n=O(e),r=n.resolve,o=n.reject,i=P(function(){var n=[],i=0,s=1;p(t,!1,function(t){var a=i++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[a]=t,--s||r(n))},o)}),--s||r(n)});return i&&o(i.error),n.promise},race:function(t){var e=this,n=O(e),r=n.reject,o=P(function(){p(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o&&r(o.error),n.promise}})},function(t,e){"use strict";t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){"use strict";var r=n(29),o=n(55),i=n(56),s=n(12),a=n(40),u=n(57),c={},l={},f=t.exports=function(t,e,n,f,d){var h,p,v,y,m=d?function(){return t}:u(t),g=r(n,f,e?2:1),b=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(h=a(t.length);h>b;b++)if(y=e?g(s(p=t[b])[0],p[1]):g(t[b]),y===c||y===l)return y}else for(v=m.call(t);!(p=v.next()).done;)if(y=o(v,g,p.value,e),y===c||y===l)return y};f.BREAK=c,f.RETURN=l},function(t,e,n){"use strict";var r=n(12);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){"use strict";var r=n(31),o=n(5)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){"use strict";var r=n(3),o=n(5)("iterator"),i=n(31);t.exports=n(21).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){"use strict";var r=n(12),o=n(30),i=n(5)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||void 0==(n=r(s)[i])?e:o(n)}},function(t,e,n){"use strict";var r,o,i,s=n(29),a=n(60),u=n(44),c=n(17),l=n(7),f=l.process,d=l.setImmediate,h=l.clearImmediate,p=l.MessageChannel,v=0,y={},m="onreadystatechange",g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){g.call(t.data)};d&&h||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++v]=function(){a("function"==typeof t?t:Function(t),e)},r(v),v},h=function(t){delete y[t]},"process"==n(4)(f)?r=function(t){f.nextTick(s(g,t,1))}:p?(o=new p,i=o.port2,o.port1.onmessage=b,r=s(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):r=m in c("script")?function(t){u.appendChild(c("script"))[m]=function(){u.removeChild(this),g.call(t)}}:function(t){setTimeout(s(g,t,1),0)}),t.exports={set:d,clear:h}},function(t,e){"use strict";t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){"use strict";var r=n(7),o=n(59).set,i=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(4)(s);t.exports=function(){var t,e,n,c=function(){var r,o;for(u&&(r=s.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(i){var l=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}else if(a&&a.resolve){var d=a.resolve();n=function(){d.then(c)}}else n=function(){o.call(r,c)};return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e,n){"use strict";var r=n(9);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){"use strict";var r=n(7),o=n(11),i=n(15),s=n(5)("species");t.exports=function(t){var e=r[t];i&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){"use strict";var r=n(5)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(t){}return n}},function(t,e){"use strict";try{var n=new window.CustomEvent("test");if(n.preventDefault(),n.defaultPrevented!==!0)throw new Error("Could not prevent default")}catch(t){var r=function(t,e){var n,r;return e=e||{bubbles:!1,cancelable:!1,detail:void 0},n=document.createEvent("CustomEvent"),n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(t){this.defaultPrevented=!0}},n};r.prototype=window.Event.prototype,window.CustomEvent=r}},function(t,e){"use strict";!function(t){function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function r(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return m.iterable&&(e[Symbol.iterator]=function(){return e}),e}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function s(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function a(t){var e=new FileReader,n=s(e);return e.readAsArrayBuffer(t),n}function u(t){var e=new FileReader,n=s(e);return e.readAsText(t),n}function c(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?e:t}function h(t,e){e=e||{};var n=e.body;if("string"==typeof t)this.url=t;else{if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}}),e}function v(t){var e=new o;return t.split("\r\n").forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}}),e}function y(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var m={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(m.arrayBuffer)var g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=function(t){return t&&DataView.prototype.isPrototypeOf(t)},_=ArrayBuffer.isView||function(t){return t&&g.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,r){t=e(t),r=n(r);var o=this.map[t];this.map[t]=o?o+","+r:r},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,r){this.map[e(t)]=n(r)},o.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),r(t)},o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),r(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),r(t)},m.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},f.call(h.prototype),f.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];y.redirect=function(t,e){if(x.indexOf(e)===-1)throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=h,t.Response=y,t.fetch=function(t,e){return new Promise(function(n,r){var o=new h(t,e),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:v(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;n(new y(e,t))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&m.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n=0,a=navigator.userAgent.indexOf("Android")>0&&!s,u=/iP(ad|hone|od)/.test(navigator.userAgent)&&!s,c=u&&/OS 4_\d(_\d)?/.test(navigator.userAgent),l=u&&/OS [6-7]_\d/.test(navigator.userAgent),f=navigator.userAgent.indexOf("BB10")>0;i.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(u&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},i.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!a;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},i.prototype.sendClick=function(t,e){var n,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},i.prototype.determineEventType=function(t){return a&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},i.prototype.focus=function(t){var e;u&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},i.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},i.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},i.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],u){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!c){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTimen||Math.abs(e.pageY-this.touchStartY)>n},i.prototype.onTouchMove=function(t){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0)},i.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},i.prototype.onTouchEnd=function(t){var e,n,r,o,i,s=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,l&&(i=t.changedTouches[0],s=document.elementFromPoint(i.pageX-window.pageXOffset,i.pageY-window.pageYOffset)||s,s.fastClickScrollParent=this.targetElement.fastClickScrollParent),r=s.tagName.toLowerCase(),"label"===r){if(e=this.findControl(s)){if(this.focus(s),a)return!1;s=e}}else if(this.needsFocus(s))return t.timeStamp-n>100||u&&window.top!==window&&"input"===r?(this.targetElement=null,!1):(this.focus(s),this.sendClick(s,t),u&&"select"===r||(this.targetElement=null,t.preventDefault()),!1);return!(!u||c||(o=s.fastClickScrollParent,!o||o.fastClickLastScrollTop===o.scrollTop))||(this.needsClick(s)||(t.preventDefault(),this.sendClick(s,t)),!1)},i.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},i.prototype.onMouse=function(t){return!this.targetElement||(!!t.forwardedTouchEvent||(!t.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1))))},i.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail||(e=this.onMouse(t),e||(this.targetElement=null),e)},i.prototype.destroy=function(){var t=this.layer;a&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},i.notNeeded=function(t){var e,n,r,o;if("undefined"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!a)return!0;if(e=document.querySelector("meta[name=viewport]")){if(e.content.indexOf("user-scalable=no")!==-1)return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(f&&(r=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),r[1]>=10&&r[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(e.content.indexOf("user-scalable=no")!==-1)return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction||(o=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],!!(o>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(e.content.indexOf("user-scalable=no")!==-1||document.documentElement.scrollWidth<=window.outerWidth)))||("none"===t.style.touchAction||"manipulation"===t.style.touchAction))},i.attach=function(t,e){return new i(t,e)},"object"===o(n(69))&&n(69)?(r=function(){return i}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?(t.exports=i.attach,t.exports.FastClick=i):window.FastClick=i}()},function(t,e){(function(e){t.exports=e}).call(e,{})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(71),i=r(o),s=n(74),a=r(s),u=n(78),c=r(u),l=n(83),f=r(l),h=n(86),d=r(h);e.default={Event:i.default,Nav:a.default,Search:c.default,Sidebar:f.default,Source:d.default},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(72),i=r(o),s=n(73),a=r(s);e.default={Listener:i.default,MatchMedia:a.default},t.exports=e.default},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&(this.els_[n-1].dataset.mdState="blur"),this.index_=n;else for(var r=this.index_;r>=0;r--){if(!(this.anchors_[r].offsetTop-80>t)){this.index_=r;break}r>0&&(this.els_[r-1].dataset.mdState="")}this.offset_=t,this.dir_=e}}},{key:"reset",value:function(){Array.prototype.forEach.call(this.els_,function(t){t.dataset.mdState=""}),this.index_=0,this.offset_=window.pageYOffset}}]),t}();e.default=o,t.exports=e.default},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;nn){for(;" "!==t[n]&&--n>0;);return t.substring(0,n)+"..."}return t}}return a(t,[{key:"update",value:function(t){var e=this;if("focus"!==t.type||this.index_){if("keyup"===t.type){for(;this.list_.firstChild;)this.list_.removeChild(this.list_.firstChild);var n=this.index_.search(t.target.value);n.forEach(function(t){var n=e.data_[t.ref],o=n.location.split("#"),i=s(o,1),a=i[0];a=a.replace(/^(\/?\.{2})+/g,""),e.list_.appendChild(r.createElement("li",{class:"md-search-result__item"},r.createElement("a",{href:n.location,title:n.title,class:"md-search-result__link","data-md-rel":a===document.location.pathname?"anchor":""},r.createElement("article",{class:"md-search-result__article"},r.createElement("h1",{class:"md-search-result__title"},n.title),r.createElement("p",{class:"md-search-result__teaser"},e.truncate_(n.text,140))))))});var o=this.list_.querySelectorAll("[data-md-rel=anchor]");Array.prototype.forEach.call(o,function(t){t.addEventListener("click",function(e){var n=document.querySelector("[data-md-toggle=search]");n.checked&&(n.checked=!1,n.dispatchEvent(new CustomEvent("change"))),e.preventDefault(),setTimeout(function(){document.location.href=t.href},100)})}),this.meta_.textContent=n.length+" search result"+(1!==n.length?"s":"")}}else!function(){var t=function(t){e.index_=(0,c.default)(function(){this.field("title",{boost:10}),this.field("text"),this.ref("location")}),e.data_=t.reduce(function(t,n){return e.index_.add(n),t[n.location]=n,t},{})};setTimeout(function(){return"function"==typeof e.data_?e.data_().then(t):t(e.data_)},250)}()}}]),t}();e.default=l,t.exports=e.default}).call(e,n(81))},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={createElement:function(t,e){var n=document.createElement(t);e&&Array.prototype.forEach.call(Object.keys(e),function(t){n.setAttribute(t,e[t])});for(var r=function t(e){Array.prototype.forEach.call(e,function(e){"string"==typeof e||"number"==typeof e?n.textContent+=e:Array.isArray(e)?t(e):n.appendChild(e)})},o=arguments.length,i=Array(o>2?o-2:0),s=2;s=0,a=navigator.userAgent.indexOf("Android")>0&&!s,u=/iP(ad|hone|od)/.test(navigator.userAgent)&&!s,c=u&&/OS 4_\d(_\d)?/.test(navigator.userAgent),l=u&&/OS [6-7]_\d/.test(navigator.userAgent),f=navigator.userAgent.indexOf("BB10")>0;i.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(u&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},i.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!a;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},i.prototype.sendClick=function(t,e){var n,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},i.prototype.determineEventType=function(t){return a&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},i.prototype.focus=function(t){var e;u&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},i.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},i.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},i.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],u){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!c){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTimen||Math.abs(e.pageY-this.touchStartY)>n},i.prototype.onTouchMove=function(t){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0)},i.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},i.prototype.onTouchEnd=function(t){var e,n,r,o,i,s=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,l&&(i=t.changedTouches[0],s=document.elementFromPoint(i.pageX-window.pageXOffset,i.pageY-window.pageYOffset)||s,s.fastClickScrollParent=this.targetElement.fastClickScrollParent),r=s.tagName.toLowerCase(),"label"===r){if(e=this.findControl(s)){if(this.focus(s),a)return!1;s=e}}else if(this.needsFocus(s))return t.timeStamp-n>100||u&&window.top!==window&&"input"===r?(this.targetElement=null,!1):(this.focus(s),this.sendClick(s,t),u&&"select"===r||(this.targetElement=null,t.preventDefault()),!1);return!(!u||c||(o=s.fastClickScrollParent,!o||o.fastClickLastScrollTop===o.scrollTop))||(this.needsClick(s)||(t.preventDefault(),this.sendClick(s,t)),!1)},i.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},i.prototype.onMouse=function(t){return!this.targetElement||(!!t.forwardedTouchEvent||(!t.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1))))},i.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail||(e=this.onMouse(t),e||(this.targetElement=null),e)},i.prototype.destroy=function(){var t=this.layer;a&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},i.notNeeded=function(t){var e,n,r,o;if("undefined"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!a)return!0;if(e=document.querySelector("meta[name=viewport]")){if(e.content.indexOf("user-scalable=no")!==-1)return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(f&&(r=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),r[1]>=10&&r[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(e.content.indexOf("user-scalable=no")!==-1)return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction||(o=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],!!(o>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(e.content.indexOf("user-scalable=no")!==-1||document.documentElement.scrollWidth<=window.outerWidth)))||("none"===t.style.touchAction||"manipulation"===t.style.touchAction))},i.attach=function(t,e){return new i(t,e)},"object"===o(n(69))&&n(69)?(r=function(){return i}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?(t.exports=i.attach,t.exports.FastClick=i):window.FastClick=i}()},function(t,e){(function(e){t.exports=e}).call(e,{})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(71),i=r(o),s=n(74),a=r(s),u=n(78),c=r(u),l=n(83),f=r(l),d=n(86),h=r(d);e.default={Event:i.default,Nav:a.default,Search:c.default,Sidebar:f.default,Source:h.default},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(72),i=r(o),s=n(73),a=r(s);e.default={Listener:i.default,MatchMedia:a.default},t.exports=e.default},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&(this.els_[n-1].dataset.mdState="blur"),this.index_=n;else for(var r=this.index_;r>=0;r--){if(!(this.anchors_[r].offsetTop-80>t)){this.index_=r;break}r>0&&(this.els_[r-1].dataset.mdState="")}this.offset_=t,this.dir_=e}}},{key:"reset",value:function(){Array.prototype.forEach.call(this.els_,function(t){t.dataset.mdState=""}),this.index_=0,this.offset_=window.pageYOffset}}]),t}();e.default=o,t.exports=e.default},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;nn){for(;" "!==t[n]&&--n>0;);return t.substring(0,n)+"..."}return t}}return a(t,[{key:"update",value:function(t){var e=this;"focus"!==t.type||this.index_?"keyup"===t.type&&!function(){for(;e.list_.firstChild;)e.list_.removeChild(e.list_.firstChild);var n=e.index_.search(t.target.value),o=new RegExp("\\b"+t.target.value,"img");n.forEach(function(t){var n=e.data_[t.ref],i=n.location.split("#"),a=s(i,1),u=a[0];u=u.replace(/^(\/?\.{2})+/g,"");var c=n.text;c=c.replace(o,function(t,e,n){return''+t+""}),e.list_.appendChild(r.createElement("li",{class:"md-search-result__item"},r.createElement("a",{href:n.location,title:n.title,class:"md-search-result__link","data-md-rel":u===document.location.pathname?"anchor":""},r.createElement("article",{class:"md-search-result__article"},r.createElement("h1",{class:"md-search-result__title"},n.title),r.createElement("p",{class:"md-search-result__teaser"},{__html:c})))))});var i=e.list_.querySelectorAll("[data-md-rel=anchor]");Array.prototype.forEach.call(i,function(t){t.addEventListener("click",function(e){var n=document.querySelector("[data-md-toggle=search]");n.checked&&(n.checked=!1,n.dispatchEvent(new CustomEvent("change"))),e.preventDefault(),setTimeout(function(){document.location.href=t.href},100)})}),e.meta_.textContent=n.length+" search result"+(1!==n.length?"s":"")}():!function(){var t=function(t){e.index_=(0,c.default)(function(){this.field("title",{boost:10}),this.field("text"),this.ref("location")});var n=[],r=t.reduce(function(t,e){return t.length&&e.location.split(t[t.length-1].location+"#").length>1&&n.push(t.pop()),e.main=n.length-1,t.concat(e)},[]),o=r.map(function(t){return t.text=t.text.replace(/\n/g," ").replace(/\s+/g," ").replace(/\s+([,.:;!?])/g,function(t,e){return e}),t}),i=o;e.data_=i.reduce(function(t,n){return e.index_.add(n),t[n.location]=n,t},{})};setTimeout(function(){return"function"==typeof e.data_?e.data_().then(t):t(e.data_)},250)}()}}]),t}();e.default=l,t.exports=e.default}).call(e,n(81))},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={createElement:function(t,e){var n=document.createElement(t);e&&Array.prototype.forEach.call(Object.keys(e),function(t){n.setAttribute(t,e[t])});for(var r=function t(e){Array.prototype.forEach.call(e,function(e){"string"==typeof e||"number"==typeof e?n.textContent+=e:Array.isArray(e)?t(e):"undefined"!=typeof e.__html?n.innerHTML+=e.__html:n.appendChild(e)})},o=arguments.length,i=Array(o>2?o-2:0),s=2;s0&&(r=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=r},i.Index.prototype.search=function(t){var e=this.pipeline.run(this.tokenizerFn(t)),n=new i.Vector,r=[],o=this._fields.reduce(function(t,e){return t+e.boost},0),s=e.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];e.forEach(function(t,e,s){var a=1/s.length*this._fields.length*o,u=this,c=this.tokenStore.expand(t).reduce(function(e,r){var o=u.corpusTokens.indexOf(r),s=u.idf(r),c=1,l=new i.SortedSet;if(r!==t){var f=Math.max(3,r.length-t.length);c=1/Math.log(f)}o>-1&&n.insert(o,a*s*c);for(var h=u.tokenStore.get(r),d=Object.keys(h),p=d.length,v=0;v0&&(r=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=r},i.Index.prototype.search=function(t){var e=this.pipeline.run(this.tokenizerFn(t)),n=new i.Vector,r=[],o=this._fields.reduce(function(t,e){return t+e.boost},0),s=e.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];e.forEach(function(t,e,s){var a=1/s.length*this._fields.length*o,u=this,c=this.tokenStore.expand(t).reduce(function(e,r){var o=u.corpusTokens.indexOf(r),s=u.idf(r),c=1,l=new i.SortedSet;if(r!==t){var f=Math.max(3,r.length-t.length);c=1/Math.log(f)}o>-1&&n.insert(o,a*s*c);for(var d=u.tokenStore.get(r),h=Object.keys(d),p=h.length,v=0;v=this.offset_?"lock"!==this.el_.dataset.mdState&&(this.el_.dataset.mdState="lock"):"lock"===this.el_.dataset.mdState&&(this.el_.dataset.mdState="")}},{key:"reset",value:function(){this.el_.dataset.mdState="",this.el_.style.height="",this.height_=0}}]),t}();e.default=o,t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(87),i=r(o),s=n(91),a=r(s);e.default={Adapter:i.default,Repository:a.default},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(88),i=r(o);e.default={GitHub:i.default},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n1e4?(t/1e3).toFixed(0)+"k":t>1e3?(t/1e3).toFixed(1)+"k":t}},{key:"hash_",value:function(t){var e=0;if(0===t.length)return e;for(var n=0,r=t.length;n1){if(i=t({path:"/"},r.defaults,i),"number"==typeof i.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}try{s=JSON.stringify(o),/^[\{\[]/.test(s)&&(o=s)}catch(t){}return o=n.write?n.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape),document.cookie=[e,"=",o,i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}e||(s={});for(var u=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l=this.offset_?"lock"!==this.el_.dataset.mdState&&(this.el_.dataset.mdState="lock"):"lock"===this.el_.dataset.mdState&&(this.el_.dataset.mdState="")}},{key:"reset",value:function(){this.el_.dataset.mdState="",this.el_.style.height="",this.height_=0}}]),t}();e.default=o,t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(87),i=r(o),s=n(91),a=r(s);e.default={Adapter:i.default,Repository:a.default},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(88),i=r(o);e.default={GitHub:i.default},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n1e4?(t/1e3).toFixed(0)+"k":t>1e3?(t/1e3).toFixed(1)+"k":t}},{key:"hash_",value:function(t){var e=0;if(0===t.length)return e;for(var n=0,r=t.length;n1){if(i=t({path:"/"},r.defaults,i),"number"==typeof i.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}try{s=JSON.stringify(o),/^[\{\[]/.test(s)&&(o=s)}catch(t){}return o=n.write?n.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape),document.cookie=[e,"=",o,i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}e||(s={});for(var u=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l {% block scripts %} - + {% for path in extra_javascript %} diff --git a/src/assets/javascripts/application.js b/src/assets/javascripts/application.js index 65d406f21..39187f8e3 100644 --- a/src/assets/javascripts/application.js +++ b/src/assets/javascripts/application.js @@ -150,36 +150,6 @@ export default class Application { return doc }) }) - .then(data => { - - /* - * The MkDocs search index provides all pages as specified in the - * mkdocs.yml in order with an entry for the content of the whole - * page followed by separate entries for all subsections also in - * order of appearance. - */ - - // 1. Reduce docs so that useless entries are not included, using a - // quick spliting hack - only one test is necessary. - const reduced = data.reduce((docs, doc) => { - if (docs.length && doc.location.split( - docs[docs.length - 1].location).length > 1) - docs.pop() - return docs.concat(doc) - }, []) - - // 2. Trim texts - const trimmed = reduced.map(doc => { - doc.text = doc.text - .replace(/\n/g, " ") /* Remove newlines */ - .replace(/\s+/g, " ") /* Compact whitespace */ - .replace(/\s+([,.:;!?])/g, /* Correct punctuation */ - (_, char) => char) - return doc - }) - - return trimmed - }) })).listen() /* Listener: prevent touches on overlay if navigation is active */ diff --git a/src/assets/javascripts/components/Material/Search/Result.jsx b/src/assets/javascripts/components/Material/Search/Result.jsx index c4bfbe7ca..c0e21b00e 100644 --- a/src/assets/javascripts/components/Material/Search/Result.jsx +++ b/src/assets/javascripts/components/Material/Search/Result.jsx @@ -89,8 +89,47 @@ export default class Result { /* eslint-enable no-invalid-this, lines-around-comment */ }) + /* + * The MkDocs search index provides all pages as specified in the + * mkdocs.yml in order with an entry for the content of the whole + * page followed by separate entries for all subsections also in + * order of appearance. + */ + + // 1. Reduce docs so that useless entries are not included, using a + // quick spliting hack - only one test is necessary. + const main = [] + const reduced = data.reduce((docs, doc) => { + if (docs.length && doc.location.split( + `${docs[docs.length - 1].location}#`).length > 1) + main.push(docs.pop()) + doc.main = main.length - 1 // main entry + return docs.concat(doc) + }, []) + + // now we have the main pages. + + // Only return top-level pages + // const reduced = data.reduce((docs, doc) => { + // if (!doc.location.match("#")) + // docs.push(doc) + // return docs + // }, []) + + // 2. Trim texts + const trimmed = reduced.map(doc => { + doc.text = doc.text + .replace(/\n/g, " ") /* Remove newlines */ + .replace(/\s+/g, " ") /* Compact whitespace */ + .replace(/\s+([,.:;!?])/g, /* Correct punctuation */ + (_, char) => char) + return doc + }) + + const data2 = trimmed + /* Index documents */ - this.data_ = data.reduce((docs, doc) => { + this.data_ = data2.reduce((docs, doc) => { this.index_.add(doc) docs[doc.location] = doc return docs @@ -111,13 +150,36 @@ export default class Result { /* Perform search on index and render documents */ const result = this.index_.search(ev.target.value) + + // process results! + const re = new RegExp(`\\b${ev.target.value}`, "img") + // result.map(item => { + // // console.time("someFunction") + // text = text.replace(re, "*XXX*") // do in parallel and collect! + // // console.timeEnd("someFunction") + // }) + result.forEach(item => { const doc = this.data_[item.ref] + // console.log(item.score) /* Check if it's a anchor link on the current page */ let [pathname] = doc.location.split("#") pathname = pathname.replace(/^(\/?\.{2})+/g, "") + // TODO: match in children but show top level entry with merged + // sentences split top level and main entries! index one top level, + // when there is no child + + let text = doc.text + // const re = new RegExp(`\\b${ev.target.value}`, "img") + // console.time("someFunction") + text = text.replace(re, string => { + return `${string}` + }) + // console.log(text) + // console.timeEnd("someFunction") + /* Append search result */ this.list_.appendChild(
  • @@ -130,12 +192,12 @@ export default class Result { {doc.title}

    - {this.truncate_(doc.text, 140)} + {{ __html: text }}

  • - ) + ) /* {this.truncate_(doc.text, 140)} */ }) /* Bind click handlers for anchors */