LocalCDN-Firefox-Chrome-Brave/resources/webfont/1.0.26/webfont.jsm

46 lines
16 KiB
JavaScript

/*
* Copyright 2012 Small Batch, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
;(function(window,document,undefined){
var h=!0,i=null,l=!1;function o(a){return function(){return this[a]}}var p;function q(a,c,b){var d=2<arguments.length?Array.prototype.slice.call(arguments,2):[];return function(){d.push.apply(d,arguments);return c.apply(a,d)}};function s(a,c){this.L=a;this.a=c}s.prototype.createElement=function(a,c,b){a=this.L.createElement(a);if(c)for(var d in c)c.hasOwnProperty(d)&&("style"==d?t(this,a,c[d]):a.setAttribute(d,c[d]));b&&a.appendChild(this.L.createTextNode(b));return a};function u(a,c,b){a=a.L.getElementsByTagName(c)[0];a||(a=document.documentElement);a&&a.lastChild&&a.insertBefore(b,a.lastChild)}function aa(a){function c(){document.body?a():setTimeout(c,0)}c()}function v(a){a.parentNode&&a.parentNode.removeChild(a)}
function w(a,c){return a.createElement("link",{rel:"stylesheet",href:c})}function x(a,c){return a.createElement("script",{src:c})}function y(a,c){for(var b=a.className.split(/\s+/),d=0,e=b.length;d<e;d++)if(b[d]==c)return;b.push(c);a.className=b.join(" ").replace(/^\s+/,"")}function z(a,c){for(var b=a.className.split(/\s+/),d=[],e=0,g=b.length;e<g;e++)b[e]!=c&&d.push(b[e]);a.className=d.join(" ").replace(/^\s+/,"").replace(/\s+$/,"")}
function A(a,c){for(var b=a.className.split(/\s+/),d=0,e=b.length;d<e;d++)if(b[d]==c)return h;return l}function t(a,c,b){"MSIE"==a.a.getName()?c.style.cssText=b:c.setAttribute("style",b)};function B(a,c,b,d,e,g,f,k){this.ya=a;this.Ea=c;this.ma=b;this.la=d;this.Ba=e;this.Aa=g;this.ka=f;this.Fa=k}p=B.prototype;p.getName=o("ya");p.ua=o("Ea");p.W=o("ma");p.ra=o("la");p.sa=o("Ba");p.ta=o("Aa");p.qa=o("ka");p.w=o("Fa");function C(a,c){this.a=a;this.k=c}var ba=new B("Unknown","Unknown","Unknown","Unknown","Unknown","Unknown",void 0,l);
C.prototype.parse=function(){var a;if(-1!=this.a.indexOf("MSIE"))if(a=D(this.a,/(MSIE [\d\w\.]+)/,1),""!=a){var c=a.split(" ");a=c[0];c=c[1];a=new B(a,c,a,c,F(this),G(this),H(this.k),6<=I(c))}else a=new B("MSIE","Unknown","MSIE","Unknown",F(this),G(this),H(this.k),l);else if(-1!=this.a.indexOf("Opera"))a:{var c=a="Unknown",b=D(this.a,/(Presto\/[\d\w\.]+)/,1);""!=b?(c=b.split("/"),a=c[0],c=c[1]):(-1!=this.a.indexOf("Gecko")&&(a="Gecko"),b=D(this.a,/rv:([^\)]+)/,1),""!=b&&(c=b));if(-1!=this.a.indexOf("Version/")&&
(b=D(this.a,/Version\/([\d\.]+)/,1),""!=b)){a=new B("Opera",b,a,c,F(this),G(this),H(this.k),10<=I(b));break a}b=D(this.a,/Opera[\/ ]([\d\.]+)/,1);a=""!=b?new B("Opera",b,a,c,F(this),G(this),H(this.k),10<=I(b)):new B("Opera","Unknown",a,c,F(this),G(this),H(this.k),l)}else if(-1!=this.a.indexOf("AppleWebKit")){a=F(this);c=G(this);b=D(this.a,/AppleWebKit\/([\d\.\+]+)/,1);""==b&&(b="Unknown");var d="Unknown";-1!=this.a.indexOf("Chrome")||-1!=this.a.indexOf("CrMo")?d="Chrome":-1!=this.a.indexOf("Safari")?
d="Safari":-1!=this.a.indexOf("AdobeAIR")&&(d="AdobeAIR");var e="Unknown";-1!=this.a.indexOf("Version/")?e=D(this.a,/Version\/([\d\.\w]+)/,1):"Chrome"==d?e=D(this.a,/(Chrome|CrMo)\/([\d\.]+)/,2):"AdobeAIR"==d&&(e=D(this.a,/AdobeAIR\/([\d\.]+)/,1));var g=l;"AdobeAIR"==d?(g=D(e,/\d+\.(\d+)/,1),g=2<I(e)||2==I(e)&&5<=parseInt(g,10)):(g=D(b,/\d+\.(\d+)/,1),g=526<=I(b)||525<=I(b)&&13<=parseInt(g,10));a=new B(d,e,"AppleWebKit",b,a,c,H(this.k),g)}else-1!=this.a.indexOf("Gecko")?(c=a="Unknown",d=l,-1!=this.a.indexOf("Firefox")?
(a="Firefox",b=D(this.a,/Firefox\/([\d\w\.]+)/,1),""!=b&&(d=D(b,/\d+\.(\d+)/,1),c=b,d=""!=b&&3<=I(b)&&5<=parseInt(d,10))):-1!=this.a.indexOf("Mozilla")&&(a="Mozilla"),b=D(this.a,/rv:([^\)]+)/,1),""==b?b="Unknown":d||(d=I(b),e=parseInt(D(b,/\d+\.(\d+)/,1),10),g=parseInt(D(b,/\d+\.\d+\.(\d+)/,1),10),d=1<d||1==d&&9<e||1==d&&9==e&&2<=g||b.match(/1\.9\.1b[123]/)!=i||b.match(/1\.9\.1\.[\d\.]+/)!=i),a=new B(a,c,"Gecko",b,F(this),G(this),H(this.k),d)):a=ba;return a};
function F(a){var c=D(a.a,/(iPod|iPad|iPhone|Android)/,1);if(""!=c)return c;a=D(a.a,/(Linux|Mac_PowerPC|Macintosh|Windows)/,1);return""!=a?("Mac_PowerPC"==a&&(a="Macintosh"),a):"Unknown"}function G(a){var c=D(a.a,/(OS X|Windows NT|Android) ([^;)]+)/,2);if(c||(c=D(a.a,/(iPhone )?OS ([\d_]+)/,2)))return c;return(a=D(a.a,/Linux ([i\d]+)/,1))?a:"Unknown"}function I(a){a=D(a,/(\d+)/,1);return""!=a?parseInt(a,10):-1}function D(a,c,b){return(a=a.match(c))&&a[b]?a[b]:""}
function H(a){if(a.documentMode)return a.documentMode};function da(a,c,b){this.c=a;this.g=c;this.U=b;this.j="wf";this.h=new ea("-")}function fa(a){y(a.g,a.h.e(a.j,"loading"));J(a,"loading")}function K(a){z(a.g,a.h.e(a.j,"loading"));A(a.g,a.h.e(a.j,"active"))||y(a.g,a.h.e(a.j,"inactive"));J(a,"inactive")}function J(a,c,b,d){if(a.U[c])a.U[c](b,d)};function ga(){this.da={}}function ha(a,c){var b=[],d;for(d in c)if(c.hasOwnProperty(d)){var e=a.da[d];e&&b.push(e(c[d]))}return b};function L(a,c,b,d,e){this.c=a;this.A=c;this.n=b;this.u=d;this.D=e;this.K=0;this.ha=this.ca=l}L.prototype.watch=function(a,c,b,d,e){for(var g=a.length,f=0;f<g;f++){var k=a[f];c[k]||(c[k]=["n4"]);this.K+=c[k].length}e&&(this.ca=e);for(f=0;f<g;f++)for(var k=a[f],e=c[k],m=b[k],j=0,n=e.length;j<n;j++){var E=e[j],r=this.A,N=k,ca=E;y(r.g,r.h.e(r.j,N,ca,"loading"));J(r,"fontloading",N,ca);r=q(this,this.na);N=q(this,this.oa);(new d(r,N,this.c,this.n,this.u,this.D,k,E,m)).start()}};
L.prototype.na=function(a,c){var b=this.A;z(b.g,b.h.e(b.j,a,c,"loading"));z(b.g,b.h.e(b.j,a,c,"inactive"));y(b.g,b.h.e(b.j,a,c,"active"));J(b,"fontactive",a,c);this.ha=h;ia(this)};L.prototype.oa=function(a,c){var b=this.A;z(b.g,b.h.e(b.j,a,c,"loading"));A(b.g,b.h.e(b.j,a,c,"active"))||y(b.g,b.h.e(b.j,a,c,"inactive"));J(b,"fontinactive",a,c);ia(this)};
function ia(a){0==--a.K&&a.ca&&(a.ha?(a=a.A,z(a.g,a.h.e(a.j,"loading")),z(a.g,a.h.e(a.j,"inactive")),y(a.g,a.h.e(a.j,"active")),J(a,"active")):K(a.A))};function M(a,c,b,d,e,g,f,k,m){this.H=a;this.Y=c;this.c=b;this.n=d;this.u=e;this.D=g;this.xa=new ja;this.v=new O;this.M=f;this.B=k;this.pa=m||"BESbswy";this.P=ka(this,"arial,'URW Gothic L',sans-serif");this.Q=ka(this,"Georgia,'Century Schoolbook L',serif");this.aa=this.P;this.ba=this.Q;this.R=P(this,"arial,'URW Gothic L',sans-serif");this.S=P(this,"Georgia,'Century Schoolbook L',serif")}M.prototype.start=function(){this.ga=this.D();this.J()};
M.prototype.J=function(){var a=this.n.p(this.R),c=this.n.p(this.S);(this.P!=a||this.Q!=c)&&this.aa==a&&this.ba==c?Q(this,this.H):5E3<=this.D()-this.ga?Q(this,this.Y):(this.aa=a,this.ba=c,la(this))};function la(a){a.u(function(a,b){return function(){b.call(a)}}(a,a.J),25)}function Q(a,c){v(a.R);v(a.S);c(a.M,a.B)}function ka(a,c){var b=P(a,c,h),d=a.n.p(b);v(b);return d}function P(a,c,b){c=a.c.createElement("span",{style:R(a,c,a.B,b)},a.pa);u(a.c,"body",c);return c}
function R(a,c,b,d){b=a.v.expand(b);return"position:absolute;top:-999px;left:-999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;font-family:"+(d?"":a.xa.quote(a.M)+",")+c+";"+b};function S(a,c,b,d,e){this.c=a;this.V=c;this.g=b;this.u=d;this.a=e;this.N=this.O=0}S.prototype.q=function(a,c){this.V.da[a]=c};S.prototype.load=function(a){var c=new da(this.c,this.g,a);this.a.w()?ma(this,c,a):K(c)};S.prototype.va=function(a,c,b,d){var e=a.X?a.X():M;d?a.load(q(this,this.za,c,b,e)):(a=0==--this.O,this.N--,a&&(0==this.N?K(c):fa(c)),b.watch([],{},{},e,a))};
S.prototype.za=function(a,c,b,d,e,g){var f=0==--this.O;f&&fa(a);this.u(q(this,function(a,b,c,d,e,g){a.watch(b,c||{},d||{},e,g)},c,d,e,g,b,f))};function ma(a,c,b){b=ha(a.V,b);a.N=a.O=b.length;for(var d=new L(a.c,c,{p:function(a){return a.offsetWidth}},a.u,function(){return(new Date).getTime()}),e=0,g=b.length;e<g;e++){var f=b[e];f.z(a.a,q(a,a.va,f,c,d))}};function ea(a){this.wa=a||"-"}ea.prototype.e=function(a){for(var c=[],b=0;b<arguments.length;b++)c.push(arguments[b].replace(/[\W_]+/g,"").toLowerCase());return c.join(this.wa)};function ja(){this.fa="'"}ja.prototype.quote=function(a){for(var c=[],a=a.split(/,\s*/),b=0;b<a.length;b++){var d=a[b].replace(/['"]/g,"");-1==d.indexOf(" ")?c.push(d):c.push(this.fa+d+this.fa)}return c.join(",")};function O(){this.G=na;this.o=oa}var na=["font-style","font-weight"],oa={"font-style":[["n","normal"],["i","italic"],["o","oblique"]],"font-weight":[["1","100"],["2","200"],["3","300"],["4","400"],["5","500"],["6","600"],["7","700"],["8","800"],["9","900"],["4","normal"],["7","bold"]]};function T(a,c,b){this.Z=a;this.Ca=c;this.o=b}T.prototype.compact=function(a,c){for(var b=0;b<this.o.length;b++)if(c==this.o[b][1]){a[this.Z]=this.o[b][0];break}};
T.prototype.expand=function(a,c){for(var b=0;b<this.o.length;b++)if(c==this.o[b][0]){a[this.Z]=this.Ca+":"+this.o[b][1];break}};O.prototype.compact=function(a){for(var c=["n","4"],a=a.split(";"),b=0,d=a.length;b<d;b++){var e=a[b].replace(/\s+/g,"").split(":");if(2==e.length){var g=e[1];a:{for(var e=e[0],f=0;f<this.G.length;f++)if(e==this.G[f]){e=new T(f,e,this.o[e]);break a}e=i}e&&e.compact(c,g)}}return c.join("")};
O.prototype.expand=function(a){if(2!=a.length)return i;for(var c=[i,i],b=0,d=this.G.length;b<d;b++){var e=this.G[b];(new T(b,e,this.o[e])).expand(c,a.substr(b,1))}return c[0]&&c[1]?c.join(";")+";":i};window.WebFont=function(){var a=(new C(navigator.userAgent,document)).parse();return new S(new s(document,a),new ga,document.documentElement,function(a,b){setTimeout(a,b)},a)}();window.WebFont.load=window.WebFont.load;window.WebFont.addModule=window.WebFont.q;B.prototype.getName=B.prototype.getName;B.prototype.getVersion=B.prototype.ua;B.prototype.getEngine=B.prototype.W;B.prototype.getEngineVersion=B.prototype.ra;B.prototype.getPlatform=B.prototype.sa;B.prototype.getPlatformVersion=B.prototype.ta;
B.prototype.getDocumentMode=B.prototype.qa;B.prototype.isSupportingWebFont=B.prototype.w;function U(a,c){this.c=a;this.d=c}var pa={regular:"n4",bold:"n7",italic:"i4",bolditalic:"i7",r:"n4",b:"n7",i:"i4",bi:"i7"};U.prototype.z=function(a,c){return c(a.w())};
U.prototype.load=function(a){var c,b;u(this.c,"head",w(this.c,("https:"==document.location.protocol?"https:":"http:")+"//webfonts.fontslive.com/css/"+this.d.key+".css"));var d=this.d.families,e,g;e=[];g={};for(var f=0,k=d.length;f<k;f++){b=b=c=void 0;b=d[f].split(":");c=b[0];if(b[1]){b=b[1].split(",");for(var m=[],j=0,n=b.length;j<n;j++){var E=b[j];if(E){var r=pa[E];m.push(r?r:E)}}b=m}else b=["n4"];e.push(c);g[c]=b}a(e,g)};
window.WebFont.q("ascender",function(a){var c=(new C(navigator.userAgent,document)).parse();return new U(new s(document,c),a)});function V(a,c,b,d,e,g,f,k,m){V.Da.call(this,a,c,b,d,e,g,f,k,m);a="Times New Roman,Lucida Sans Unicode,Courier New,Tahoma,Arial,Microsoft Sans Serif,Times,Lucida Console,Sans,Serif,Monospace".split(",");c=a.length;b={};d=P(this,a[0],h);b[this.n.p(d)]=h;for(e=1;e<c;e++)g=a[e],t(this.c,d,R(this,g,this.B,h)),b[this.n.p(d)]=h,"4"!=this.B[1]&&(t(this.c,d,R(this,g,this.B[0]+"4",h)),b[this.n.p(d)]=h);v(d);this.t=b;this.ja=l}
(function(a,c){function b(){}b.prototype=a.prototype;c.prototype=new b;c.Da=a;c.Ga=a.prototype})(M,V);var qa={Arimo:h,Cousine:h,Tinos:h};V.prototype.J=function(){var a=this.n.p(this.R),c=this.n.p(this.S);!this.ja&&a==c&&this.t[a]&&(this.t={},this.ja=this.t[a]=h);(this.P!=a||this.Q!=c)&&!this.t[a]&&!this.t[c]?Q(this,this.H):5E3<=this.D()-this.ga?this.t[a]&&this.t[c]&&qa[this.M]?Q(this,this.H):Q(this,this.Y):la(this)};function ra(a){this.I=a?a:("https:"==window.location.protocol?"https:":"http:")+sa;this.f=[];this.T=[]}var sa="//fonts.googleapis.com/css";ra.prototype.e=function(){if(0==this.f.length)throw Error("No fonts to load !");if(-1!=this.I.indexOf("kit="))return this.I;for(var a=this.f.length,c=[],b=0;b<a;b++)c.push(this.f[b].replace(/ /g,"+"));a=this.I+"?family="+c.join("%7C");0<this.T.length&&(a+="&subset="+this.T.join(","));return a};function ta(a){this.f=a;this.ea=[];this.ia={};this.F={};this.v=new O}var ua={ultralight:"n2",light:"n3",regular:"n4",bold:"n7",italic:"i4",bolditalic:"i7",ul:"n2",l:"n3",r:"n4",b:"n7",i:"i4",bi:"i7"},va={latin:"BESbswy",cyrillic:"&#1081;&#1103;&#1046;",greek:"&#945;&#946;&#931;",khmer:"&#x1780;&#x1781;&#x1782;",Hanuman:"&#x1780;&#x1781;&#x1782;"};
ta.prototype.parse=function(){for(var a=this.f.length,c=0;c<a;c++){var b=this.f[c].split(":"),d=b[0].replace(/\+/g," "),e=["n4"];if(2<=b.length){var g;var f=b[1];g=[];if(f)for(var f=f.split(","),k=f.length,m=0;m<k;m++){var j;j=f[m];if(j.match(/^[\w ]+$/)){var n=ua[j];n?j=n:(n=j.match(/^(\d*)(\w*)$/),j=n[1],n=n[2],j=(j=this.v.expand([n?n:"n",j?j.substr(0,1):"4"].join("")))?this.v.compact(j):i)}else j="";j&&g.push(j)}0<g.length&&(e=g);3==b.length&&(b=b[2],g=[],b=!b?g:b.split(","),0<b.length&&(b=va[b[0]])&&
(this.F[d]=b))}this.F[d]||(b=va[d])&&(this.F[d]=b);this.ea.push(d);this.ia[d]=e}};function W(a,c,b){this.a=a;this.c=c;this.d=b}W.prototype.z=function(a,c){c(a.w())};W.prototype.X=function(){return"AppleWebKit"==this.a.W()?V:M};W.prototype.load=function(a){"MSIE"==this.a.getName()&&this.d.blocking!=h?aa(q(this,this.$,a)):this.$(a)};W.prototype.$=function(a){for(var c=this.c,b=new ra(this.d.api),d=this.d.families,e=d.length,g=0;g<e;g++){var f=d[g].split(":");3==f.length&&b.T.push(f.pop());b.f.push(f.join(":"))}d=new ta(d);d.parse();u(c,"head",w(c,b.e()));a(d.ea,d.ia,d.F)};
window.WebFont.q("google",function(a){var c=(new C(navigator.userAgent,document)).parse();return new W(c,new s(document,c),a)});function X(a,c){this.c=a;this.d=c}X.prototype.load=function(a){for(var c=this.d.urls||[],b=this.d.families||[],d=0,e=c.length;d<e;d++)u(this.c,"head",w(this.c,c[d]));a(b)};X.prototype.z=function(a,c){return c(a.w())};window.WebFont.q("custom",function(a){var c=(new C(navigator.userAgent,document)).parse();return new X(new s(document,c),a)});function Y(a,c,b){this.m=a;this.c=c;this.d=b;this.f=[];this.s={};this.v=new O}Y.prototype.C=function(a){return("https:"==this.m.location.protocol?"https:":"http:")+(this.d.api||"//f.fontdeck.com/s/css/js/")+this.m.document.location.hostname+"/"+a+".js"};
Y.prototype.z=function(a,c){var b=this.d.id,d=this;b?(this.m.__webfontfontdeckmodule__||(this.m.__webfontfontdeckmodule__={}),this.m.__webfontfontdeckmodule__[b]=function(a,b){for(var f=0,k=b.fonts.length;f<k;++f){var m=b.fonts[f];d.f.push(m.name);d.s[m.name]=[d.v.compact("font-weight:"+m.weight+";font-style:"+m.style)]}c(a)},u(this.c,"head",x(this.c,this.C(b)))):c(h)};Y.prototype.load=function(a){a(this.f,this.s)};
window.WebFont.q("fontdeck",function(a){var c=(new C(navigator.userAgent,document)).parse();return new Y(window,new s(document,c),a)});function Z(a,c,b,d,e){this.m=a;this.a=c;this.c=b;this.k=d;this.d=e;this.f=[];this.s={}}Z.prototype.z=function(a,c){var b=this,d=b.d.projectId;if(d){var e=x(b.c,b.C(d));e.id="__MonotypeAPIScript__"+d;e.onreadystatechange=function(a){if("loaded"===e.readyState||"complete"===e.readyState)e.onreadystatechange=i,e.onload(a)};e.onload=function(){if(b.m["__mti_fntLst"+d]){var e=b.m["__mti_fntLst"+d]();if(e&&e.length){var f;for(f=0;f<e.length;f++)b.f.push(e[f].fontfamily)}}c(a.w())};u(this.c,"head",e)}else c(h)};
Z.prototype.C=function(a){var c=this.protocol(),b=(this.d.api||"fast.fonts.com/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return c+"//"+b+"/"+a+".js"};Z.prototype.load=function(a){a(this.f,this.s)};Z.prototype.protocol=function(){var a=["http:","https:"],c=a[0];if(this.k&&this.k.location&&this.k.location.protocol)for(var b=0,b=0;b<a.length;b++)if(this.k.location.protocol===a[b])return this.k.location.protocol;return c};
window.WebFont.q("monotype",function(a){var c=(new C(navigator.userAgent,document)).parse();return new Z(window,c,new s(document,c),document,a)});function $(a,c,b){this.m=a;this.c=c;this.d=b;this.f=[];this.s={}}$.prototype.C=function(a){var c="https:"==window.location.protocol?"https:":"http:";return(this.d.api||c+"//use.typekit.com")+"/"+a+".js"};$.prototype.z=function(a,c){var b=this.d.id,d=this.d,e=this;b?(this.m.__webfonttypekitmodule__||(this.m.__webfonttypekitmodule__={}),this.m.__webfonttypekitmodule__[b]=function(b){b(a,d,function(a,b,d){e.f=b;e.s=d;c(a)})},u(this.c,"head",x(this.c,this.C(b)))):c(h)};
$.prototype.load=function(a){a(this.f,this.s)};window.WebFont.q("typekit",function(a){var c=(new C(navigator.userAgent,document)).parse();return new $(window,new s(document,c),a)});window.WebFontConfig&&window.WebFont.load(window.WebFontConfig);
})(this,document);