-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmultiselect-1.js
16 lines (14 loc) · 45.3 KB
/
multiselect-1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(window.shopifySpbJsonp=window.shopifySpbJsonp||[]).push([[1],{151:function(e,t,n){e.exports=n(242)()},152:function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return o}),n.d(t,"__assign",function(){return i}),n.d(t,"__rest",function(){return a}),n.d(t,"__decorate",function(){return u}),n.d(t,"__param",function(){return c}),n.d(t,"__metadata",function(){return s}),n.d(t,"__awaiter",function(){return l}),n.d(t,"__generator",function(){return f}),n.d(t,"__exportStar",function(){return d}),n.d(t,"__values",function(){return p}),n.d(t,"__read",function(){return h}),n.d(t,"__spread",function(){return v}),n.d(t,"__await",function(){return y}),n.d(t,"__asyncGenerator",function(){return m}),n.d(t,"__asyncDelegator",function(){return b}),n.d(t,"__asyncValues",function(){return g}),n.d(t,"__makeTemplateObject",function(){return _}),n.d(t,"__importStar",function(){return w}),n.d(t,"__importDefault",function(){return P});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
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
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function c(e,t){return function(n,r){t(n,r,e)}}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,u)}c((r=r.apply(e,t||[])).next())})}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function d(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function m(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||u(e,t)})})}function u(e,t){try{c(o[e](t))}catch(e){f(i[0][3],e)}}function c(e){e.value instanceof y?Promise.resolve(e.value.v).then(s,l):f(i[0][2],e)}function s(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function b(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function g(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof p?p(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){o(r,i,(t=e[n](t)).done,t.value)})}}function o(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function P(e){return e&&e.__esModule?e:{default:e}}},16:function(e,t,n){"use strict";n.r(t),n.d(t,"version",function(){return a}),n.d(t,"DOM",function(){return M}),n.d(t,"Children",function(){return O}),n.d(t,"render",function(){return _}),n.d(t,"createClass",function(){return B}),n.d(t,"createFactory",function(){return N}),n.d(t,"createElement",function(){return D}),n.d(t,"cloneElement",function(){return I}),n.d(t,"isValidElement",function(){return U}),n.d(t,"findDOMNode",function(){return G}),n.d(t,"unmountComponentAtNode",function(){return C}),n.d(t,"Component",function(){return ne}),n.d(t,"PureComponent",function(){return re}),n.d(t,"unstable_renderSubtreeIntoContainer",function(){return P}),n.d(t,"__spread",function(){return z});var r=n(151),o=n.n(r);n.d(t,"PropTypes",function(){return o.a});var i=n(36),a="15.1.0",u="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),c="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,s="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("__preactCompatWrapper"):"__preactCompatWrapper",l={constructor:1,render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},f=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/,d={},p="undefined"==typeof process||!process.env||!1;function h(){return null}var v=Object(i.h)("a",null).constructor;v.prototype.$$typeof=c,v.prototype.preactCompatUpgraded=!1,v.prototype.preactCompatNormalized=!1,Object.defineProperty(v.prototype,"type",{get:function(){return this.nodeName},set:function(e){this.nodeName=e},configurable:!0}),Object.defineProperty(v.prototype,"props",{get:function(){return this.attributes},set:function(e){this.attributes=e},configurable:!0});var y=i.options.event;i.options.event=function(e){return y&&(e=y(e)),e.persist=Object,e.nativeEvent=e,e};var m=i.options.vnode;function b(e){var t=e.nodeName,n=e.attributes;e.attributes={},t.defaultProps&&z(e.attributes,t.defaultProps),n&&z(e.attributes,n)}function g(e,t){var n,r,o;if(t){for(o in t)if(n=f.test(o))break;if(n)for(o in r=e.attributes={},t)t.hasOwnProperty(o)&&(r[f.test(o)?o.replace(/([A-Z0-9])/,"-$1").toLowerCase():o]=t[o])}}function _(e,t,n){var r=t&&t._preactCompatRendered&&t._preactCompatRendered.base;r&&r.parentNode!==t&&(r=null),!r&&t&&(r=t.firstElementChild);for(var o=t.childNodes.length;o--;)t.childNodes[o]!==r&&t.removeChild(t.childNodes[o]);var a=Object(i.render)(e,t,r);return t&&(t._preactCompatRendered=a&&(a._component||{base:a})),"function"==typeof n&&n(),a&&a._component||a}i.options.vnode=function(e){if(!e.preactCompatUpgraded){e.preactCompatUpgraded=!0;var t=e.nodeName,n=e.attributes=z({},e.attributes);"function"==typeof t?(!0===t[s]||t.prototype&&"isReactComponent"in t.prototype)&&(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),e.preactCompatNormalized||A(e),b(e)):(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),n.defaultValue&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),g(e,n))}m&&m(e)};var w=function(){};function P(e,t,n,r){var o=_(Object(i.h)(w,{context:e.context},t),n),a=o._component||o.base;return r&&r.call(a,o),a}function C(e){var t=e._preactCompatRendered&&e._preactCompatRendered.base;return!(!t||t.parentNode!==e)&&(Object(i.render)(Object(i.h)(h),e,t),!0)}w.prototype.getChildContext=function(){return this.props.context},w.prototype.render=function(e){return e.children[0]};var x,E=[],O={map:function(e,t,n){return null==e?null:(e=O.toArray(e),n&&n!==e&&(t=t.bind(n)),e.map(t))},forEach:function(e,t,n){if(null==e)return null;e=O.toArray(e),n&&n!==e&&(t=t.bind(n)),e.forEach(t)},count:function(e){return e&&e.length||0},only:function(e){if(1!==(e=O.toArray(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:function(e){return null==e?[]:E.concat(e)}};function N(e){return D.bind(null,e)}for(var M={},k=u.length;k--;)M[u[k]]=N(u[k]);function S(e,t){for(var n=t||0;n<e.length;n++){var r=e[n];Array.isArray(r)?S(r):r&&"object"==typeof r&&!U(r)&&(r.props&&r.type||r.attributes&&r.nodeName||r.children)&&(e[n]=D(r.type||r.nodeName,r.props||r.attributes,r.children))}}function R(e){return"function"==typeof e&&!(e.prototype&&e.prototype.render)}function T(e){return B({displayName:e.displayName||e.name,render:function(){return e(this.props,this.context)}})}function j(e){var t=e[s];return t?!0===t?e:t:(t=T(e),Object.defineProperty(t,s,{configurable:!0,value:!0}),t.displayName=e.displayName,t.propTypes=e.propTypes,t.defaultProps=e.defaultProps,Object.defineProperty(e,s,{configurable:!0,value:t}),t)}function D(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return S(e,2),A(i.h.apply(void 0,e))}function A(e){e.preactCompatNormalized=!0,V(e),R(e.nodeName)&&(e.nodeName=j(e.nodeName));var t=e.attributes.ref,n=t&&typeof t;return!x||"string"!==n&&"number"!==n||(e.attributes.ref=L(t,x)),F(e),e}function I(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];if(!U(e))return e;var o=e.attributes||e.props,a=[Object(i.h)(e.nodeName||e.type,z({},o),e.children||o&&o.children),t];return n&&n.length?a.push(n):t&&t.children&&a.push(t.children),A(i.cloneElement.apply(void 0,a))}function U(e){return e&&(e instanceof v||e.$$typeof===c)}function L(e,t){return t._refProxies[e]||(t._refProxies[e]=function(n){t&&t.refs&&(t.refs[e]=n,null===n&&(delete t._refProxies[e],t=null))})}function F(e){var t=e.nodeName,n=e.attributes;if(n&&"string"==typeof t){var r={};for(var o in n)r[o.toLowerCase()]=o;if(r.ondoubleclick&&(n.ondblclick=n[r.ondoubleclick],delete n[r.ondoubleclick]),r.onchange&&("textarea"===t||"input"===t.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var i=r.oninput||"oninput";n[i]||(n[i]=Y([n[i],n[r.onchange]]),delete n[r.onchange])}}}function V(e){var t=e.attributes||(e.attributes={});W.enumerable="className"in t,t.className&&(t.class=t.className),Object.defineProperty(t,"className",W)}var W={configurable:!0,get:function(){return this.class},set:function(e){this.class=e}};function z(e,t){for(var n=arguments,r=1,o=void 0;r<arguments.length;r++)if(o=n[r])for(var i in o)o.hasOwnProperty(i)&&(e[i]=o[i]);return e}function q(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}function G(e){return e&&e.base||e}function H(){}function B(e){function t(e,t){X(this),ne.call(this,e,t,d),K.call(this,e,t)}return(e=z({constructor:t},e)).mixins&&$(e,J(e.mixins)),e.statics&&z(t,e.statics),e.propTypes&&(t.propTypes=e.propTypes),e.defaultProps&&(t.defaultProps=e.defaultProps),e.getDefaultProps&&(t.defaultProps=e.getDefaultProps.call(t)),H.prototype=ne.prototype,t.prototype=z(new H,e),t.displayName=e.displayName||"Component",t}function J(e){for(var t={},n=0;n<e.length;n++){var r=e[n];for(var o in r)r.hasOwnProperty(o)&&"function"==typeof r[o]&&(t[o]||(t[o]=[])).push(r[o])}return t}function $(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=Y(t[n].concat(e[n]||E),"getDefaultProps"===n||"getInitialState"===n||"getChildContext"===n))}function X(e){for(var t in e){var n=e[t];"function"!=typeof n||n.__bound||l.hasOwnProperty(t)||((e[t]=n.bind(e)).__bound=!0)}}function Z(e,t,n){if("string"==typeof t&&(t=e.constructor.prototype[t]),"function"==typeof t)return t.apply(e,n)}function Y(e,t){return function(){for(var n,r=arguments,o=this,i=0;i<e.length;i++){var a=Z(o,e[i],r);if(t&&null!=a)for(var u in n||(n={}),a)a.hasOwnProperty(u)&&(n[u]=a[u]);else void 0!==a&&(n=a)}return n}}function K(e,t){Q.call(this,e,t),this.componentWillReceiveProps=Y([Q,this.componentWillReceiveProps||"componentWillReceiveProps"]),this.render=Y([Q,ee,this.render||"render",te])}function Q(e,t){if(e){var n=e.children;if(n&&Array.isArray(n)&&1===n.length&&("string"==typeof n[0]||"function"==typeof n[0]||n[0]instanceof v)&&(e.children=n[0],e.children&&"object"==typeof e.children&&(e.children.length=1,e.children[0]=e.children)),p){var r="function"==typeof this?this:this.constructor,i=this.propTypes||r.propTypes,a=this.displayName||r.name;i&&o.a.checkPropTypes(i,e,"prop",a)}}}function ee(e){x=this}function te(){x===this&&(x=null)}function ne(e,t,n){i.Component.call(this,e,t),this.state=this.getInitialState?this.getInitialState():{},this.refs={},this._refProxies={},n!==d&&K.call(this,e,t)}function re(e,t){ne.call(this,e,t)}z(ne.prototype=new i.Component,{constructor:ne,isReactComponent:{},replaceState:function(e,t){var n=this;for(var r in this.setState(e,t),n.state)r in e||delete n.state[r]},getDOMNode:function(){return this.base},isMounted:function(){return!!this.base}}),H.prototype=ne.prototype,re.prototype=new H,re.prototype.isPureReactComponent=!0,re.prototype.shouldComponentUpdate=function(e,t){return q(this.props,e)||q(this.state,t)};var oe={version:a,DOM:M,PropTypes:o.a,Children:O,render:_,createClass:B,createFactory:N,createElement:D,cloneElement:I,isValidElement:U,findDOMNode:G,unmountComponentAtNode:C,Component:ne,PureComponent:re,unstable_renderSubtreeIntoContainer:P,__spread:z};t.default=oe},162:function(e,t,n){var r=n(237),o=n(213),i=n(236);function a(e){return r(e)||o(e)||i()}e.exports=a},163:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(152),o=function(e){function t(n){var r=e.call(this,"Error producing to the Monorail Edge. Response received: "+JSON.stringify(n))||this;return Object.setPrototypeOf(r,t.prototype),r.response=n,r}return r.__extends(t,e),t}(Error);t.MonorailUnableToProduceError=o;var i=function(e){function t(n){var r=e.call(this,"Error completing request. A network failure may have prevented the request from completing. Error: "+n)||this;return Object.setPrototypeOf(r,t.prototype),r}return r.__extends(t,e),t}(Error);t.MonorailRequestError=i;var a=function(e){function t(n){var r=e.call(this,""+n)||this;return Object.setPrototypeOf(r,t.prototype),r}return r.__extends(t,e),t}(Error);t.MonorailRetriesExceededError=a},187:function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);function o(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}e.exports=o},188:function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},189:function(e,t,n){var r=n(233),o=n(232),i=o;i.v1=r,i.v4=o,e.exports=i},190:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(235);t.Monorail=r.Monorail;var o=n(163);t.MonorailRequestError=o.MonorailRequestError,t.MonorailUnableToProduceError=o.MonorailUnableToProduceError,t.MonorailRetriesExceededError=o.MonorailRetriesExceededError;var i=n(229);t.RetryMiddleware=i.RetryMiddleware},191:function(e,t,n){"use strict";n.d(t,"a",function(){return Z});n(159),n(186),n(238),n(184);var r,o=n(0),i=n.n(o),a=(n(57),n(93),n(49)),u=n.n(a),c=(n(78),n(39)),s=n.n(c),l=n(26),f=n.n(l),d=n(38),p=n.n(d),h=(n(194),n(150),n(160),n(162)),v=n.n(h),y=(n(182),n(181),n(180),n(223),n(4)),m=n.n(y),b=n(7),g=n.n(b);n(179),n(148),n(185);function _(e,t){if("string"==typeof t)return t;switch(t.type){case"function":return e[t.value]();case"field":return e[t.value]}}!function(e){e[e.error=1]="error",e[e.warn=2]="warn",e[e.log=3]="log",e[e.info=4]="info",e[e.debug=5]="debug"}(r||(r={}));Object.keys(r).map(function(e){return r[e]}).filter(function(e){return"string"==typeof e});var w="[Judge]";function P(e){return"string"==typeof e&&e in r}function C(){var e=new Map;return decodeURIComponent(location.search).replace(/([^?=&]+)(=([^&]*))?/g,function(t,n,r,o){return e.set(n,o),e.get(n)}),e}var x=new(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.error;m()(this,e),this.level=t}return g()(e,[{key:"debug",value:function(){if(this.levelGuard(r.debug)){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,i;if(console.debug)(o=console).debug.apply(o,[w].concat(t));else(i=console).log.apply(i,[w].concat(t))}}},{key:"log",value:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return this.levelGuard(r.log)&&(e=console).log.apply(e,[w].concat(n))}},{key:"warn",value:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return this.levelGuard(r.warn)&&(e=console).warn.apply(e,[w].concat(n))}},{key:"error",value:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return this.levelGuard(r.error)&&(e=console).error.apply(e,[w].concat(n))}},{key:"info",value:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return this.levelGuard(r.info)&&(e=console).info.apply(e,[w].concat(n))}},{key:"isDebugMode",value:function(){return this.levelGuard(r.debug)}},{key:"levelGuard",value:function(e){return e<=this.loggingLevel}},{key:"loggingLevel",get:function(){var e=C().get("loggingLevel");if(!e)return this.level;if(!P(e))throw new Error("Unknown logging level: ".concat(e));return r[e]}}]),e}()),E=new Map;function O(e){var t=E.get(e);return t||(t=[],E.set(e,t),t)}function N(e,t,n){R(e)&&S(O(e),t,n)}var M=["time","value","label"];function k(e){return[M].concat(v()(O(e))).map(function(e){return e.join("\t")}).join("\n")}function S(e,t,n){e.push([Date.now(),n,t])}function R(e){return-1!==window.location.search.indexOf("timeseries=".concat(e))}function T(e,t){return function(n,r,o){if(R(e)){x.debug('Collecting timeseries data for "'.concat(e,'" with ').concat(JSON.stringify(t)));var i=o.value,a=O(e);o.value=function(){for(var e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var u=i.apply(e,r),c=_(e,t);return S(a,c,u),u}}else x.debug('Skipping timeseries data for "'.concat(e,'"'))}}window.spbExportTimeseries=k;var j=3e3;function D(e,t){var n=e,r=-1,o=j/Math.sqrt(t),i=r*Math.pow(n/o,2)+t;return N("score","threshold",i),i}function A(e,t,n){var r=D(t,n);e.sort(function(e,t){return t.score()-e.score()});var o=e.find(function(e){return e.score()>=r});return o||null}var I,U=function(e){function t(){return m()(this,t),s()(this,f()(t).apply(this,arguments))}return p()(t,e),t}(function(){function e(){m()(this,e),this.subscribers={}}return g()(e,[{key:"subscribe",value:function(e,t){var n=this.subscribers[e]||(this.subscribers[e]=new Set);return n.add(t),{unsubscribe:function(){n.delete(t)}}}},{key:"broadcast",value:function(e,t){var n=this.subscribers[e];n&&n.forEach(function(e){e(t)})}}]),e}());function L(e,t){return function(n,r,o){if(x.isDebugMode()){var i=n.constructor.name,a=o.value,u="".concat(i,".").concat(r),c=t&&t.tag||u,s=t&&t.metadata;x.debug("tracing ".concat(u),{flags:e,options:t}),o.value=function(){for(var t=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=a.apply(t,r),u={},l=[c,u];return s&&(u.metadata=_(this,s)),-1!==e.indexOf("c")&&(u.args=r),-1!==e.indexOf("r")&&(u.return=i),x.debug.apply(x,l),i}}}}!function(e){e[e.accelerated=0]="accelerated",e[e.ready=1]="ready"}(I||(I={}));var F=Object.keys(I).map(function(e){return I[e]}).filter(function(e){return"string"==typeof e}),V={AmazonPay:{accelerated:40,ready:1},ApplePay:{accelerated:99,ready:1},Checkout:{accelerated:50,ready:40},ShopifyPay:{accelerated:98,ready:1},GooglePay:{accelerated:80,ready:1},NonAcceleratedDummyInstrument:{accelerated:10,ready:10},DummyInstrument:{accelerated:50,ready:50},DummyInstrumentForcedFailure:{accelerated:49,ready:50},PayPal:{accelerated:49,ready:1},Venmo:{accelerated:45,ready:1}},W={AmazonPay:75,ApplePay:85,Checkout:100,ShopifyPay:84,GooglePay:80,DummyInstrument:100,DummyInstrumentForcedFailure:99,PayPal:82,Venmo:81,NonAcceleratedDummyInstrument:1},z=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":u()(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},q=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":u()(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},G=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,u)}c((r=r.apply(e,t||[])).next())})},H=function(){function e(t,n){m()(this,e),this.features={accelerated:!1,ready:!1},this.eventEmitter=t,this.instrumentPromise=n.instrumentPromise,this.coefficients=V[n.metadata],this.sheetScore=W[n.metadata],this.metadata=n.metadata,this.loaded=!1}return g()(e,[{key:"start",value:function(){return G(this,void 0,void 0,i.a.mark(function e(){var t,n;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.instrumentPromise;case 3:t=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),x.warn("Error raised while loading the instrument",e.t0);case 9:if(this.loaded=!0,this.instrument=t,t){e.next=14;break}return this.finalizeScore(t),e.abrupt("return");case 14:return this.setFeature("ready",!0,t),e.next=17,t.canMakeAcceleratedPurchase();case 17:n=e.sent,this.setFeature("accelerated",n,t),this.finalizeScore(t);case 20:case"end":return e.stop()}},e,this,[[0,6]])}))}},{key:"score",value:function(){var e=this.features,t=this.coefficients;return B(function(n){return Number(e[n])*t[n]})}},{key:"maxScore",value:function(){var e=this;return this.isFinished()?this.score():B(function(t){return e.coefficients[t]})}},{key:"isFinished",value:function(){return Object.isFrozen(this.features)}},{key:"setFeature",value:function(e,t,n){this.features[e]=t,N("score","event","".concat(this.metadata," - ").concat(e," - ").concat(t)),this.eventEmitter.broadcast("instrument:score-changed",{instrument:n,featureChanged:e,featureValue:t,score:this.score()})}},{key:"finalizeScore",value:function(e){Object.freeze(this.features),e&&this.eventEmitter.broadcast("instrument:score-finalized",{instrument:e,score:this.score()})}},{key:"isLoaded",get:function(){return this.loaded}},{key:"instrument",get:function(){return this.instrumentPromiseValue},set:function(e){this.instrumentPromiseValue=e,this.eventEmitter.broadcast("instrument:loaded",{instrument:e,sheetScore:this.sheetScore})}}]),e}();function B(e){return F.reduce(function(t,n){return e(n)+t},0)}z([T("score",{type:"field",value:"metadata"}),q("design:type",Function),q("design:paramtypes",[]),q("design:returntype",Number)],H.prototype,"score",null),z([T("max-score",{type:"field",value:"maxScoreMetadata"}),q("design:type",Function),q("design:paramtypes",[]),q("design:returntype",Number)],H.prototype,"maxScore",null),z([L("c",{metadata:{type:"field",value:"metadata"}}),q("design:type",Function),q("design:paramtypes",[String,Boolean,Object]),q("design:returntype",void 0)],H.prototype,"setFeature",null),z([L("c",{metadata:{type:"field",value:"metadata"}}),q("design:type",Function),q("design:paramtypes",[Object]),q("design:returntype",void 0)],H.prototype,"finalizeScore",null);var J=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":u()(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},$=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":u()(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},X=50,Z=function(){function e(){m()(this,e),this.children=[],this.eventEmitter=new U,this.startTime=Date.now()}return g()(e,[{key:"start",value:function(){var e,t=this,n=[],r=!1;this.startTime=Date.now(),this.children.forEach(function(e){return e.start()});var o=function(){if(!r){var o=t.value();o&&(c(),t.eventEmitter.broadcast("instrument:upstream-selected",{instrument:o}),t.decorateWithUpstream(n,o),t.finishInstrumentLoading(n,e))}},i=function(r){r.instrument&&n.push(Object.assign({},r,{upstream:!1})),t.finishInstrumentLoading(n,e)},a=[this.eventEmitter.subscribe("instrument:score-changed",o),this.eventEmitter.subscribe("timer:tick",o)];e=this.eventEmitter.subscribe("instrument:loaded",i);var u=window.setInterval(function(){t.eventEmitter.broadcast("timer:tick",Date.now())},X);function c(){r=!0,window.clearInterval(u),a.forEach(function(e){return e.unsubscribe()})}return c}},{key:"createScoreMonitor",value:function(e){var t=new H(this.eventEmitter,e);this.children.push(t)}},{key:"finishInstrumentLoading",value:function(e,t){this.children.every(function(e){return e.isLoaded})&&(this.eventEmitter.broadcast("instruments:finished",e),t.unsubscribe())}},{key:"decorateWithUpstream",value:function(e,t){return e.map(function(e){var n=e.instrument;return n&&n.id===t.id&&(e.upstream=!0),e})}},{key:"value",value:function(){var e=A(this.children,this.delta(),this.maxScore());if(e&&e.instrument)return e.instrument}},{key:"maxScore",value:function(){var e=this.children.map(function(e){return e.maxScore()});return Math.max.apply(Math,v()(e))}},{key:"delta",value:function(){return Date.now()-this.startTime}}],[{key:"build",value:function(t){var n=new e;return t.forEach(function(e){return n.createScoreMonitor(e)}),n}}]),e}();J([T("score","Max Score"),$("design:type",Function),$("design:paramtypes",[]),$("design:returntype",Number)],Z.prototype,"maxScore",null)},225:function(e,t,n){var r=n(1),o=n(167),i=n(14).f,a=n(104).f,u=n(168),c=n(166),s=r.RegExp,l=s,f=s.prototype,d=/a/g,p=/a/g,h=new s(d)!==d;if(n(10)&&(!h||n(17)(function(){return p[n(5)("match")]=!1,s(d)!=d||s(p)==p||"/a/i"!=s(d,"i")}))){s=function(e,t){var n=this instanceof s,r=u(e),i=void 0===t;return!n&&r&&e.constructor===s&&i?e:o(h?new l(r&&!i?e.source:e,t):l((r=e instanceof s)?e.source:e,r&&i?c.call(e):t),n?this:f,s)};for(var v=function(e){e in s||i(s,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},y=a(l),m=0;y.length>m;)v(y[m++]);f.constructor=s,s.prototype=f,n(30)(r,"RegExp",s)}n(79)("RegExp")},229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(152),o=n(163),i=function(){function e(e,t){void 0===e&&(e=3),void 0===t&&(t=150),this.maxRetries=e,this.delayMs=t}return e.prototype.do=function(e,t,n){return r.__awaiter(this,void 0,void 0,function(){var i,a,u,c,s;return r.__generator(this,function(r){switch(r.label){case 0:i=0,r.label=1;case 1:if(!(i<this.maxRetries))return[3,7];u=void 0,r.label=2;case 2:return r.trys.push([2,4,,6]),[4,n(e,t)];case 3:return u=r.sent(),[3,6];case 4:if(c=r.sent(),a=a||new Error,a=new Error(a.message+" Retry count:"+(i+1)+" Error msg:"+c.message+"\n"),c instanceof o.MonorailUnableToProduceError&&(s=c.response.status)&&s>=400&&s<500)throw c;return[4,this.delay(this.delayMs*Math.pow(2,i))];case 5:return r.sent(),i++,[3,1];case 6:return[2,u];case 7:throw a?a.message="Retry count of "+this.maxRetries+" exceeded. Failed with error: \n"+a.message+" Aborting request for "+JSON.stringify(e):a=new Error,new o.MonorailRetriesExceededError(a)}})})},e.prototype.delay=function(e){return new Promise(function(t){return setTimeout(t,e)})},e}();t.RetryMiddleware=i},230:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.producer=e}return e.prototype.do=function(e,t,n){return this.producer.produce(e,t)},e}();t.ProducerMiddleware=r},231:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t){this.sendToConsole=t,t&&e.printWelcomeMessage(t)}return e.printWelcomeMessage=function(e){console.log("%c👋 from Monorail%c\n\nWe've noticed that you're"+(e?"":" not")+" running in debug mode. As such, we will "+(e?"produce":"not produce")+" Monorail events to the console. \n\nIf you want Monorail events to "+(e?"stop":"start")+" appearing here, %cset debugMode="+(!e).toString()+"%c, for the Monorail Log Producer in your code.","font-size: large;","font-size: normal;","font-weight: bold;","font-weight: normal;")},e.prototype.produce=function(e,t){return this.sendToConsole&&(console.log("Monorail event produced",e),console.log("Metadata produced",t)),new Promise(function(t){t(e)})},e}();t.LogProducer=r},232:function(e,t,n){var r=n(188),o=n(187);function i(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var u=0;u<16;++u)t[i+u]=a[u];return t||o(a)}e.exports=i},233:function(e,t,n){var r,o,i=n(188),a=n(187),u=0,c=0;function s(e,t,n){var s=t&&n||0,l=t||[],f=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==d){var p=i();null==f&&(f=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=o=16383&(p[6]<<8|p[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:c+1,y=h-u+(v-c)/1e4;if(y<0&&void 0===e.clockseq&&(d=d+1&16383),(y<0||h>u)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=h,c=v,o=d;var m=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[s++]=m>>>24&255,l[s++]=m>>>16&255,l[s++]=m>>>8&255,l[s++]=255&m;var b=h/4294967296*1e4&268435455;l[s++]=b>>>8&255,l[s++]=255&b,l[s++]=b>>>24&15|16,l[s++]=b>>>16&255,l[s++]=d>>>8|128,l[s++]=255&d;for(var g=0;g<6;++g)l[s+g]=f[g];return t||a(l)}e.exports=s},234:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(152),o=n(163),i=n(189),a=function(){function e(t){void 0===t&&(t=e.DEVELOPMENT_ENDPOINT),this.edgeEndpoint=t}return e.prototype.produce=function(e,t){return r.__awaiter(this,void 0,void 0,function(){var n,a,u,c,s;return r.__generator(this,function(r){switch(r.label){case 0:n=this.convertFieldsToUnderscoreCase(e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,fetch(this.edgeEndpoint,{method:"post",headers:{"Content-Type":"application/json; charset=utf-8","X-Monorail-Edge-Event-Created-At-Ms":(t&&t.edgeEventCreatedAtMs||Date.now()).toString(),"X-Monorail-Edge-Event-Sent-At-Ms":Date.now().toString(),"X-Monorail-Edge-Client-Message-Id":(t&&t.edgeClientMessageId||i.v4()).toString()},body:JSON.stringify({schema_id:e.schemaId,payload:n})})];case 2:return a=r.sent(),[3,4];case 3:throw u=r.sent(),new o.MonorailRequestError(u);case 4:return a.ok?[3,6]:(c=o.MonorailUnableToProduceError.bind,s={status:a.status},[4,a.text()]);case 5:throw new(c.apply(o.MonorailUnableToProduceError,[void 0,(s.message=r.sent(),s)]));case 6:return[2,{status:a.status}]}})})},e.prototype.convertFieldsToUnderscoreCase=function(e){for(var t={},n=0,r=Object.keys(e.payload);n<r.length;n++){var o=r[n],i=e.payload[o];t[this.convertStringToUnderscoreCase(o)]=i}return t},e.prototype.convertStringToUnderscoreCase=function(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()},e.DEVELOPMENT_ENDPOINT="http://localhost:8082/v1/produce",e.PRODUCTION_ENDPOINT="https://monorail-edge.shopifysvc.com/v1/produce",e.PRODUCTION_CANADA_ENDPOINT="https://monorail-edge-ca.shopifycloud.com/v1/produce",e}();t.HttpProducer=a},235:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(152),o=n(234),i=n(231),a=n(230),u=n(189),c=function(){function e(t,n){this.producer=t,this.middleware=n,this.executeChain=e.buildMiddlewareChain(this.middleware.concat(new a.ProducerMiddleware(t)))}return e.createLogProducer=function(t){return new e(new i.LogProducer(t.debugMode),t.middleware||[])},e.createHttpProducerWithEndpoint=function(t,n){return void 0===n&&(n=[]),new e(new o.HttpProducer(t),n)},e.createHttpProducer=function(t){return new e(t.production?new o.HttpProducer(o.HttpProducer.PRODUCTION_ENDPOINT):new o.HttpProducer(o.HttpProducer.DEVELOPMENT_ENDPOINT),t.middleware||[])},e.buildMiddlewareChain=function(e,t){var n=this;return void 0===t&&(t=0),t===e.length?this.identityFn:function(r,o){return e[t].do(r,o,n.buildMiddlewareChain(e,t+1))}},e.prototype.produce=function(e,t){return this.executeChain(e,r.__assign({edgeEventCreatedAtMs:Date.now(),edgeClientMessageId:u.v4()},t))},e}();t.Monorail=c},236:function(e,t){function n(){throw new TypeError("Invalid attempt to spread non-iterable instance")}e.exports=n},237:function(e,t){function n(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}e.exports=n},238:function(e,t,n){var r=n(8);n(174)("isFrozen",function(e){return function(t){return!r(t)||!!e&&e(t)}})},239:function(e,t,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=r},240:function(e,t,n){"use strict";var r=function(e){};function o(e,t,n,o,i,a,u,c){if(r(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,u,c],f=0;(s=new Error(t.replace(/%s/g,function(){return l[f++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}e.exports=o},241:function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},242:function(e,t,n){"use strict";var r=n(241),o=n(240),i=n(239);e.exports=function(){function e(e,t,n,r,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},36:function(e,t,n){"use strict";function r(){}n.r(t),n.d(t,"h",function(){return u}),n.d(t,"createElement",function(){return u}),n.d(t,"cloneElement",function(){return l}),n.d(t,"Component",function(){return z}),n.d(t,"render",function(){return q}),n.d(t,"rerender",function(){return h}),n.d(t,"options",function(){return o});var o={},i=[],a=[];function u(e,t){var n,u,c,s,l=a;for(s=arguments.length;s-- >2;)i.push(arguments[s]);for(t&&null!=t.children&&(i.length||i.push(t.children),delete t.children);i.length;)if((u=i.pop())&&void 0!==u.pop)for(s=u.length;s--;)i.push(u[s]);else"boolean"==typeof u&&(u=null),(c="function"!=typeof e)&&(null==u?u="":"number"==typeof u?u=String(u):"string"!=typeof u&&(c=!1)),c&&n?l[l.length-1]+=u:l===a?l=[u]:l.push(u),n=c;var f=new r;return f.nodeName=e,f.children=l,f.attributes=null==t?void 0:t,f.key=null==t?void 0:t.key,void 0!==o.vnode&&o.vnode(f),f}function c(e,t){for(var n in t)e[n]=t[n];return e}var s="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function l(e,t){return u(e.nodeName,c(c({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var f=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function p(e){!e._dirty&&(e._dirty=!0)&&1==d.push(e)&&(o.debounceRendering||s)(h)}function h(){var e,t=d;for(d=[];e=t.pop();)e._dirty&&F(e)}function v(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&y(e,t.nodeName):n||e._componentConstructor===t.nodeName}function y(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function m(e){var t=c({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function b(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===f.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,P,a):e.removeEventListener(t,P,a),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)w(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var u=o&&t!==(t=t.replace(/^xlink\:?/,""));null==r||!1===r?u?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(u?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function w(e,t,n){try{e[t]=n}catch(e){}}function P(e){return this._listeners[e.type](o.event&&o.event(e)||e)}var C=[],x=0,E=!1,O=!1;function N(){for(var e;e=C.pop();)o.afterMount&&o.afterMount(e),e.componentDidMount&&e.componentDidMount()}function M(e,t,n,r,o,i){x++||(E=null!=o&&void 0!==o.ownerSVGElement,O=null!=e&&!("__preactattr_"in e));var a=k(e,t,n,r,i);return o&&a.parentNode!==o&&o.appendChild(a),--x||(O=!1,i||N()),a}function k(e,t,n,r,o){var i=e,a=E;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),R(e,!0))),i.__preactattr_=!0,i;var u=t.nodeName;if("function"==typeof u)return V(e,t,n,r);if(E="svg"===u||"foreignObject"!==u&&E,u=String(u),(!e||!y(e,u))&&(i=b(u,E),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),R(e,!0)}var c=i.firstChild,s=i.__preactattr_,l=t.children;if(null==s){s=i.__preactattr_={};for(var f=i.attributes,d=f.length;d--;)s[f[d].name]=f[d].value}return!O&&l&&1===l.length&&"string"==typeof l[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=l[0]&&(c.nodeValue=l[0]):(l&&l.length||null!=c)&&S(i,l,n,r,O||null!=s.dangerouslySetInnerHTML),j(i,t.attributes,s),E=a,i}function S(e,t,n,r,o){var i,a,u,c,s,l=e.childNodes,f=[],d={},p=0,h=0,y=l.length,m=0,b=t?t.length:0;if(0!==y)for(var _=0;_<y;_++){var w=l[_],P=w.__preactattr_;null!=(C=b&&P?w._component?w._component.__key:P.key:null)?(p++,d[C]=w):(P||(void 0!==w.splitText?!o||w.nodeValue.trim():o))&&(f[m++]=w)}if(0!==b)for(_=0;_<b;_++){var C;if(s=null,null!=(C=(c=t[_]).key))p&&void 0!==d[C]&&(s=d[C],d[C]=void 0,p--);else if(!s&&h<m)for(i=h;i<m;i++)if(void 0!==f[i]&&v(a=f[i],c,o)){s=a,f[i]=void 0,i===m-1&&m--,i===h&&h++;break}s=k(s,c,n,r),u=l[_],s&&s!==e&&s!==u&&(null==u?e.appendChild(s):s===u.nextSibling?g(u):e.insertBefore(s,u))}if(p)for(var _ in d)void 0!==d[_]&&R(d[_],!1);for(;h<=m;)void 0!==(s=f[m--])&&R(s,!1)}function R(e,t){var n=e._component;n?W(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||g(e),T(e))}function T(e){for(e=e.lastChild;e;){var t=e.previousSibling;R(e,!0),e=t}}function j(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||_(e,r,n[r],n[r]=void 0,E);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||_(e,r,n[r],n[r]=t[r],E)}var D={};function A(e){var t=e.constructor.name;(D[t]||(D[t]=[])).push(e)}function I(e,t,n){var r,o=D[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),z.call(r,t,n)):((r=new z(t,n)).constructor=e,r.render=U),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.nextBase=o[i].nextBase,o.splice(i,1);break}return r}function U(e,t,n){return this.constructor(e,n)}function L(e,t,n,r,i){e._disable||(e._disable=!0,(e.__ref=t.ref)&&delete t.ref,(e.__key=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===o.syncComponentUpdates&&e.base?p(e):F(e,1,i)),e.__ref&&e.__ref(e))}function F(e,t,n,r){if(!e._disable){var i,a,u,s=e.props,l=e.state,f=e.context,d=e.prevProps||s,p=e.prevState||l,h=e.prevContext||f,v=e.base,y=e.nextBase,b=v||y,g=e._component,_=!1;if(v&&(e.props=d,e.state=p,e.context=h,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(s,l,f)?_=!0:e.componentWillUpdate&&e.componentWillUpdate(s,l,f),e.props=s,e.state=l,e.context=f),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!_){i=e.render(s,l,f),e.getChildContext&&(f=c(c({},f),e.getChildContext()));var w,P,E=i&&i.nodeName;if("function"==typeof E){var O=m(i);(a=g)&&a.constructor===E&&O.key==a.__key?L(a,O,1,f,!1):(w=a,e._component=a=I(E,O,f),a.nextBase=a.nextBase||y,a._parentComponent=e,L(a,O,0,f,!1),F(a,1,n,!0)),P=a.base}else u=b,(w=g)&&(u=e._component=null),(b||1===t)&&(u&&(u._component=null),P=M(u,i,f,n||!v,b&&b.parentNode,!0));if(b&&P!==b&&a!==g){var k=b.parentNode;k&&P!==k&&(k.replaceChild(P,b),w||(b._component=null,R(b,!1)))}if(w&&W(w),e.base=P,P&&!r){for(var S=e,T=e;T=T._parentComponent;)(S=T).base=P;P._component=S,P._componentConstructor=S.constructor}}if(!v||n?C.unshift(e):_||(e.componentDidUpdate&&e.componentDidUpdate(d,p,h),o.afterUpdate&&o.afterUpdate(e)),null!=e._renderCallbacks)for(;e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);x||r||N()}}function V(e,t,n,r){for(var o=e&&e._component,i=o,a=e,u=o&&e._componentConstructor===t.nodeName,c=u,s=m(t);o&&!c&&(o=o._parentComponent);)c=o.constructor===t.nodeName;return o&&c&&(!r||o._component)?(L(o,s,3,n,r),e=o.base):(i&&!u&&(W(i),e=a=null),o=I(t.nodeName,s,n),e&&!o.nextBase&&(o.nextBase=e,a=null),L(o,s,1,n,r),e=o.base,a&&e!==a&&(a._component=null,R(a,!1))),e}function W(e){o.beforeUnmount&&o.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?W(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.nextBase=t,g(t),A(e),T(t)),e.__ref&&e.__ref(null)}function z(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{}}function q(e,t,n){return M(n,e,{},!1,t,!1)}c(z.prototype,{setState:function(e,t){var n=this.state;this.prevState||(this.prevState=c({},n)),c(n,"function"==typeof e?e(n,this.props):e),t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),p(this)},forceUpdate:function(e){e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),F(this,2)},render:function(){}});var G={h:u,createElement:u,cloneElement:l,Component:z,render:q,rerender:h,options:o};t.default=G}}]);