!function(t){"use strict";function e(t){var e=getComputedStyle(t);this.units={px:1},this.element=t;var i=function(t){return t&&t.length?parseInt(t):0};this.margins=[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft],this.margins=this.margins.map(i),this.borders=[e.borderTopWidth,e.borderRightWidth,e.borderBottomWidth,e.borderLeftWidth],this.borders=this.borders.map(i),this.paddings=[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft],this.paddings=this.paddings.map(i),this.borderBox={x:0,y:0,width:t.offsetWidth,height:t.offsetHeight},this.marginBox={x:-this.margins[3],y:-this.margins[0],width:t.offsetWidth+this.margins[1]+this.margins[3],height:t.offsetHeight+this.margins[0]+this.margins[2]};var r=this,s=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];this.borderBox.radii=s.map(function(t){return t=e[t].split(/\s+/),[r.toPixels(t[0],r.borderBox.width),r.toPixels(t.length>1?t[1]:t[0],r.borderBox.height)]}),this.cssFloat=e.cssFloat}function i(t,e,i){return(i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y)}function r(t,e,r){return Math.abs(i(t,e,r))<350}function s(t,e){return t.x==e.x&&t.y==e.y}function n(t,e,i){return i.x>=Math.min(t.x,e.x)&&i.x<=Math.max(t.x,e.x)&&r(t,e,i)}function o(){}function h(t,e,i,r){if(t.y>=i&&t.y<=r)return{x1:t.x-e,x2:t.x+e};var s,n;return r0?t[0].x:void 0,o=t.length>0?t[0].y:void 0,h=n,u=o,l=c(t),d=0;do{var g=this.nextEdgeVertexIndex(d,l);s.push(new a(this,t[d],t[g]));var f=t[d].x,x=t[d].y;n=Math.min(f,n),o=Math.min(x,o),h=Math.max(f,h),u=Math.max(x,u),d=g}while(0!==d);for(var m,y=0;y3;)m=(y+1)%s.length,r(s[y].vertex1,s[y].vertex2,s[m].vertex2)?(s[y].vertex2=s[m].vertex2,s.splice(m,1)):y++;if(0===i)this.shapeMarginEdges=s;else{for(var v=[],b=0;bi;i++)this.intervals[i]=m.none;this.minY=-t,this.maxY=e-t}function y(t){this.shapeMargin=t,this.xIntercepts=[];for(var e=0;t>=e;e++)this.xIntercepts[e]=Math.sqrt(t*t-e*e)}function v(t,e){console.log("Unable to load image ",t,". It's probably missing or you've run into a CORS issue."),e&&console.log("The exact problem was ",e)}function b(t,e,i){var r=document.createElement("canvas");this.width=r.width=e,this.height=r.height=i;var s=r.getContext("2d");s.drawImage(t,0,0,e,i);try{this.imageData=s.getImageData(0,0,e,i)}catch(n){v(t.src,n)}}function w(t,e,i,r,s,n){this.url=t,this.box=e,this.shapeImageThreshold=256*i,this.shapeMargin=r,this.clip=s,this.init(n)}function R(t,e){this.width=t,this.height=e}function M(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r,this.maxX=t+i,this.maxY=e+r}function E(t,e,i,r,s){this.rect=t,this.radii={topLeft:e,topRight:i,bottomLeft:r,bottomRight:s}}function L(t,e,i){return e*Math.sqrt(1-t*t/(i*i))}function A(t,e,i){return 0===e?1:Math.round(0===t||i>t*e/2?e:Math.sqrt(2*i*(e/t)))}function Y(t,e){return t.maxX-e}function S(t,e){return t.x+e}function X(t){return t.x}function I(t){return t.maxX}function C(t,e,i,r){return function(s,n,o){if(!this.rect.overlapsYRange(s,n))return[{x:void 0,height:n-s}];var h=[];su;u+=a)l=g.maxY-Math.min(u+a,c),d=L(l,g.width,g.height),h.push({height:Math.min(a,c-u),x:r(g,d)});if(p=Math.max(x.y,s),c=Math.min(x.maxY,n),x.overlapsYRange(s,n)&&h.push({x:i(x),height:c-p}),f.overlapsYRange(s,n))for(a=A(f.width,f.height,o),p=Math.max(s,f.y),c=Math.min(f.maxY,n),u=p;c>u;u+=a)l=u-f.y,d=L(l,f.width,f.height),h.push({height:Math.min(a,c-u),x:r(f,d)});return n>this.rect.maxY&&h.push({x:void 0,height:n-this.rect.maxY}),h}}function T(t,e){var i=t.r+e,r=new R(i,i);return new E(new M(t.cx-i,t.cy-i,2*i,2*i),r,r,r,r)}function P(t,e){var i=new R(t.rx+e,t.ry+e);return new E(new M(t.cx-i.width,t.cy-i.height,2*i.width,2*i.height),i,i,i,i)}function B(t,e){function i(t){return new R(t[0]+e,t[1]+e)}var r=i(t.radii[0]),s=i(t.radii[1]),n=i(t.radii[2]),o=i(t.radii[3]),h=new M(t.x-e,t.y-e,t.width+2*e,t.height+2*e);return new E(h,r,s,o,n)}function O(t,e){function i(t){return new R(t[0]+e,t[1]+e)}var r=i(t.radii[0]),s=i(t.radii[1]),n=i(t.radii[2]),o=i(t.radii[3]),h=new M(-e,-e,t.width+2*e,t.height+2*e);return new E(h,r,s,o,n)}function z(t,e,i,r,s,n){var o=new M(s.x,s.y,s.width,s.height);return new w(t,e,i,r,o,n)}function F(t,e){return new u(t.points,t.fillRule,e)}function N(t,e){var i,r=void 0===t.shapeMargin?0:t.shapeMargin;if(t.shape){switch(t.shape.type){case"circle":i=T(t.shape,r);break;case"ellipse":i=P(t.shape,r);break;case"inset":i=B(t.shape,r),i.isRenderable()||i.adjustRadii();break;case"polygon":i=F(t.shape,r)}return e(),i}return t.url?z(t.url,t.box,t.shapeImageThreshold,r,t.clip,e):t.box?(i=O(t.box,r),e(),i):void console.error("Unrecognized shape")}function V(t){this.metrics=new e(t);var i={metrics:this.metrics,shapeOutside:t.getAttribute("data-shape-outside"),shapeMargin:t.getAttribute("data-shape-margin"),shapeImageThreshold:t.getAttribute("data-shape-image-threshold")};this.shapeValue=new _(i);var r=this;this.geometry=N(this.shapeValue,function(){r.ready=!0,r.callback&&r.callback()})}function k(t){this.scope=t;var e=document.currentScript;e||(e=document.getElementsByTagName("script"),e=e[e.length-1]);var i=this,r="false"!==e.getAttribute("data-auto-run");r&&t.addEventListener&&t.addEventListener("load",function(){i.run()})}function q(t,e){var i,r=document.createElement("div");e.forEach(function(t){var e=t.bottom-t.top,s=document.createElement("div");s.className="sandbag",i={cssFloat:t.cssFloat,width:t.offset+"px",height:e+"px",clear:t.cssFloat};for(var n in i)s.style[n]=i[n];r.appendChild(s)}),i={position:"relative",width:"auto",height:"0",clear:"both",pointerEvents:"none"};for(var s in i)r.style[s]=i[s];var n,o=t.parentNode,h=getComputedStyle(o),a=parseFloat(h.borderTop)+parseFloat(h.borderBottom);i={position:"absolute",top:"0",width:"100%",height:o.clientHeight-a,left:"0"},n=document.createElement("div");for(s in i)n.style[s]=i[s];r.appendChild(n),t.parentNode&&t.parentNode.insertBefore(r,t),n.appendChild(t),r.setAttribute("data-shape-outside-container","true")}function j(t,e){var i;return function(){var r=this,s=arguments;clearTimeout(i),i=setTimeout(function(){i=null,t.apply(r,s)},e)}}function _(t){return t&&t.metrics&&t.shapeOutside?(this.url=this.parseUrl(t.shapeOutside),this.box=this.parseBox(this.url?"content-box":t.shapeOutside,t.metrics),this.shape=this.parseBasicShape(t.shapeOutside,this.box,t.metrics),this.clip=this.computeClip(this.box,t.metrics),this.shapeMargin=this.parseShapeMargin(t.shapeMargin,this.box,t.metrics),void(this.shapeImageThreshold=this.parseShapeImageThreshold(t.shapeImageThreshold))):void console.error("ShapeValue requires at least a metrics object and shape-outside string")}function U(t,e,i){var r=i.reduce(function(t,e){return t+e[0]},0),s=i.reduce(function(t,e){return t+e[1]},0),n=i.reduce(function(t,e){return t+e[2]},0),o=i.reduce(function(t,e){return t+e[3]},0);t.x-=e*o,t.y-=e*r,t.width+=e*(o+s),t.height+=e*(r+n)}function W(t,e,i){if(0>e)return Math.max(t+e*i,0);var r=Math.abs(t/i);return 1>r?Math.max(t+i*(1+Math.pow(r-1,3)),0):t+i}function H(t,e,i){var r=i.reduce(function(t,e){return t+e[0]},0),s=i.reduce(function(t,e){return t+e[1]},0),n=i.reduce(function(t,e){return t+e[2]},0),o=i.reduce(function(t,e){return t+e[3]},0);t[0][0]=W(t[0][0],e,o),t[0][1]=W(t[0][1],e,r),t[1][0]=W(t[1][0],e,s),t[1][1]=W(t[1][1],e,r),t[2][0]=W(t[2][0],e,s),t[2][1]=W(t[2][1],e,n),t[3][0]=W(t[3][0],e,o),t[3][1]=W(t[3][1],e,n)}function D(t,e){return t.map(function(t){return t[e]})}function G(t,e,i){t=t.split(/\s+/);var r="TopLeft",s=0;switch(t[0]){case"top":case"left":break;case"bottom":case"right":r="BottomRight";break;case"center":s=e/2;break;default:s=i.toPixels(t[0],e)}return t.length>1&&(s=i.toPixels(t[1],e)),"TopLeft"===r?s:e-s}function J(t,e,i,r){return"closest-side"===t?Math.min.apply(null,e):"farthest-side"===t?Math.max.apply(null,e):r.toPixels(t,i)}function Z(){var t,e,i=document,r=[];if("function"==typeof i.querySelectorAll)r=i.querySelectorAll('link[rel="stylesheet"], style'),r=Array.prototype.slice.call(r,0);else{var s=i.getElementsByTagName("link");if(s.length)for(t=0,e=s.length;e>t;t++)"stylesheet"===s[t].getAttribute("rel")&&r.push(s[t]);for(s=i.getElementsByTagName("style"),t=0,e=s.length;e>t;t++)r.push(s[t])}return r}function $(t){this.source=t,this.url=t.href||null,this.cssText=""}function K(t){return this instanceof K?(this.stylesheets=[],this.queueCount=0,this.callback=t||function(){},void this.init()):new K(t)}function Q(t){this.callback=t||function(){};var e=this;new K(function(t){e.onStylesLoaded(t)})}e.prototype.unitToPx=function(t){if(this.units[t])return this.units[t];var e=this.element.style.getPropertyValue("line-height");return this.element.style.setProperty("line-height",1+t),this.units[t]=parseFloat(getComputedStyle(this.element).getPropertyValue("line-height")),this.element.style.setProperty("line-height",e),this.units[t]},e.prototype.getUnitsMap=function(t){var e=["em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","in","px","pt","pc"],i=document.createElement("div");i.style.width="0px",i.style.height="0px",t.appendChild(i);var r=getComputedStyle(i),s={};return e.forEach(function(t){i.style.lineHeight="1"+t,s[t]=parseFloat(r.lineHeight)}),i.parentNode.removeChild(i),s},e.prototype.toPixels=function(t,e){var i=/([\-0-9\.]*)([a-z%]*)/.exec(t);return i[1]=parseFloat(i[1]),i[2]?"%"===i[2]?i[1]*e/100:i[1]*this.unitToPx(i[2]):i[1]},o.prototype.init=function(t,e,i){this.polygon=t,this.vertex1=e,this.vertex2=i,this.minX=Math.min(this.vertex1.x,this.vertex2.x),this.maxX=Math.max(this.vertex1.x,this.vertex2.x)},o.prototype.containsPoint=function(t){return n(this.vertex1,this.vertex2,t)},o.prototype.overlapsYRange=function(t,e){var i=this.vertex1.y,r=this.vertex2.y;return e>=Math.min(i,r)&&t<=Math.max(i,r)},o.prototype.isWithinYRange=function(t,e){var i=this.vertex1.y,r=this.vertex2.y;return t<=Math.min(i,r)&&e>=Math.max(i,r)},o.prototype.inwardNormal=function(){var t=this.vertex2.x-this.vertex1.x,e=this.vertex2.y-this.vertex1.y,i=Math.sqrt(t*t+e*e);return{x:-e/i,y:t/i}},o.prototype.outwardNormal=function(){var t=this.inwardNormal();return{x:-t.x,y:-t.y}},o.prototype.xIntercept=function(t){var e=this.vertex1.y,i=this.vertex2.y;return e==i?Math.min(this.vertex1.x,this.vertex2.x):t==Math.min(e,i)?i>e?this.vertex1.x:this.vertex2.x:t==Math.max(e,i)?e>i?this.vertex1.x:this.vertex2.x:this.vertex1.x+(t-e)*(this.vertex2.x-this.vertex1.x)/(i-e)},o.prototype.clippedEdgeXRange=function(t,e){if(this.isWithinYRange(t,e)){var i=this.vertex1.x,r=this.vertex2.x;return{x1:Math.min(i,r),x2:Math.max(i,r)}}var s,n;this.vertex1.ye?this.xIntercept(e):n.x;return{x1:Math.min(o,h),x2:Math.max(o,h)}},a.prototype=new o,p.prototype=new o,u.prototype.vertexAt=function(t){return this.m_vertices[t]},u.prototype.edgeAt=function(t){return this.m_edges[t]},u.prototype.isEmpty=function(){return this.m_edges.length<3||this.bounds.isEmpty()},u.prototype.vertices=function(){return this.m_vertices.slice(0)},u.prototype.edges=function(){return this.m_edges.slice(0)},u.prototype.overlapsYRange=function(t,e){return t=this.bounds.y},u.prototype.nextVertexIndex=function(t,e){var i=this.m_vertices.length;return(e?t+1:t-1+i)%i},u.prototype.nextEdgeVertexIndex=function(t,e){for(var i=(this.m_vertices.length,this.nextVertexIndex(t,e));i&&s(this.vertexAt(t),this.vertexAt(i));)i=this.nextVertexIndex(i,e);for(;i;){var n=this.nextVertexIndex(i,e);if(!r(this.vertexAt(t),this.vertexAt(i),this.vertexAt(n)))break;i=n}return i},u.prototype.containsPointEvenOdd=function(t){for(var e=0,i=0;it.y||s.y>t.y&&n.y<=t.y){var o=(t.y-s.y)/(n.y-s.y);t.xt.y&&i(n,o,t)>0&&++e:o.y>t.y&&n.y<=t.y&&i(n,o,t)<0&&--e}return 0!==e},u.prototype.containsPoint=function(t){return this.bounds.containsPoint(t)?"nonzero"==this.fillRule?this.containsPointNonZero(t):this.containsPointEvenOdd(t):!1},u.prototype.edgeVerticesThatOverlapYRange=function(t,e){for(var i=[],r=0;r=t&&s.yi);r++)s=n[r].clippedEdgeXRange(t,e),i=void 0===i?s.x1:Math.min(i,s.x1);var o=this.shapeMargin;if(o>0){var a=this.edgeVerticesThatOverlapYRange(t-o,e+o);for(a.sort(d),r=0;r0){var a=this.edgeVerticesThatOverlapYRange(t-o,e+o);for(a.sort(f),r=0;r=e.endX},y.prototype.generateIntervalAt=function(t,e){var i=Math.abs(t-e.y),r=i>this.shapeMargin?0:this.xIntercepts[i];return new x(t,e.startX-r,e.endX+r)},m.prototype.computeMarginIntervals=function(t){for(var e=new y(t),i=new m(this.yOffset,this.size),r=this.minY;r=o&&!(n>0&&this.intervalAtContains(n,s));--n)i.uniteIntervalAt(n,e.generateIntervalAt(n,s));for(i.uniteIntervalAt(r,e.generateIntervalAt(r,s)),n=r+1;h>=n&&!(n0&&(i.intervals=i.intervals.computeMarginIntervals(i.shapeMargin,i.clip)),e&&URL.revokeObjectURL(e),t()},r.onerror=function(){v(i.url),t()},!r.hasOwnProperty("crossOrigin")&&window.URL&&window.URL.createObjectURL){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&(200===n.status?(e=URL.createObjectURL(n.response),r.src=e):(v(i.url),t()))},n.open("GET",i.url,!0),n.responseType="blob",n.send()}else r.crossOrigin="anonymous",r.src=i.url},w.prototype.computeIntervals=function(t){var e=this.clip,i=this.shapeImageThreshold,r=this.box.width,s=this.box.height,n=new b(t,r,s);if(!n.hasData())return void 0;for(var o=new m(-e.y,e.height),h=Math.min(e.height,this.box.height),a=0;h>a;a++)for(var p=-1,c=0;ci?(p=c,o.intervalAt(a)===m.none&&o.setIntervalAt(a,new x(a,p,r))):-1!=p&&i>=u&&(o.intervalAt(a).endX=c,p=-1)}return o},w.prototype.rightExclusionEdge=function(t,e){var i=this.intervals;if(!i)return this.clip.width;for(var r,s=Math.max(t,this.clip.y);e>=s&&sr)&&(r=n)}return r},w.prototype.leftExclusionEdge=function(t,e){var i=this.intervals;if(!i)return 0;for(var r,s=Math.max(t,this.clip.y);e>=s&&sn)&&(r=n)}return r},R.zeroSize={width:0,height:0},R.prototype.isEmpty=function(){return this.width<=0||this.height<=0},R.prototype.scale=function(t){this.width*=t,this.height*=t},M.prototype.isEmpty=function(){return this.width<=0||this.height<=0},M.prototype.containsX=function(t){return t>=this.x&&t=this.y&&t=this.y&&t=this.x&&t0&&t.height>0}return t(this.radii.topLeft)||t(this.radii.topRight)||t(this.radii.bottomLeft)||t(this.radii.bottomRight)},E.prototype.cornersInsetRect=function(){var t=this.topLeftCorner(),e=this.topRightCorner(),i=this.bottomLeftCorner(),r=this.bottomRightCorner(),s=Math.max(t.maxX,i.maxX),n=Math.max(t.maxY,e.maxY);return new M(s,n,Math.min(e.x,r.x)-s,Math.min(i.y,r.y)-n)},E.prototype.scaleRadii=function(t){if(1!=t){var e=this.radii;e.topLeft.scale(t),e.topLeft.isEmpty()&&(e.topLeft=R.zeroSize),e.topRight.scale(t),e.topRight.isEmpty()&&(e.topRight=R.zeroSize),e.bottomLeft.scale(t),e.bottomLeft.isEmpty()&&(e.bottomLeft=R.zeroSize),e.bottomRight.scale(t),e.bottomRight.isEmpty()&&(e.bottomRight=R.zeroSize)}},E.prototype.isRenderable=function(){var t=this.radii,e=this.rect;return t.topLeft.width+t.topRight.width<=e.width&&t.bottomLeft.width+t.bottomRight.width<=e.width&&t.topLeft.height+t.bottomLeft.height<=e.height&&t.topRight.height+t.bottomRight.height<=e.height},E.prototype.adjustRadii=function(){var t=this.radii,e=Math.max(t.topLeft.width+t.topRight.width,t.bottomLeft.width+t.bottomRight.width),i=Math.max(t.topLeft.height+t.bottomLeft.height,t.topRight.height+t.bottomRight.height);if(0>=e||0>=i)return void(this.radii={topLeft:R.zeroSize,topRight:R.zeroSize,bottomRight:R.zeroSize,bottomLeft:R.zeroSize});var r=this.rect,s=r.width/e,n=r.height/i;this.scaleRadii(n>s?s:n)},E.prototype.minXInterceptAt=function(t,e){if(!this.rect.containsY(t))return e;var i,r=this.topLeftCorner();if(r.containsY(t))return i=r.maxY-t,r.maxX-L(i,r.width,r.height);var s=this.bottomLeftCorner();return s.containsY(t)?(i=t-s.y,s.maxX-L(i,s.width,s.height)):this.rect.x},E.prototype.maxXInterceptAt=function(t,e){if(!this.rect.containsY(t))return e;var i,r=this.topRightCorner();if(r.containsY(t))return i=r.maxY-t,r.x+L(i,r.width,r.height);var s=this.bottomRightCorner();return s.containsY(t)?(i=t-s.y,s.x+L(i,s.width,s.height)):this.rect.maxX},E.prototype.rightExclusionEdge=function(t,e){return this.rect.isEmpty()||!this.rect.overlapsYRange(t,e)?void 0:!this.isRounded()||this.cornersInsetRect().overlapsYRange(t,e)?this.rect.maxX:Math.max(this.maxXInterceptAt(t,this.rect.x),this.maxXInterceptAt(e,this.rect.x))},E.prototype.leftExclusionEdge=function(t,e){return this.rect.isEmpty()||!this.rect.overlapsYRange(t,e)?void 0:!this.isRounded()||this.cornersInsetRect().overlapsYRange(t,e)?this.rect.x:Math.min(this.minXInterceptAt(t,this.rect.maxX),this.minXInterceptAt(e,this.rect.maxX))},E.prototype.rightExclusionOffsets=C(E.prototype.topRightCorner,E.prototype.bottomRightCorner,I,S),E.prototype.leftExclusionOffsets=C(E.prototype.topLeftCorner,E.prototype.bottomLeftCorner,X,Y),V.prototype.onReady=function(t){this.ready?t():this.callback=t},V.prototype.leftExclusionEdge=function(t){return this.geometry?this.geometry.leftExclusionEdge(t.top,t.bottom):t.left},V.prototype.rightExclusionEdge=function(t){return this.geometry?this.geometry.rightExclusionEdge(t.top,t.bottom):t.right},V.prototype.computeStepOffsets=function(t){for(var e,i=[],r=0;r1?n[1]:s.insets[0],s.insets[2]=n.length>2?n[2]:s.insets[0],s.insets[3]=n.length>3?n[3]:s.insets[1],s.insets[0]=i.toPixels(s.insets[0],e.height),s.insets[1]=i.toPixels(s.insets[1],e.width),s.insets[2]=i.toPixels(s.insets[2],e.height),s.insets[3]=i.toPixels(s.insets[3],e.width)}var o;return t&&t[2]&&(o=t[2].trim(),o=o.split(/\s+/),o.length<2&&o.push(o[0]),o.length<3&&o.push(o[0]),o.length<4&&o.push(o[1]),s.radii=o.map(function(t){return t=i.toPixels(t,e.width),[t,t]})),t&&t[3]&&(o=t[3].trim(),o=o.split(/\s+/),o.length<2&&o.push(o[0]),o.length<3&&o.push(o[0]),o.length<4&&o.push(o[1]),o.forEach(function(t,r){s.radii[r][1]=i.toPixels(t,e.height)})),s.x=s.insets[3],s.y=s.insets[0],s.width=e.width-(s.insets[1]+s.insets[3]),s.height=e.height-(s.insets[0]+s.insets[2]),s},_.prototype.parseEllipsoid=function(t){var e=/((?:[^a]|a(?!t))*)?\s*(?:at\s+(.*))?/;t=e.exec(t);var i={};if(t&&t[1]){var r=t[1].trim();r=r.split(/\s+/),i.rx=r[0],i.ry=r.length>1?r[1]:r[0]}else i.rx=i.ry="closest-side";var s=[];if(t&&t[2]){var n=t[2].trim();n=n.split(/\s+/);var o=!1;n.forEach(function(t){/\d+/.test(t)&&o?s[s.length-1]+=" "+t:s.push(t),o=/top|bottom|left|right/.test(t)&&n.length>2})}for(;s.length<2;)s.push("center");if(/top|bottom/.test(s[0])||/left|right/.test(s[1])){var h=s[0];s[0]=s[1],s[1]=h}return i.cx=s[0],i.cy=s[1],i},_.prototype.parseCircle=function(t,e,i){var r=this.parseEllipsoid(t);return r.type="circle",r.cx=G(r.cx,e.width,i),r.cy=G(r.cy,e.height,i),r.r=J(r.rx,[Math.abs(r.cx),Math.abs(e.width-r.cx),Math.abs(r.cy),Math.abs(e.height-r.cy)],Math.sqrt((e.width*e.width+e.height*e.height)/2),i),delete r.rx,delete r.ry,r},_.prototype.parseEllipse=function(t,e,i){var r=this.parseEllipsoid(t);return r.type="ellipse",r.cx=G(r.cx,e.width,i),r.cy=G(r.cy,e.height,i),r.rx=J(r.rx,[Math.abs(r.cx),Math.abs(e.width-r.cx)],e.width,i),r.ry=J(r.ry,[Math.abs(r.cy),Math.abs(e.height-r.cy)],e.height,i),r},_.prototype.parsePolygon=function(t,e,i){t=t.split(/\s*,\s*/);var r="nonzero";t.length>0&&/nonzero|evenodd/.test(t[0])&&(r=t[0].trim(),t=t.slice(1));var s=t.map(function(t){var r=t.split(/\s+/);return{x:i.toPixels(r[0],e.width),y:i.toPixels(r[1],e.height)}});return{type:"polygon",fillRule:r,points:s}},_.prototype.computeClip=function(t,e){var i=e.margins[3],r=e.margins[0],s=e.margins[3]+e.margins[1],n=e.margins[0]+e.margins[2];return{x:-t.x-i,y:-t.y-r,width:e.borderBox.width+s,height:e.borderBox.height+n}},_.prototype.parseShapeMargin=function(t,e,i){return parseInt(t)?Math.max(0,i.toPixels(t,e.width)):0},_.prototype.parseShapeImageThreshold=function(t){var e=parseFloat(t);return e?Math.min(Math.max(0,e),1):0},$.prototype.load=function(t,e,i){var r=this;if(this.url){var s=new XMLHttpRequest;s.onreadystatechange=function(){4===s.readyState&&(200===s.status?(r.cssText=s.responseText,t.call(i,r)):e.call(i,r))},s.open("GET",this.url);try{s.send(null)}catch(n){console.log("An error occurred loading a stylesheet, probably because we can't access the local file system"),e.call(i,r)}}else this.cssText=this.source.textContent,t.call(i,r)},K.prototype.init=function(){var t,e,i=Z(),r=i.length;for(this.queueCount=r,e=0;r>e;e++)t=new $(i[e]),this.stylesheets.push(t),t.load(this.onStyleSheetLoad,this.onStyleSheetError,this)},K.prototype.onStyleSheetLoad=function(){this.queueCount--,this.onComplete.call(this)},K.prototype.onStyleSheetError=function(t){var e,i=this.stylesheets.length;for(e=0;i>e;e++)if(t.source===this.stylesheets[e].source)return this.stylesheets.splice(e,1),this.queueCount--,void this.onComplete.call(this)},K.prototype.onComplete=function(){0===this.queueCount&&this.callback.call(this,this.stylesheets)},Q.prototype.onStylesLoaded=function(t){var e,i,r="\\s*([^{}]*[^\\s])\\s*{[^\\}]*",s="\\s*:\\s*((?:[^;\\(]|\\([^\\)]*\\))*)\\s*;",n=[],o=["shape-outside","shape-margin","shape-image-threshold"]; o.forEach(function(o){e=new RegExp(r+"("+o+")"+s,"ig"),t.forEach(function(t){for(;null!==(i=e.exec(t.cssText));)n.push({selector:i[1],property:i[2],value:i[3]})})}),this.callback(n)},t.ShapesPolyfill=new k(t)}(window);