@engie-group/fluid-design-system-react
Version:
Fluid Design System React
1 lines • 227 kB
JavaScript
"use strict";var e=require("react"),t=require("react-dom");const n=e=>null==e,i={isUndefinedOrNull:n,classNames:(...e)=>{const t=[];for(const n of e){if(!n)continue;const e=typeof n;if("string"===e||"number"===e)t.push(n);else if(Array.isArray(n)){if(n.length){const e=i.classNames.apply(null,n);e&&t.push(e)}}else if("object"===e)if(n.toString===Object.prototype.toString)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&n[e]&&t.push(e);else t.push(n.toString())}return t.join(" ")},coerceFunction:e=>n(e)||"function"!=typeof e?null:e,mergeRefs:e=>t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))},normalizeString:e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),normalizeAndSearchInText:(e,t)=>{if(i.isUndefinedOrNull(e)||i.isUndefinedOrNull(t))return!1;const n=i.normalizeString(e),s=i.normalizeString(t),a=new RegExp(i.escapeRegExp(s),"gi");return-1!==n.search(a)},escapeRegExp:e=>e.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),highlightTextAsHtml:(e,t,n=!1,s=!0,a='<mark class="nj-highlight">',r="</mark>")=>{const o=n?"g":"gi",l=i.escapeRegExp(t);let c;if(i.isUndefinedOrNull(t))c=e;else if(s){const n=new RegExp(i.normalizeString(l),o),s=i.normalizeString(e).matchAll(n);let d=e,u=0;if(!i.isUndefinedOrNull(s))for(const e of s){const n=u+e.index,i=d.slice(0,n),s=d.slice(n,n+t.length),o=d.slice(n+t.length,d.length);d=`${i}${a}${s}${r}${o}`,u=u+a.length+r.length}c=d}else{const t=new RegExp(l,o);c=e.replace(t,`${a}$&${r}`)}return c},omit:(e,...t)=>Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))},s=e.createContext({}),a=e.forwardRef((({children:t,isSeparated:n,withoutBorder:a,className:r,...o},l)=>{const c=e.useRef(null),d=i.mergeRefs([l,c]),[u,m]=e.useState(),[h,p]=e.useState(),f=i.classNames("nj-accordion",{"nj-accordion--no-border":a,"nj-accordion--separated":n},r);return e.createElement(s.Provider,{value:{action:e=>()=>{const t=c.current?.querySelectorAll("details.nj-accordion-item");t?.forEach((t=>{"expand"===e?t.setAttribute("open",""):t.removeAttribute("open")}))},hasAlternativeToggleIcon:u,setHasAlternativeToggleIcon:m,customIcon:h,setCustomIcon:p}},e.createElement("div",{...o,className:f,ref:d},t))})),r=e.forwardRef((({name:t,variant:n,size:s,className:a,onClick:r,onKeyPress:o,ariaLabel:l},c)=>{const d=i.classNames("material-icons","nj-icon-material",{[`nj-icon-material--${"inherit"===s?"size-inherit":s}`]:!!s,[`nj-icon-material--${"inherit"===n?"color-inherit":n}`]:!!n},a);return e.createElement("span",{ref:c,className:d,onClick:r,onKeyPress:o,style:r?{cursor:"pointer"}:{},title:l,"aria-label":l,"aria-hidden":"true"},t)})),o=e.forwardRef((({name:t,isEngieIcon:n=!1,className:s,onClick:a,onKeyPress:r,ariaLabel:o},l)=>{const c=i.classNames(s),d=!(!a&&!r);return e.createElement("span",{ref:l,className:c,onClick:a,onKeyPress:r,style:a?{cursor:"pointer"}:{},title:o,"aria-label":o,"aria-hidden":d?void 0:"true"},!n&&t)})),l=["variant","emphasis","size","iconClassName","isDisabled","label","ariaLabel","icon","children"],c=[...l,"hrefTarget","hrefRel"],d=e.forwardRef(((t,n)=>{if(u(t)){const{children:s,hrefTarget:a,hrefRel:r,rel:o,target:l}=t,d=i.omit(t,...c);return e.createElement("a",{...d,ref:n,rel:r??o,target:a??l},s)}{const{children:s,type:a,isDisabled:r,disabled:o}=t,c=i.omit(t,...l);return e.createElement("button",{...c,ref:n,type:a??"button",disabled:r??o},s)}})),u=e=>"href"in e,m={normal:"",inverse:"nj-spinner--inverse",grey:"nj-spinner--grey"},h={lg:"",md:"nj-spinner--md",sm:"nj-spinner--sm",xs:"nj-spinner--xs",xxs:"nj-spinner--xxs"},p=e.forwardRef((({isLoading:t,isBlock:n=!0,variant:s="normal",size:a="lg",className:r},o)=>{const l=m[s||""],c=h[a||""],d=t?i.classNames("nj-spinner",{[l]:s,[c]:a},r):"nj-sr-only",u=n?"div":"span",p=n?"p":"span";return e.createElement(u,{ref:o,className:d,"aria-live":"polite","aria-atomic":"true"},t&&e.createElement(p,{className:"nj-sr-only"},"Loading..."))})),f={xsmall:"nj-btn--xs",small:"nj-btn--sm",normal:"",medium:"",large:"nj-btn--lg",xlarge:"nj-btn--xl"},E=e.forwardRef(((t,n)=>{const{href:s,variant:a,emphasis:o,size:l,className:c,iconClassName:u,isDisabled:m,isLoading:h,label:E,ariaLabel:g,icon:b,children:_}=t;let v,N;const A=i.classNames("nj-btn",f[l??"normal"],{[`nj-btn--${a}`]:a&&"primary"!==a,[`nj-btn--${o}`]:o&&"bold"!==o,"nj-btn--is-loading":h,disabled:m},c);e.Children.forEach(_,(t=>{t&&e.isValidElement(t)&&("customIcon"===t.props["data-child-name"]&&(v=t),"customLabel"===t.props["data-child-name"]&&(N=t))}));const T=E||N,y=i.classNames("nj-btn__icon",u);return e.createElement(d,{...t,ref:n,className:A,"aria-label":g??t["aria-label"],isDisabled:!s&&m},h?e.createElement(p,{isLoading:!0}):e.createElement(e.Fragment,null,T&&v?(()=>{if(!v)return;const t=v,n=i.classNames(t.props.className,"nj-btn__icon");return e.cloneElement(t,{className:n})})():b&&e.createElement(r,{name:b,className:y}),N||E))})),g=e.forwardRef((({className:t,action:n,...a},r)=>{const{action:o}=e.useContext(s);return e.createElement(E,{...a,onClick:e=>{o?.(n)(),a.onClick?.(e)},className:i.classNames("nj-accordion__action",t),ref:r})})),b=e.forwardRef((({children:t,className:n,...s},a)=>e.createElement("div",{...s,className:i.classNames("nj-accordion__actions",n),ref:a},t))),_=e.forwardRef((({children:t,scale:n="md",hasLeadingToggleIcon:a,hasAlternativeToggleIcon:r,icon:o,className:l,...c},d)=>{const{setHasAlternativeToggleIcon:u,setCustomIcon:m}=e.useContext(s);e.useEffect((()=>{u?.(r)}),[r]),e.useEffect((()=>{m?.(o)}),[o]);const h=e.useRef(null),p=i.mergeRefs([d,h]),f=i.classNames("nj-accordion-item",{[`nj-accordion-item--${n}`]:!!n&&"md"!==n,"nj-accordion-item--leading-toggle":a},l);return e.createElement("details",{ref:p,...c,onToggle:e=>{if("open"===e.nativeEvent.newState||e.currentTarget.open){document.querySelectorAll(`details.nj-accordion-item[name=${c.name}]`).forEach((e=>{e!==h.current&&e.removeAttribute("open")}))}c.onToggle?.(e)},className:f},t)})),v=e.forwardRef((({children:t,className:n,...s},a)=>e.createElement("div",{...s,className:i.classNames("nj-accordion-item__content",n),ref:a},t))),N=e.forwardRef((({children:t,...n},a)=>{const{hasAlternativeToggleIcon:o,customIcon:l}=e.useContext(s),c=e.isValidElement(l)?e.cloneElement(l,{className:i.classNames(l.props.className,"nj-accordion-item__icon")}):null;return e.createElement("summary",{...n,ref:a},c,e.createElement("span",{className:"nj-accordion-item__label"},t),o?e.createElement(e.Fragment,null,e.createElement(r,{name:"add",className:"nj-accordion-item__toggle nj-accordion-item__toggle--closed"}),e.createElement(r,{name:"remove",className:"nj-accordion-item__toggle nj-accordion-item__toggle--opened"})):e.createElement(r,{name:"expand_more",className:"nj-accordion-item__toggle"}))}));window.NJStore=window.NJStore||[];const A=(()=>{const e=window.NJStore;return{set(t,n,i){void 0===t.key&&(t.key={key:n,id:e.length}),e[t.key.id]=i},get:(t,n)=>(t.key&&n&&void 0===n.id&&(n=t.key),n&&void 0!==n.id?e[n.id]:null),delete(t,n){if(void 0===t.key)return;const i=t.key;i.key===n&&(delete e[i.id],delete t.key)}}})(),T={setData(e,t,n){A.set(e,t,n)},getData:(e,t)=>A.get(e,t),removeData(e,t){A.delete(e,t)}};class y{constructor(e,t,n={}){!t||t instanceof Element||console.error(Error(`${t} is not an HTML Element`)),this.options=n,this.element=t}static init(e,t={},n){const i=[],s=document.querySelectorAll(n);for(let n=0;n<s.length;n++){const a=s[n];if(!a.key||a.key.key!==e.DATA_KEY){const r=new e(s[n],t);a.key||T.setData(s[n],e.DATA_KEY,r),i.push(r)}}return i}}var S,L,C,w,x,R;!function(e){e.LIBRARY_LOG_TAG="[FLUID]",e.KEY_PREFIX="nj",e.DATA_API_KEY=".data-api"}(S||(S={})),function(e){e.mouseenter="mouseover",e.mouseleave="mouseout"}(L||(L={})),function(e){e.beforehide="beforehide",e.click="click",e.close="close",e.closed="closed",e.hide="hide",e.hidden="hidden",e.input="input",e.keydown="keydown",e.keyup="keyup",e.onchange="onchange",e.show="show",e.shown="shown",e.inserted="inserted",e.focusin="focusin",e.focusout="focusout",e.mouseenter="mouseenter",e.mouseleave="mouseleave",e.mouseup="mouseup",e.mousedown="mousedown",e.decrement="decrement",e.increment="increment"}(C||(C={})),function(e){e.click="click",e.dblclick="dblclick",e.mouseup="mouseup",e.mousedown="mousedown",e.contextmenu="contextmenu",e.mousewheel="mousewheel",e.DOMMouseScroll="DOMMouseScroll",e.mouseover="mouseover",e.mouseout="mouseout",e.mousemove="mousemove",e.selectstart="selectstart",e.selectend="selectend",e.keydown="keydown",e.keypress="keypress",e.keyup="keyup",e.orientationchange="orientationchange",e.touchstart="touchstart",e.touchmove="touchmove",e.touchend="touchend",e.touchcancel="touchcancel",e.pointerdown="pointerdown",e.pointermove="pointermove",e.pointerup="pointerup",e.pointerleave="pointerleave",e.pointercancel="pointercancel",e.gesturestart="gesturestart",e.gesturechange="gesturechange",e.gestureend="gestureend",e.focus="focus",e.blur="blur",e.change="change",e.reset="reset",e.select="select",e.submit="submit",e.focusin="focusin",e.focusout="focusout",e.load="load",e.unload="unload",e.beforeunload="beforeunload",e.resize="resize",e.move="move",e.DOMContentLoaded="DOMContentLoaded",e.readystatechange="readystatechange",e.error="error",e.abort="abort",e.scroll="scroll"}(w||(w={}));class I{static NAMESPACE_REGEX=/[^.]*(?=\..*)\.|.*/;static STRIPNAME_REGEX=/\..*/;static KEYEVENT_REGEX=/^key/;static STRIPUID_REGEX=/::\d+$/;static EVENTREGISTRY={};static uidEvent=1;static getUidEvent(e,t){return t&&`${t}::${I.uidEvent++}`||e.uidEvent||I.uidEvent++}static getEvent(e){const t=I.getUidEvent(e);return e.uidEvent=t,I.EVENTREGISTRY[t]=I.EVENTREGISTRY[t]||{}}static fixEvent(e,t){null===e.which&&I.KEYEVENT_REGEX.test(e.type)&&(e.which=null!==e.charCode?e.charCode:e.keyCode),e.delegateTarget=t}static njHandler(e,t){const n=i=>(I.fixEvent(i,e),n.oneOff&&I.off(e,i.type,t),t.apply(e,[i]));return n}static njDelegationHandler(e,t,n){const i=s=>{const a=e.querySelectorAll(t);for(let t=s.target;t&&t!==this;t=t.parentNode)for(let r=a.length;r>=0;r--)if(a[r]===t)return I.fixEvent(s,t),i.oneOff&&I.off(e,s.type,n),n.apply(t,[s]);return null};return i}static findHandler(e,t,n=null){for(const i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;const s=e[i];if(s.originalHandler===t&&s.delegationSelector===n)return e[i]}return null}static normalizeParams(e,t,n){const i="string"==typeof t,s=i?n:t;let a=e.replace(I.STRIPNAME_REGEX,"");const r=L[a];return r&&(a=r),"string"==typeof w[a]||(a=e),[i,s,a]}static addHandler(e,t,n,i,s){if("string"!=typeof t||null==e)return;n||(n=i,i=null);const a=I.getEvent(e);for(const r of t.split(" ")){const[t,o,l]=I.normalizeParams(r,n,i),c=a[l]||(a[l]={}),d=I.findHandler(c,o,t?n:null);if(d)return void(d.oneOff=d.oneOff&&s);const u=I.getUidEvent(o,r.replace(I.NAMESPACE_REGEX,"")),m=t?I.njDelegationHandler(e,n,i):I.njHandler(e,n);m.delegationSelector=t?n:null,m.originalHandler=o,m.oneOff=s,m.uidEvent=u,c[u]=m,e.addEventListener(l,m,t)}}static removeHandler(e,t,n,i,s){const a=I.findHandler(t[n],i,s);null!==a&&(e.removeEventListener(n,a,Boolean(s)),delete t[n][a.uidEvent])}static removeNamespacedHandlers(e,t,n,i){const s=t[n]||{};for(const a in s)if(Object.prototype.hasOwnProperty.call(s,a)&&a.indexOf(i)>-1){const i=s[a];I.removeHandler(e,t,n,i.originalHandler,i.delegationSelector)}}static on(e,t,n,i){I.addHandler(e,t,n,i,!1)}static one(e,t,n,i){I.addHandler(e,t,n,i,!0)}static off(e,t,n,i){if("string"!=typeof t||null==e)return;const[s,a,r]=I.normalizeParams(t,n,i),o=r!==t,l=I.getEvent(e);if(void 0!==a){if(!l||!l[r])return;return void I.removeHandler(e,l,r,a,s?n:null)}if("."===t.charAt(0))for(const n in l)Object.prototype.hasOwnProperty.call(l,n)&&I.removeNamespacedHandlers(e,l,n,t.substr(1));const c=l[r]||{};for(const n in c){if(!Object.prototype.hasOwnProperty.call(c,n))continue;const i=n.replace(I.STRIPUID_REGEX,"");if(!o||t.indexOf(i)>-1){const t=c[n];I.removeHandler(e,l,r,t.originalHandler,t.delegationSelector)}}}static trigger(e,t,n){if("string"!=typeof t||null==e)return null;const i=t.replace(I.STRIPNAME_REGEX,""),s="string"==typeof w[i],a=!0;let r=null;return s?(r=document.createEvent("HTMLEvents"),r.initEvent(i,a,!0)):r=new window.CustomEvent(t,{bubbles:a,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((e=>{Object.defineProperty(r,e,{get:()=>n[e]})})),e.dispatchEvent(r),r}}class k extends y{static NAME=`${S.KEY_PREFIX}-accordion`;static DATA_KEY=`${S.KEY_PREFIX}.accordion`;static EVENT_KEY=`.${k.DATA_KEY}`;static ACTIONS={expand:"accordion-expand",collapse:"accordion-collapse"};static SELECTOR={default:`.${k.NAME}`,details:`details.${k.NAME}-item`,expandAllBtn:`.${k.NAME}__action[data-${k.ACTIONS.expand}]`,collapseAllBtn:`.${k.NAME}__action[data-${k.ACTIONS.collapse}]`};constructor(e){super(k,e),T.setData(e,k.DATA_KEY,this),this.root=e,this.details=this.root.querySelectorAll(k.SELECTOR.details),this.expandAllBtn=this.root.querySelector(k.SELECTOR.expandAllBtn),this.collapseAllBtn=this.root.querySelector(k.SELECTOR.collapseAllBtn),this.setListeners()}static init(e={}){return super.init(this,e,k.SELECTOR.default)}dispose(){T.removeData(this.element,k.DATA_KEY);for(let e=0,t=this.details.length;e<t;e++)I.off(this.details[e],"toggle");I.off(this.expandAllBtn,"click"),I.off(this.expandAllBtn,"click"),this.element=null}static getInstance(e){return T.getData(e,k.DATA_KEY)}setListeners(){for(let e=0,t=this.details.length;e<t;e++)I.on(this.details[e],"toggle",this.toggleExclusiveAccordion(this.details[e]));I.on(this.expandAllBtn,"click",this.clickOnAction(k.ACTIONS.expand)),I.on(this.collapseAllBtn,"click",this.clickOnAction(k.ACTIONS.collapse))}toggleExclusiveAccordion(e){return t=>{const n=e.getAttribute("name");"open"===t.newState&&this.root.querySelectorAll(`${k.SELECTOR.details}[name=${n}][open]`).forEach((t=>{t!==e&&t.removeAttribute("open")}))}}clickOnAction(e){return()=>{this.details.forEach((t=>{e===k.ACTIONS.expand?t.setAttribute("open",""):t.removeAttribute("open")}))}}}R={},function(e,t){function n(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=m}function i(){return e.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function s(t,i,s){var a=new n;return i&&(a.fill="both",a.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.getOwnPropertyNames(t).forEach((function(n){if("auto"!=t[n]){if(("number"==typeof a[n]||"duration"==n)&&("number"!=typeof t[n]||isNaN(t[n])))return;if("fill"==n&&-1==d.indexOf(t[n]))return;if("direction"==n&&-1==u.indexOf(t[n]))return;if("playbackRate"==n&&1!==t[n]&&e.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;a[n]=t[n]}})):a.duration=t,a}function a(e,t,n,i){return e<0||e>1||n<0||n>1?m:function(s){function a(e,t,n){return 3*e*(1-n)*(1-n)*n+3*t*(1-n)*n*n+n*n*n}if(s<=0){var r=0;return e>0?r=t/e:!t&&n>0&&(r=i/n),r*s}if(s>=1){var o=0;return n<1?o=(i-1)/(n-1):1==n&&e<1&&(o=(t-1)/(e-1)),1+o*(s-1)}for(var l=0,c=1;l<c;){var d=(l+c)/2,u=a(e,n,d);if(Math.abs(s-u)<1e-5)return a(t,i,d);u<s?l=d:c=d}return a(t,i,d)}}function r(e,t){return function(n){if(n>=1)return 1;var i=1/e;return(n+=t*i)-n%i}}function o(e){g||(g=document.createElement("div").style),g.animationTimingFunction="",g.animationTimingFunction=e;var t=g.animationTimingFunction;if(""==t&&i())throw new TypeError(e+" is not a valid value for easing");return t}function l(e){if("linear"==e)return m;var t=_.exec(e);if(t)return a.apply(this,t.slice(1).map(Number));var n=v.exec(e);if(n)return r(Number(n[1]),f);var i=N.exec(e);return i?r(Number(i[1]),{start:h,middle:p,end:f}[i[2]]):E[e]||m}function c(e,t,n){if(null==t)return A;var i=n.delay+e+n.endDelay;return t<Math.min(n.delay,i)?T:t>=Math.min(n.delay+e,i)?y:S}var d="backwards|forwards|both|none".split("|"),u="reverse|alternate|alternate-reverse".split("|"),m=function(e){return e};n.prototype={_setMember:function(t,n){this["_"+t]=n,this._effect&&(this._effect._timingInput[t]=n,this._effect._timing=e.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=e.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(e){this._setMember("delay",e)},get delay(){return this._delay},set endDelay(e){this._setMember("endDelay",e)},get endDelay(){return this._endDelay},set fill(e){this._setMember("fill",e)},get fill(){return this._fill},set iterationStart(e){if((isNaN(e)||e<0)&&i())throw new TypeError("iterationStart must be a non-negative number, received: "+e);this._setMember("iterationStart",e)},get iterationStart(){return this._iterationStart},set duration(e){if("auto"!=e&&(isNaN(e)||e<0)&&i())throw new TypeError("duration must be non-negative or auto, received: "+e);this._setMember("duration",e)},get duration(){return this._duration},set direction(e){this._setMember("direction",e)},get direction(){return this._direction},set easing(e){this._easingFunction=l(o(e)),this._setMember("easing",e)},get easing(){return this._easing},set iterations(e){if((isNaN(e)||e<0)&&i())throw new TypeError("iterations must be non-negative, received: "+e);this._setMember("iterations",e)},get iterations(){return this._iterations}};var h=1,p=.5,f=0,E={ease:a(.25,.1,.25,1),"ease-in":a(.42,0,1,1),"ease-out":a(0,0,.58,1),"ease-in-out":a(.42,0,.58,1),"step-start":r(1,h),"step-middle":r(1,p),"step-end":r(1,f)},g=null,b="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",_=new RegExp("cubic-bezier\\("+b+","+b+","+b+","+b+"\\)"),v=/steps\(\s*(\d+)\s*\)/,N=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,A=0,T=1,y=2,S=3;e.cloneTimingInput=function(e){if("number"==typeof e)return e;var t={};for(var n in e)t[n]=e[n];return t},e.makeTiming=s,e.numericTimingToObject=function(e){return"number"==typeof e&&(e=isNaN(e)?{duration:0}:{duration:e}),e},e.normalizeTimingInput=function(t,n){return s(t=e.numericTimingToObject(t),n)},e.calculateActiveDuration=function(e){return Math.abs(function(e){return 0===e.duration||0===e.iterations?0:e.duration*e.iterations}(e)/e.playbackRate)},e.calculateIterationProgress=function(e,t,n){var i=c(e,t,n),s=function(e,t,n,i,s){switch(i){case T:return"backwards"==t||"both"==t?0:null;case S:return n-s;case y:return"forwards"==t||"both"==t?e:null;case A:return null}}(e,n.fill,t,i,n.delay);if(null===s)return null;var a=function(e,t,n,i,s){var a=s;return 0===e?t!==T&&(a+=n):a+=i/e,a}(n.duration,i,n.iterations,s,n.iterationStart),r=function(e,t,n,i,s,a){var r=e===1/0?t%1:e%1;return 0!==r||n!==y||0===i||0===s&&0!==a||(r=1),r}(a,n.iterationStart,i,n.iterations,s,n.duration),o=function(e,t,n,i){return e===y&&t===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}(i,n.iterations,r,a),l=function(e,t,n){var i=e;if("normal"!==e&&"reverse"!==e){var s=t;"alternate-reverse"===e&&(s+=1),i="normal",s!==1/0&&s%2!=0&&(i="reverse")}return"normal"===i?n:1-n}(n.direction,o,r);return n._easingFunction(l)},e.calculatePhase=c,e.normalizeEasing=o,e.parseEasingFunction=l}(x={}),function(e,t){function n(e,t){return e in l&&l[e][t]||t}function i(e,t,i){if(!function(e){return"display"===e||0===e.lastIndexOf("animation",0)||0===e.lastIndexOf("transition",0)}(e)){var s=a[e];if(s)for(var o in r.style[e]=t,s){var l=s[o],c=r.style[l];i[l]=n(l,c)}else i[e]=n(e,t)}}function s(e){var t=[];for(var n in e)if(!(n in["easing","offset","composite"])){var i=e[n];Array.isArray(i)||(i=[i]);for(var s,a=i.length,r=0;r<a;r++)(s={}).offset="offset"in e?e.offset:1==a?1:r/(a-1),"easing"in e&&(s.easing=e.easing),"composite"in e&&(s.composite=e.composite),s[n]=i[r],t.push(s)}return t.sort((function(e,t){return e.offset-t.offset})),t}var a={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},r=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o={thin:"1px",medium:"3px",thick:"5px"},l={borderBottomWidth:o,borderLeftWidth:o,borderRightWidth:o,borderTopWidth:o,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:o,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};e.convertToArrayForm=s,e.normalizeKeyframes=function(t){if(null==t)return[];window.Symbol&&Symbol.iterator&&Array.prototype.from&&t[Symbol.iterator]&&(t=Array.from(t)),Array.isArray(t)||(t=s(t));for(var n=t.map((function(t){var n={};for(var s in t){var a=t[s];if("offset"==s){if(null!=a){if(a=Number(a),!isFinite(a))throw new TypeError("Keyframe offsets must be numbers.");if(a<0||a>1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==s){if("add"==a||"accumulate"==a)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=a)throw new TypeError("Invalid composite mode "+a+".")}else a="easing"==s?e.normalizeEasing(a):""+a;i(s,a,n)}return null==n.offset&&(n.offset=null),null==n.easing&&(n.easing="linear"),n})),a=!0,r=-1/0,o=0;o<n.length;o++){var l=n[o].offset;if(null!=l){if(l<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=l}else a=!1}return n=n.filter((function(e){return e.offset>=0&&e.offset<=1})),a||function(){var e=n.length;null==n[e-1].offset&&(n[e-1].offset=1),e>1&&null==n[0].offset&&(n[0].offset=0);for(var t=0,i=n[0].offset,s=1;s<e;s++){var a=n[s].offset;if(null!=a){for(var r=1;r<s-t;r++)n[t+r].offset=i+(a-i)*r/(s-t);t=s,i=a}}}(),n}}(x),function(e){var t={};e.isDeprecated=function(e,n,i,s){var a=s?"are":"is",r=new Date,o=new Date(n);return o.setMonth(o.getMonth()+3),!(r<o&&(e in t||console.warn("Web Animations: "+e+" "+a+" deprecated and will stop working on "+o.toDateString()+". "+i),t[e]=!0,1))},e.deprecated=function(t,n,i,s){var a=s?"are":"is";if(e.isDeprecated(t,n,i,s))throw new Error(t+" "+a+" no longer supported. "+i)}}(x),function(){if(document.documentElement.animate){var e=document.documentElement.animate([],0),t=!0;if(e&&(t=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach((function(n){void 0===e[n]&&(t=!0)}))),!t)return}!function(e,t,n){t.convertEffectInput=function(n){var i=function(e){for(var t={},n=0;n<e.length;n++)for(var i in e[n])if("offset"!=i&&"easing"!=i&&"composite"!=i){var s={offset:e[n].offset,easing:e[n].easing,value:e[n][i]};t[i]=t[i]||[],t[i].push(s)}for(var a in t){var r=t[a];if(0!=r[0].offset||1!=r[r.length-1].offset)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"Partial keyframes are not supported"}}return t}(e.normalizeKeyframes(n)),s=function(n){var i=[];for(var s in n)for(var a=n[s],r=0;r<a.length-1;r++){var o=r,l=r+1,c=a[o].offset,d=a[l].offset,u=c,m=d;0==r&&(u=-1/0,0==d&&(l=o)),r==a.length-2&&(m=1/0,1==c&&(o=l)),i.push({applyFrom:u,applyTo:m,startOffset:a[o].offset,endOffset:a[l].offset,easingFunction:e.parseEasingFunction(a[o].easing),property:s,interpolation:t.propertyInterpolation(s,a[o].value,a[l].value)})}return i.sort((function(e,t){return e.startOffset-t.startOffset})),i}(i);return function(e,n){if(null!=n)s.filter((function(e){return n>=e.applyFrom&&n<e.applyTo})).forEach((function(i){var s=n-i.startOffset,a=i.endOffset-i.startOffset,r=0==a?0:i.easingFunction(s/a);t.apply(e,i.property,i.interpolation(r))}));else for(var a in i)"offset"!=a&&"easing"!=a&&"composite"!=a&&t.clear(e,a)}}}(x,R),function(e,t,n){function i(e){return e.replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))}function s(e,t,n){a[n]=a[n]||[],a[n].push([e,t])}var a={};t.addPropertiesHandler=function(e,t,n){for(var a=0;a<n.length;a++)s(e,t,i(n[a]))};var r={backgroundColor:"transparent",backgroundPosition:"0% 0%",borderBottomColor:"currentColor",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomWidth:"3px",borderLeftColor:"currentColor",borderLeftWidth:"3px",borderRightColor:"currentColor",borderRightWidth:"3px",borderSpacing:"2px",borderTopColor:"currentColor",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderTopWidth:"3px",bottom:"auto",clip:"rect(0px, 0px, 0px, 0px)",color:"black",fontSize:"100%",fontWeight:"400",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"120%",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",marginTop:"0px",maxHeight:"none",maxWidth:"none",minHeight:"0px",minWidth:"0px",opacity:"1.0",outlineColor:"invert",outlineOffset:"0px",outlineWidth:"3px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",paddingTop:"0px",right:"auto",strokeDasharray:"none",strokeDashoffset:"0px",textIndent:"0px",textShadow:"0px 0px 0px transparent",top:"auto",transform:"",verticalAlign:"0px",visibility:"visible",width:"auto",wordSpacing:"normal",zIndex:"auto"};t.propertyInterpolation=function(n,s,o){var l=n;/-/.test(n)&&!e.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(l=i(n)),"initial"!=s&&"initial"!=o||("initial"==s&&(s=r[l]),"initial"==o&&(o=r[l]));for(var c=s==o?[]:a[l],d=0;c&&d<c.length;d++){var u=c[d][0](s),m=c[d][0](o);if(void 0!==u&&void 0!==m){var h=c[d][1](u,m);if(h){var p=t.Interpolation.apply(null,h);return function(e){return 0==e?s:1==e?o:p(e)}}}}return t.Interpolation(!1,!0,(function(e){return e?o:s}))}}(x,R),function(e,t,n){t.KeyframeEffect=function(n,i,s,a){var r,o=function(t){var n=e.calculateActiveDuration(t),i=function(i){return e.calculateIterationProgress(n,i,t)};return i._totalDuration=t.delay+n+t.endDelay,i}(e.normalizeTimingInput(s)),l=t.convertEffectInput(i),c=function(){l(n,r)};return c._update=function(e){return null!==(r=o(e))},c._clear=function(){l(n,null)},c._hasSameTarget=function(e){return n===e},c._target=n,c._totalDuration=o._totalDuration,c._id=a,c}}(x,R),function(e,t){function n(e,t,n){n.enumerable=!0,n.configurable=!0,Object.defineProperty(e,t,n)}function i(e){this._element=e,this._surrogateStyle=document.createElementNS("http://www.w3.org/1999/xhtml","div").style,this._style=e.style,this._length=0,this._isAnimatedProperty={},this._updateSvgTransformAttr=function(e,t){return!(!t.namespaceURI||-1==t.namespaceURI.indexOf("/svg"))&&(a in e||(e[a]=/Trident|MSIE|IEMobile|Edge|Android 4/i.test(e.navigator.userAgent)),e[a])}(window,e),this._savedTransformAttr=null;for(var t=0;t<this._style.length;t++){var n=this._style[t];this._surrogateStyle[n]=this._style[n]}this._updateIndices()}function s(e){if(!e._webAnimationsPatchedStyle){var t=new i(e);try{n(e,"style",{get:function(){return t}})}catch(t){e.style._set=function(t,n){e.style[t]=n},e.style._clear=function(t){e.style[t]=""}}e._webAnimationsPatchedStyle=e.style}}var a="_webAnimationsUpdateSvgTransformAttr",r={cssText:1,length:1,parentRule:1},o={getPropertyCSSValue:1,getPropertyPriority:1,getPropertyValue:1,item:1,removeProperty:1,setProperty:1},l={removeProperty:1,setProperty:1};for(var c in i.prototype={get cssText(){return this._surrogateStyle.cssText},set cssText(e){for(var t={},n=0;n<this._surrogateStyle.length;n++)t[this._surrogateStyle[n]]=!0;for(this._surrogateStyle.cssText=e,this._updateIndices(),n=0;n<this._surrogateStyle.length;n++)t[this._surrogateStyle[n]]=!0;for(var i in t)this._isAnimatedProperty[i]||this._style.setProperty(i,this._surrogateStyle.getPropertyValue(i))},get length(){return this._surrogateStyle.length},get parentRule(){return this._style.parentRule},_updateIndices:function(){for(;this._length<this._surrogateStyle.length;)Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,get:function(e){return function(){return this._surrogateStyle[e]}}(this._length)}),this._length++;for(;this._length>this._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(t,n){this._style[t]=n,this._isAnimatedProperty[t]=!0,this._updateSvgTransformAttr&&"transform"==e.unprefixedPropertyName(t)&&(null==this._savedTransformAttr&&(this._savedTransformAttr=this._element.getAttribute("transform")),this._element.setAttribute("transform",e.transformToSvgMatrix(n)))},_clear:function(t){this._style[t]=this._surrogateStyle[t],this._updateSvgTransformAttr&&"transform"==e.unprefixedPropertyName(t)&&(this._savedTransformAttr?this._element.setAttribute("transform",this._savedTransformAttr):this._element.removeAttribute("transform"),this._savedTransformAttr=null),delete this._isAnimatedProperty[t]}},o)i.prototype[c]=function(e,t){return function(){var n=this._surrogateStyle[e].apply(this._surrogateStyle,arguments);return t&&(this._isAnimatedProperty[arguments[0]]||this._style[e].apply(this._style,arguments),this._updateIndices()),n}}(c,c in l);for(var d in document.documentElement.style)d in r||d in o||function(e){n(i.prototype,e,{get:function(){return this._surrogateStyle[e]},set:function(t){this._surrogateStyle[e]=t,this._updateIndices(),this._isAnimatedProperty&&!this._isAnimatedProperty[e]&&(this._style[e]=t)}})}(d);e.apply=function(t,n,i){s(t),t.style._set(e.propertyName(n),i)},e.clear=function(t,n){t._webAnimationsPatchedStyle&&t.style._clear(e.propertyName(n))}}(R),function(e){window.Element.prototype.animate=function(t,n){var i="";return n&&n.id&&(i=n.id),e.timeline._play(e.KeyframeEffect(this,t,n,i))}}(R),function(e,t){function n(e,t,i){if("number"==typeof e&&"number"==typeof t)return e*(1-i)+t*i;if("boolean"==typeof e&&"boolean"==typeof t)return i<.5?e:t;if(e.length==t.length){for(var s=[],a=0;a<e.length;a++)s.push(n(e[a],t[a],i));return s}throw"Mismatched interpolation arguments "+e+":"+t}R.Interpolation=function(e,t,i){return function(s){return i(n(e,t,s))}}}(),function(e,t){var n=function(){function e(e,t){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],i=0;i<4;i++)for(var s=0;s<4;s++)for(var a=0;a<4;a++)n[i][s]+=t[i][a]*e[a][s];return n}return function(t,n,i,s,a){for(var r=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)r[o][3]=a[o];for(o=0;o<3;o++)for(var l=0;l<3;l++)r[3][o]+=t[l]*r[l][o];var c=s[0],d=s[1],u=s[2],m=s[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];h[0][0]=1-2*(d*d+u*u),h[0][1]=2*(c*d-u*m),h[0][2]=2*(c*u+d*m),h[1][0]=2*(c*d+u*m),h[1][1]=1-2*(c*c+u*u),h[1][2]=2*(d*u-c*m),h[2][0]=2*(c*u-d*m),h[2][1]=2*(d*u+c*m),h[2][2]=1-2*(c*c+d*d),r=e(r,h);var p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(i[2]&&(p[2][1]=i[2],r=e(r,p)),i[1]&&(p[2][1]=0,p[2][0]=i[0],r=e(r,p)),i[0]&&(p[2][0]=0,p[1][0]=i[0],r=e(r,p)),o=0;o<3;o++)for(l=0;l<3;l++)r[o][l]*=n[o];return function(e){return 0==e[0][2]&&0==e[0][3]&&0==e[1][2]&&0==e[1][3]&&0==e[2][0]&&0==e[2][1]&&1==e[2][2]&&0==e[2][3]&&0==e[3][2]&&1==e[3][3]}(r)?[r[0][0],r[0][1],r[1][0],r[1][1],r[3][0],r[3][1]]:r[0].concat(r[1],r[2],r[3])}}();e.composeMatrix=n,e.quat=function(t,n,i){var s=e.dot(t,n);s=function(e,t,n){return Math.max(Math.min(e,1),-1)}(s);var a=[];if(1===s)a=t;else for(var r=Math.acos(s),o=1*Math.sin(i*r)/Math.sqrt(1-s*s),l=0;l<4;l++)a.push(t[l]*(Math.cos(i*r)-s*o)+n[l]*o);return a}}(R),function(e,t,n){e.sequenceNumber=0;var i=function(e,t,n){this.target=e,this.currentTime=t,this.timelineTime=n,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=e,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};t.Animation=function(t){this.id="",t&&t._id&&(this.id=t._id),this._sequenceNumber=e.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!0,this.onfinish=null,this._finishHandlers=[],this._effect=t,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},t.Animation.prototype={_ensureAlive:function(){this.playbackRate<0&&0===this.currentTime?this._inEffect=this._effect._update(-1):this._inEffect=this._effect._update(this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,t.timeline._animations.push(this))},_tickCurrentTime:function(e,t){e!=this._currentTime&&(this._currentTime=e,this._isFinished&&!t&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(e){e=+e,isNaN(e)||(t.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-e/this._playbackRate),this._currentTimePending=!1,this._currentTime!=e&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(e,!0),t.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(e){e=+e,isNaN(e)||this._paused||this._idle||(this._startTime=e,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),t.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(e){if(e!=this._playbackRate){var n=this.currentTime;this._playbackRate=e,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),t.applyDirtiedAnimation(this)),null!=n&&(this.currentTime=n)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),t.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,t.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),t.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(e,t){"function"==typeof t&&"finish"==e&&this._finishHandlers.push(t)},removeEventListener:function(e,t){if("finish"==e){var n=this._finishHandlers.indexOf(t);n>=0&&this._finishHandlers.splice(n,1)}},_fireEvents:function(e){if(this._isFinished){if(!this._finishedFlag){var t=new i(this,this._currentTime,e),n=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout((function(){n.forEach((function(e){e.call(t.target,t)}))}),0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(e,t){this._idle||this._paused||(null==this._startTime?t&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((e-this._startTime)*this.playbackRate)),t&&(this._currentTimePending=!1,this._fireEvents(e))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var e=this._effect._target;return e._activeAnimations||(e._activeAnimations=[]),e._activeAnimations},_markTarget:function(){var e=this._targetAnimations();-1===e.indexOf(this)&&e.push(this)},_unmarkTarget:function(){var e=this._targetAnimations(),t=e.indexOf(this);-1!==t&&e.splice(t,1)}}}(x,R),function(e,t,n){function i(e){var t=c;c=[],e<f.currentTime&&(e=f.currentTime),f._animations.sort(s),f._animations=o(e,!0,f._animations)[0],t.forEach((function(t){t[1](e)})),r()}function s(e,t){return e._sequenceNumber-t._sequenceNumber}function a(){this._animations=[],this.currentTime=window.performance&&performance.now?performance.now():0}function r(){h.forEach((function(e){e()})),h.length=0}function o(e,n,i){p=!0,m=!1,t.timeline.currentTime=e,u=!1;var s=[],a=[],r=[],o=[];return i.forEach((function(t){t._tick(e,n),t._inEffect?(a.push(t._effect),t._markTarget()):(s.push(t._effect),t._unmarkTarget()),t._needsTick&&(u=!0);var i=t._inEffect||t._needsTick;t._inTimeline=i,i?r.push(t):o.push(t)})),h.push.apply(h,s),h.push.apply(h,a),u&&requestAnimationFrame((function(){})),p=!1,[r,o]}var l=window.requestAnimationFrame,c=[],d=0;window.requestAnimationFrame=function(e){var t=d++;return 0==c.length&&l(i),c.push([t,e]),t},window.cancelAnimationFrame=function(e){c.forEach((function(t){t[0]==e&&(t[1]=function(){})}))},a.prototype={_play:function(n){n._timing=e.normalizeTimingInput(n.timing);var i=new t.Animation(n);return i._idle=!1,i._timeline=this,this._animations.push(i),t.restart(),t.applyDirtiedAnimation(i),i}};var u=!1,m=!1;t.restart=function(){return u||(u=!0,requestAnimationFrame((function(){})),m=!0),m},t.applyDirtiedAnimation=function(e){if(!p){e._markTarget();var n=e._targetAnimations();n.sort(s),o(t.timeline.currentTime,!1,n.slice())[1].forEach((function(e){var t=f._animations.indexOf(e);-1!==t&&f._animations.splice(t,1)})),r()}};var h=[],p=!1,f=new a;t.timeline=f}(x,R),function(e,t){function n(e,t){for(var n=0,i=0;i<e.length;i++)n+=e[i]*t[i];return n}function i(e,t){return[e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],e[0]*t[4]+e[4]*t[5]+e[8]*t[6]+e[12]*t[7],e[1]*t[4]+e[5]*t[5]+e[9]*t[6]+e[13]*t[7],e[2]*t[4]+e[6]*t[5]+e[10]*t[6]+e[14]*t[7],e[3]*t[4]+e[7]*t[5]+e[11]*t[6]+e[15]*t[7],e[0]*t[8]+e[4]*t[9]+e[8]*t[10]+e[12]*t[11],e[1]*t[8]+e[5]*t[9]+e[9]*t[10]+e[13]*t[11],e[2]*t[8]+e[6]*t[9]+e[10]*t[10]+e[14]*t[11],e[3]*t[8]+e[7]*t[9]+e[11]*t[10]+e[15]*t[11],e[0]*t[12]+e[4]*t[13]+e[8]*t[14]+e[12]*t[15],e[1]*t[12]+e[5]*t[13]+e[9]*t[14]+e[13]*t[15],e[2]*t[12]+e[6]*t[13]+e[10]*t[14]+e[14]*t[15],e[3]*t[12]+e[7]*t[13]+e[11]*t[14]+e[15]*t[15]]}function s(e){var t=e.rad||0;return((e.deg||0)/360+(e.grad||0)/400+(e.turn||0))*(2*Math.PI)+t}function a(e){switch(e.t){case"rotatex":var t=s(e.d[0]);return[1,0,0,0,0,Math.cos(t),Math.sin(t),0,0,-Math.sin(t),Math.cos(t),0,0,0,0,1];case"rotatey":return t=s(e.d[0]),[Math.cos(t),0,-Math.sin(t),0,0,1,0,0,Math.sin(t),0,Math.cos(t),0,0,0,0,1];case"rotate":case"rotatez":return t=s(e.d[0]),[Math.cos(t),Math.sin(t),0,0,-Math.sin(t),Math.cos(t),0,0,0,0,1,0,0,0,0,1];case"rotate3d":var n=e.d[0],i=e.d[1],a=e.d[2],r=(t=s(e.d[3]),n*n+i*i+a*a);if(0===r)n=1,i=0,a=0;else if(1!==r){var o=Math.sqrt(r);n/=o,i/=o,a/=o}var l=Math.sin(t/2),c=l*Math.cos(t/2),d=l*l;return[1-2*(i*i+a*a)*d,2*(n*i*d+a*c),2*(n*a*d-i*c),0,2*(n*i*d-a*c),1-2*(n*n+a*a)*d,2*(i*a*d+n*c),0,2*(n*a*d+i*c),2*(i*a*d-n*c),1-2*(n*n+i*i)*d,0,0,0,0,1];case"scale":return[e.d[0],0,0,0,0,e.d[1],0,0,0,0,1,0,0,0,0,1];case"scalex":return[e.d[0],0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,e.d[0],0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,e.d[0],0,0,0,0,1];case"scale3d":return[e.d[0],0,0,0,0,e.d[1],0,0,0,0,e.d[2],0,0,0,0,1];case"skew":var u=s(e.d[0]),m=s(e.d[1]);return[1,Math.tan(m),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return t=s(e.d[0]),[1,0,0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return t=s(e.d[0]),[1,Math.tan(t),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,n=e.d[0].px||0,i=e.d[1].px||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,n=e.d[0].px||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,i=e.d[0].px||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,a=e.d[0].px||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,n=e.d[0].px||0,i=e.d[1].px||0,a=e.d[2].px||0,1];case"perspective":return[1,0,0,0,0,1,0,0,0,0,1,e.d[0].px?-1/e.d[0].px:0,0,0,0,1];case"matrix":return[e.d[0],e.d[1],0,0,e.d[2],e.d[3],0,0,0,0,1,0,e.d[4],e.d[5],0,1];case"matrix3d":return e.d}}function r(e){return 0===e.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:e.map(a).reduce(i)}var o=function(){function e(e){return e[0][0]*e[1][1]*e[2][2]+e[1][0]*e[2][1]*e[0][2]+e[2][0]*e[0][1]*e[1][2]-e[0][2]*e[1][1]*e[2][0]-e[1][2]*e[2][1]*e[0][0]-e[2][2]*e[0][1]*e[1][0]}function t(e){var t=i(e);return[e[0]/t,e[1]/t,e[2]/t]}function i(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}function s(e,t,n,i){return[n*e[0]+i*t[0],n*e[1]+i*t[1],n*e[2]+i*t[2]]}return function(a){var r=[a.slice(0,4),a.slice(4,8),a.slice(8,12),a.slice(12,16)];if(1!==r[3][3])return null;for(var o=[],l=0;l<4;l++)o.push(r[l].slice());for(l=0;l<3;l++)o[l][3]=0;if(0===e(o))return null;var c,d=[];r[0][3]||r[1][3]||r[2][3]?(d.push(r[0][3]),d.push(r[1][3]),d.push(r[2][3]),d.push(r[3][3]),c=function(e,t){for(var n=[],i=0;i<4;i++){for(var s=0,a=0;a<4;a++)s+=e[a]*t[a][i];n.push(s)}return n}(d,function(e){return[[e[0][0],e[1][0],e[2][0],e[3][0]],[e[0][1],e[1][1],e[2][1],e[3][1]],[e[0][2],e[1][2],e[2][2],e[3][2]],[e[0][3],e[1][3],e[2][3],e[3][3]]]}(function(t){for(var n=1/e(t),i=t[0][0],s=t[0][1],a=t[0][2],r=t[1][0],o=t[1][1],l=t[1][2],c=t[2][0],d=t[2][1],u=t[2][2],m=[[(o*u-l*d)*n,(a*d-s*u)*n,(s*l-a*o)*n,0],[(l*c-r*u)*n,(i*u-a*c)*n,(a*r-i*l)*n,0],[(r*d-o*c)*n,(c*s-i*d)*n,(i*o-s*r)*n,0]],h=[],p=0;p<3;p++){for(var f=0,E=0;E<3;E++)f+=t[3][E]*m[E][p];h.push(f)}return h.push(1),m.push(h),m}(o)))):c=[0,0,0,1];var u=r[3].slice(0,3),m=[];m.push(r[0].slice(0,3));var h=[];h.push(i(m[0])),m[0]=t(m[0]);var p=[];m.push(r[1].slice(0,3)),p.push(n(m[0],m[1])),m[1]=s(m[1],m[0],1,-p[0]),h.push(i(m[1])),m[1]=t(m[1]),p[0]/=h[1],m.push(r[2].slice(0,3)),p.push(n(m[0],m[2])),m[2]=s(m[2],m[0],1,-p[1]),p.push(n(m[1],m[2])),m[2]=s(m[2],m[1],1,-p[2]),h.push(i(m[2])),m[2]=t(m[2]),p[1]/=h[2],p[2]/=h[2];var f=function(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}(m[1],m[2]);if(n(m[0],f)<0)for(l=0;l<3;l++)h[l]*=-1,m[l][0]*=-1,m[l][1]*=-1,m[l][2]*=-1;var E,g,b=m[0][0]+m[1][1]+m[2][2]+1;return b>1e-4?(E=.5/Math.sqrt(b),g=[(m[2][1]-m[1][2])*E,(m[0][2]-m[2][0])*E,(m[1][0]-m[0][1])*E,.25/E]):m[0][0]>m[1][1]&&m[0][0]>m[2][2]?g=[.25*(E=2*Math.sqrt(1+m[0][0]-m[1][1]-m[2][2])),(m[0][1]+m[1][0])/E,(m[0][2]+m[2][0])/E,(m[2][1]-m[1][2])/E]:m[1][1]>m[2][2]?(E=2*Math.sqrt(1+m[1][1]-m[0][0]-m[2][2]),g=[(m[0][1]+m[1][0])/E,.25*E,(m[1][2]+m[2][1])/E,(m[0][2]-m[2][0])/E]):(E=2*Math.sqrt(1+m[2][2]-m[0][0]-m[1][1]),g=[(m[0][2]+m[2][0])/E,(m[1][2]+m[2][1])/E,.25*E,(m[1][0]-m[0][1])/E]),[u,h,p,g,c]}}();e.dot=n,e.makeMatrixDecomposition=function(e){return[o(r(e))]},e.transformListToMatrix=r}(R),function(e){function t(e,t){var n=e.exec(t);if(n)return[n=e.ignoreCase?n[0].toLowerCase():n[0],t.substr(n.length)]}function n(e,t){var n=e(t=t.replace(/^\s*/,""));if(n)return[n[0],n[1].replace(/^\s*/,"")]}function i(e,t,n,i,s){for(var a=[],r=[],o=[],l=function(e,t){for(var n=e,i=t;n&&i;)n>i?n%=i:i%=n;return e*t/(n+i)}(i.length,s.length),c=0;c<l;c++){var d=t(i[c%i.length],s[c%s.length]);if(!d)return;a.push(d[0]),r.push(d[1]),o.push(d[2])}return[a,r,function(t){var i=t.map((function(e,t){return o[t](e)})).join(n);return e?e(i):i}]}e.consumeToken=t,e.consumeTrimmed=n,e.consumeRepeated=function(e,i,s){e=n.bind(null,e);for(var a=[];;){var r=e(s);if(!r)return[a,s];if(a.push(r[0]),!(r=t(i,s=r[1]))||""==r[1])return[a,s];s=r[1]}},e.consumeParenthesised=function(e,t){for(var n=0,i=0;i<t.length&&(!/\s|,/.test(t[i])||0!=n);i++)if("("==t[i])n++;else if(")"==t[i]&&(0==--n&&i++,n<=0))break;var s=e(t.substr(0,i));return null==s?void 0:[s,t.substr(i)]},e.ignore=function(e){return function(t){var n=e(t);return n&&(n[0]=void 0),n}},e.optional=function(e,t){return function(n){return e(n)||[t,n]}},e.consumeList=function(t,n){for(var i=[],s=0;s<t.length;s++){var a=e.consumeTrimmed(t[s],n);if(!a||""==a[0])return;void 0!==a[0]&&i.push(a[0]),n=a[1]}if(""==n)return i},e.mergeNestedRepeated=i.bind(null,null),e.mergeWrappedNestedRepeated=i,e.mergeList=function(e,t,n){for(var i=[],s=[],a=[],r=0,o=0;o<n.length;o++)if("function"==typeof n[o]){var l=n[o](e[r],t[r++]);i.push(l[0]),s.push(l[1]),a.push(l[2])}else!function(e){i.push(!1),s.push(!1),a.push((function(){return n[e]}))}(o);return[i,s,function(e){for(var t="",n=0;n<e.length;n++)t+=a[n](e[n]);return t}]}}(R),function(e){function t(t){var n={inset:!1,lengths:[],color:null},i=e.consumeRepeated((function(t){var i=e.consumeToken(/^inset/i,t);return i?(n.inset=!0,i):(i=e.consumeLengthOrPercent(t))?(n.lengths.push(i[0]),i):(i=e.consumeColor(t))?(n.color=i[0],i):void 0}),/^/,t);if(i&&i[0].length)return[n,i[1]]}var n=function(t,n,i,s){function a(e){return{inset:e,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var r=[],o=[],l=0;l<i.length||l<s.length;l++){var c=i[l]||a(s[l].inset),d=s[l]||a(i[l].inset);r.push(c),o.push(d)}return e.mergeNestedRepeated(t,n,r,o)}.bind(null,(function(t,n){for(;t.lengths.length<Math.max(t.lengths.length,n.lengths.length);)t.lengths.push({px:0});for(;n.lengths.length<Math.max(t.lengths.length,n.lengths.length);)n.lengths.push({px:0});if(t.inset==n.inset&&!!t.color==!!n.color){for(var i,s=[],a=[[],0],r=[[],0],o=0;o<t.lengths.length;o++){var l=e.mergeDimensions(t.lengths[o],n.lengths[o],2==o);a[0].push(l[0]),r[0].push(l[1]),s.push(l[2])}if(t.color&&n.color){var c=e.mergeColors(t.color,n.color);a[1]=c[0],r[1]=c[1],i=c[2]}return[a,r,function(e){for(var n=t.inset?"inset ":" ",a=0;a<s.length;a++)n+=s[a](e[0][a])+" ";return i&&(n+=i(e[1])),n}]}}),", ");e.addPropertiesHandler((function(n){var i=e.consumeRepeated(t,/^,/,n);if(i&&""==i[1])return i[0]}),n,["box-shadow","text-shadow"])}(R),function(e,t){function n(e){return e.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function i(e,t,n){return Math.min(t,Math.max(e,n))}function s(e){if(/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e))return Number(e)}function a(e,t){return function(s,a){return[s,a,function(s){return n(i(e,t,s))}]}}function r(e){var t=e.trim().split(/\s*[\s,]\s*/);if(0!==t.length){for(var n=[],i=0;i<t.length;i++){var a=s(t[i]);if(void 0===a)return;n.push(a)}return n}}e.clamp=i,e.addPropertiesHandler(r,(function(e,t){if(e.length==t.length)return[e,t,function(e){return e.map(n).join(" ")}]}),["stroke-dasharray"]),e.addPropertiesHandler(s,a(0,1/0),["border-image-width","line-height"]),e.addPropertiesHandler(s,a(0,1),["opacity","shape-image-threshold"]),e.addPropertiesHandler(s,(function(e,t){if(0!=e)return a(0,1/0)(e,t)}),["flex-grow","flex-shrink"]),e.addPropertiesHandler(s,(function(e,t){return[e,t,function(e){return Math.round(i(1,1/0,e))}]}),["orphans","widows"]),e.addPropertiesHandler(s,(function(e,t){return[e,t,Math.round]}),["z-index"]),e.parseNumber=s,e.parseNumberList=r,e.mergeNumbers=function(e,t){return[e,t,n]},e.numberToString=n}(R),R.addPropertiesHandler(String,(function(e,t){if("visible"==e||"visible"==t)return[0,1,function(n){return n<=0?e:n>=1?t:"visible"}]}),["visibility"]),function(e,t){function n(e){e=e.trim(),a.fillStyle="#000",a.fillStyle=e;var t=a.fillStyle;if(a.fillStyle="#fff",a.fillStyle=e,t==a.fillStyle){a.fillRect(0,0,1,1);var n=a.getImageData(0,0,1,1).data;a.clearRect(0,0,1,1);var i=n[3]/255;return[n[0]*i,n[1]*i,n[2]*i,i]}}function i(t,n){return[t,n,function(t){function n(e){return Math.max(0,Math.min(255,e))}if(t[3])for(var i=0;i<3;i++)t[i]=Math.round(n(t[i]/t[3]));return t[3]=e.numberToString(e.clamp(0,1,t[3])),"rgba("+t.join(",")+")"}]}var s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");s.width=s.height=1;var a=s.getContext("2d");e.addPropertiesHandler(n,i,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),e.consumeColor=e.consumeParenthesised.bind(null,n),e.mergeColors=i}(R),function(e,t){function n(e){function t(){var t=r.exec(e);a=t?t[0]:void 0}function n(){if("("!==a)return function(){var e=Number(a);return t(),e}();t();var e=s();return")"!==a?NaN:(t(),e)}function i(){for(var e=n();"*"===a||"/"===a;){var i=a;t();var s=n();"*"===i?e*=s:e/=s}return e}function s(){for(var e=i();"+"===a||"-"===a;){var n=a;t();var s=i();"+"===n?e+=s:e-=s}return e}var a,r=/([\+\-\w\.]+|[\(\)\*\/])/g;return t(),s()}function i(e,t){if("0"==(t=t.trim().toLowerCase())&&"px".search(e)>=0)return{px:0};if(/^[^(]*$|^calc/.test(t)){t=t.replace(/calc\(/g,"(");var i={};t=t.replace(e,(function(e){return i[e]=null,"U"+e}));for(var s="U("+e.source+")",a=t.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+s,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),r=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],o=0;o<r.length;)r[o].test(a)?(a=a.replace(r[o],"$1"),o=0):o++;if("D"==a){for(var l in i){var c=n(t.replace(new RegExp("U"+l,"g"),"").replace(new RegExp(s,"g"),"*0"));if(!isFinite(c))return;i[l]=c}return i}}}functi