From 9577a2e9108f48dc19beca28264c0af227567aac Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Fri, 1 Sep 2017 20:14:25 -0400 Subject: Update jetpack 5.2.1 Signed-off-by: Anthony G. Basile --- plugins/jetpack/3rd-party/3rd-party.php | 1 + plugins/jetpack/3rd-party/domain-mapping.php | 113 +++ plugins/jetpack/_inc/build/admin.js | 77 +- plugins/jetpack/_inc/build/style.min.css | 2 +- plugins/jetpack/_inc/build/style.min.rtl.css | 2 +- plugins/jetpack/_inc/jetpack-jitm.js | 3 +- plugins/jetpack/_inc/jetpack-strings.php | 247 +++--- plugins/jetpack/_inc/jquery.inview.js | 143 ---- .../_inc/lib/class.core-rest-api-endpoints.php | 9 + .../class.jetpack-core-api-module-endpoints.php | 7 +- .../class.jetpack-core-api-site-endpoints.php | 60 ++ plugins/jetpack/bin/partner-cancel.sh | 10 +- plugins/jetpack/bin/partner-provision.sh | 46 +- plugins/jetpack/changelog.txt | 77 +- plugins/jetpack/class.jetpack-cli.php | 124 ++- plugins/jetpack/class.jetpack-client-server.php | 7 +- plugins/jetpack/class.jetpack-client.php | 9 +- plugins/jetpack/class.jetpack-debugger.php | 11 + plugins/jetpack/class.jetpack-jitm.php | 10 +- plugins/jetpack/class.jetpack-network.php | 4 +- plugins/jetpack/class.jetpack-xmlrpc-server.php | 5 +- plugins/jetpack/class.jetpack.php | 91 ++- plugins/jetpack/class.json-api-endpoints.php | 47 +- plugins/jetpack/class.json-api.php | 6 +- plugins/jetpack/class.photon.php | 8 +- plugins/jetpack/css/jetpack-rtl.css | 10 +- plugins/jetpack/css/jetpack.css | 10 +- plugins/jetpack/functions.global.php | 60 ++ plugins/jetpack/images/aurora-lrg.jpg | Bin 229018 -> 0 bytes plugins/jetpack/images/aurora-med.jpg | Bin 159592 -> 0 bytes plugins/jetpack/images/aurora-sm.jpg | Bin 108268 -> 0 bytes plugins/jetpack/images/cf-ss.png | Bin 0 -> 27513 bytes plugins/jetpack/images/jupiter.svg | 1 + plugins/jetpack/images/man-and-laptop.svg | 1 + plugins/jetpack/images/people-around-page.svg | 288 +++++++ plugins/jetpack/images/stars-full.svg | 1 + plugins/jetpack/jetpack.php | 33 +- plugins/jetpack/json-endpoints.php | 1 + .../class.wpcom-json-api-get-site-endpoint.php | 9 +- .../class.wpcom-json-api-post-v1-1-endpoint.php | 6 +- ...class.wpcom-json-api-site-settings-endpoint.php | 6 +- ...s.wpcom-json-api-upload-media-v1-1-endpoint.php | 34 +- plugins/jetpack/languages/jetpack-pl_PL.mo | Bin 122377 -> 140106 bytes plugins/jetpack/languages/json/jetpack-af.json | 2 +- plugins/jetpack/languages/json/jetpack-ar.json | 2 +- plugins/jetpack/languages/json/jetpack-ary.json | 2 +- plugins/jetpack/languages/json/jetpack-az.json | 2 +- plugins/jetpack/languages/json/jetpack-bg_BG.json | 2 +- plugins/jetpack/languages/json/jetpack-bs_BA.json | 2 +- plugins/jetpack/languages/json/jetpack-ca.json | 2 +- plugins/jetpack/languages/json/jetpack-ckb.json | 2 +- plugins/jetpack/languages/json/jetpack-cs_CZ.json | 2 +- plugins/jetpack/languages/json/jetpack-cy.json | 2 +- plugins/jetpack/languages/json/jetpack-da_DK.json | 2 +- plugins/jetpack/languages/json/jetpack-de_DE.json | 2 +- .../languages/json/jetpack-de_DE_formal.json | 2 +- plugins/jetpack/languages/json/jetpack-el.json | 2 +- plugins/jetpack/languages/json/jetpack-en_AU.json | 2 +- plugins/jetpack/languages/json/jetpack-en_CA.json | 2 +- plugins/jetpack/languages/json/jetpack-en_GB.json | 2 +- plugins/jetpack/languages/json/jetpack-en_NZ.json | 2 +- plugins/jetpack/languages/json/jetpack-eo.json | 2 +- plugins/jetpack/languages/json/jetpack-es_AR.json | 2 +- plugins/jetpack/languages/json/jetpack-es_CL.json | 2 +- plugins/jetpack/languages/json/jetpack-es_ES.json | 2 +- plugins/jetpack/languages/json/jetpack-es_VE.json | 2 +- plugins/jetpack/languages/json/jetpack-fa_IR.json | 2 +- plugins/jetpack/languages/json/jetpack-fi.json | 2 +- plugins/jetpack/languages/json/jetpack-fr_BE.json | 2 +- plugins/jetpack/languages/json/jetpack-fr_FR.json | 2 +- plugins/jetpack/languages/json/jetpack-gd.json | 2 +- plugins/jetpack/languages/json/jetpack-gl_ES.json | 2 +- plugins/jetpack/languages/json/jetpack-he_IL.json | 2 +- plugins/jetpack/languages/json/jetpack-hr.json | 2 +- plugins/jetpack/languages/json/jetpack-hu_HU.json | 2 +- plugins/jetpack/languages/json/jetpack-id_ID.json | 2 +- plugins/jetpack/languages/json/jetpack-is_IS.json | 2 +- plugins/jetpack/languages/json/jetpack-it_IT.json | 2 +- plugins/jetpack/languages/json/jetpack-ja.json | 2 +- plugins/jetpack/languages/json/jetpack-ka_GE.json | 2 +- plugins/jetpack/languages/json/jetpack-ko_KR.json | 2 +- plugins/jetpack/languages/json/jetpack-lt_LT.json | 2 +- plugins/jetpack/languages/json/jetpack-lv.json | 2 +- plugins/jetpack/languages/json/jetpack-mk_MK.json | 2 +- plugins/jetpack/languages/json/jetpack-ms_MY.json | 2 +- plugins/jetpack/languages/json/jetpack-nb_NO.json | 2 +- plugins/jetpack/languages/json/jetpack-nl_NL.json | 2 +- .../languages/json/jetpack-nl_NL_formal.json | 2 +- plugins/jetpack/languages/json/jetpack-nn_NO.json | 2 +- plugins/jetpack/languages/json/jetpack-pl_PL.json | 2 +- plugins/jetpack/languages/json/jetpack-pt_BR.json | 2 +- plugins/jetpack/languages/json/jetpack-pt_PT.json | 2 +- plugins/jetpack/languages/json/jetpack-ro_RO.json | 2 +- plugins/jetpack/languages/json/jetpack-ru_RU.json | 2 +- plugins/jetpack/languages/json/jetpack-si_LK.json | 2 +- plugins/jetpack/languages/json/jetpack-sk_SK.json | 2 +- plugins/jetpack/languages/json/jetpack-sq.json | 2 +- plugins/jetpack/languages/json/jetpack-sr_RS.json | 2 +- plugins/jetpack/languages/json/jetpack-sv_SE.json | 2 +- plugins/jetpack/languages/json/jetpack-te.json | 2 +- plugins/jetpack/languages/json/jetpack-th.json | 2 +- plugins/jetpack/languages/json/jetpack-tr_TR.json | 2 +- plugins/jetpack/languages/json/jetpack-uk.json | 2 +- plugins/jetpack/languages/json/jetpack-ur.json | 2 +- plugins/jetpack/languages/json/jetpack-vi.json | 2 +- plugins/jetpack/languages/json/jetpack-zh_CN.json | 2 +- plugins/jetpack/languages/json/jetpack-zh_HK.json | 2 +- plugins/jetpack/languages/json/jetpack-zh_TW.json | 2 +- plugins/jetpack/modules/comment-likes.php | 186 +++++ .../jetpack/modules/comment-likes/admin-style.css | 45 ++ .../modules/comment-likes/comment-like-count.js | 38 + plugins/jetpack/modules/contact-form.php | 14 + .../css/editor-inline-editing-style-rtl.css | 824 +++++++++++++++++++ .../css/editor-inline-editing-style-rtl.min.css | 1 + .../css/editor-inline-editing-style.css | 755 ++++++++++++++++++ .../css/editor-inline-editing-style.min.css | 2 + .../modules/contact-form/css/editor-style-rtl.css | 601 ++++++++++++++ .../contact-form/css/editor-style-rtl.min.css | 1 + .../modules/contact-form/css/editor-style.css | 545 +++++++++++++ .../modules/contact-form/css/editor-style.min.css | 2 + .../modules/contact-form/css/editor-ui-rtl.css | 19 + .../modules/contact-form/css/editor-ui-rtl.min.css | 1 + .../jetpack/modules/contact-form/css/editor-ui.css | 18 + .../modules/contact-form/css/editor-ui.min.css | 2 + .../modules/contact-form/grunion-contact-form.php | 64 +- .../modules/contact-form/grunion-editor-view.php | 278 +++++++ .../jetpack/modules/contact-form/js/editor-view.js | 233 ++++++ .../contact-form/js/tinymce-plugin-form-button.js | 34 + plugins/jetpack/modules/likes.php | 876 ++------------------- .../modules/likes/jetpack-likes-master-iframe.php | 38 + .../modules/likes/jetpack-likes-settings.php | 641 +++++++++++++++ plugins/jetpack/modules/likes/queuehandler.js | 370 +++++---- plugins/jetpack/modules/likes/style.css | 51 +- plugins/jetpack/modules/masterbar/masterbar.php | 155 ++-- plugins/jetpack/modules/masterbar/overrides.css | 5 - plugins/jetpack/modules/minileven.php | 2 +- plugins/jetpack/modules/module-extras.php | 1 + plugins/jetpack/modules/module-headings.php | 8 +- plugins/jetpack/modules/protect.php | 2 +- plugins/jetpack/modules/protect/math-fallback.php | 4 +- .../modules/sharedaddy/admin-sharing-rtl.min.css | 2 +- .../modules/sharedaddy/admin-sharing.min.css | 2 +- plugins/jetpack/modules/sharedaddy/sharedaddy.php | 2 +- .../jetpack/modules/sharedaddy/sharing-service.php | 21 +- plugins/jetpack/modules/shortcodes.php | 2 + .../class.filter-embedded-html-objects.php | 6 +- .../simple-payments/paypal-express-checkout.js | 211 +++++ .../modules/simple-payments/simple-payments.css | 109 +++ .../modules/simple-payments/simple-payments.php | 278 +++++++ plugins/jetpack/modules/sitemaps/sitemaps.php | 6 +- .../modules/theme-tools/content-options.php | 84 +- .../theme-tools/content-options/customizer.js | 25 + .../theme-tools/content-options/customizer.php | 118 ++- .../content-options/featured-images-fallback.php | 161 ++++ .../content-options/featured-images.php | 12 +- .../theme-tools/content-options/post-details.php | 31 +- .../videopress/class.jetpack-videopress.php | 18 - plugins/jetpack/modules/widgets/eu-cookie-law.php | 24 +- .../modules/widgets/eu-cookie-law/eu-cookie-law.js | 11 +- .../modules/widgets/eu-cookie-law/style.css | 1 + .../modules/widgets/eu-cookie-law/widget.php | 3 - plugins/jetpack/modules/widgets/flickr.php | 5 +- plugins/jetpack/modules/widgets/flickr/form.php | 2 +- plugins/jetpack/modules/widgets/flickr/style.css | 22 +- plugins/jetpack/modules/widgets/flickr/widget.php | 34 +- .../widgets/migrate-to-core/image-widget.php | 125 ++- plugins/jetpack/readme.txt | 128 +-- plugins/jetpack/sal/class.json-api-site-base.php | 4 + .../sal/class.json-api-site-jetpack-base.php | 2 + .../jetpack/sal/class.json-api-site-jetpack.php | 8 + .../jetpack/sync/class.jetpack-sync-actions.php | 5 +- .../jetpack/sync/class.jetpack-sync-defaults.php | 2 + .../jetpack/sync/class.jetpack-sync-functions.php | 68 +- .../jetpack/sync/class.jetpack-sync-listener.php | 38 +- .../sync/class.jetpack-sync-module-callables.php | 4 +- .../sync/class.jetpack-sync-module-posts.php | 53 +- .../sync/class.jetpack-sync-module-terms.php | 1 + .../sync/class.jetpack-sync-module-themes.php | 82 +- .../sync/class.jetpack-sync-module-updates.php | 3 + .../sync/class.jetpack-sync-module-woocommerce.php | 20 +- plugins/jetpack/sync/class.jetpack-sync-users.php | 2 +- plugins/jetpack/webpack.config.js | 10 +- 182 files changed, 7344 insertions(+), 1926 deletions(-) create mode 100644 plugins/jetpack/3rd-party/domain-mapping.php delete mode 100644 plugins/jetpack/_inc/jquery.inview.js create mode 100644 plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-site-endpoints.php delete mode 100644 plugins/jetpack/images/aurora-lrg.jpg delete mode 100644 plugins/jetpack/images/aurora-med.jpg delete mode 100644 plugins/jetpack/images/aurora-sm.jpg create mode 100644 plugins/jetpack/images/cf-ss.png create mode 100644 plugins/jetpack/images/jupiter.svg create mode 100644 plugins/jetpack/images/man-and-laptop.svg create mode 100644 plugins/jetpack/images/people-around-page.svg create mode 100644 plugins/jetpack/images/stars-full.svg create mode 100644 plugins/jetpack/modules/comment-likes.php create mode 100644 plugins/jetpack/modules/comment-likes/admin-style.css create mode 100644 plugins/jetpack/modules/comment-likes/comment-like-count.js create mode 100644 plugins/jetpack/modules/contact-form/css/editor-inline-editing-style-rtl.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-inline-editing-style-rtl.min.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-inline-editing-style.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-inline-editing-style.min.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-style-rtl.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-style-rtl.min.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-style.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-style.min.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-ui-rtl.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-ui-rtl.min.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-ui.css create mode 100644 plugins/jetpack/modules/contact-form/css/editor-ui.min.css create mode 100644 plugins/jetpack/modules/contact-form/grunion-editor-view.php create mode 100644 plugins/jetpack/modules/contact-form/js/editor-view.js create mode 100644 plugins/jetpack/modules/contact-form/js/tinymce-plugin-form-button.js create mode 100644 plugins/jetpack/modules/likes/jetpack-likes-master-iframe.php create mode 100644 plugins/jetpack/modules/likes/jetpack-likes-settings.php create mode 100644 plugins/jetpack/modules/simple-payments/paypal-express-checkout.js create mode 100644 plugins/jetpack/modules/simple-payments/simple-payments.css create mode 100644 plugins/jetpack/modules/simple-payments/simple-payments.php create mode 100644 plugins/jetpack/modules/theme-tools/content-options/featured-images-fallback.php (limited to 'plugins/jetpack') diff --git a/plugins/jetpack/3rd-party/3rd-party.php b/plugins/jetpack/3rd-party/3rd-party.php index 9d546274..cdf08f27 100644 --- a/plugins/jetpack/3rd-party/3rd-party.php +++ b/plugins/jetpack/3rd-party/3rd-party.php @@ -10,6 +10,7 @@ require_once( JETPACK__PLUGIN_DIR . '3rd-party/wpml.php' ); require_once( JETPACK__PLUGIN_DIR . '3rd-party/bitly.php' ); require_once( JETPACK__PLUGIN_DIR . '3rd-party/bbpress.php' ); require_once( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce.php' ); +require_once( JETPACK__PLUGIN_DIR . '3rd-party/domain-mapping.php' ); // We can't load this conditionally since polldaddy add the call in class constuctor. require_once( JETPACK__PLUGIN_DIR . '3rd-party/polldaddy.php' ); diff --git a/plugins/jetpack/3rd-party/domain-mapping.php b/plugins/jetpack/3rd-party/domain-mapping.php new file mode 100644 index 00000000..6079ac32 --- /dev/null +++ b/plugins/jetpack/3rd-party/domain-mapping.php @@ -0,0 +1,113 @@ +function_exists( 'domain_mapping_siteurl' ) ) { + return false; + } + + add_filter( 'jetpack_sync_home_url', 'domain_mapping_siteurl' ); + add_filter( 'jetpack_sync_site_url', 'domain_mapping_siteurl' ); + + return true; + } + + /** + * This method will test for a class and method known to be used in WPMU Dev's domain mapping plugin. If the + * method exists, then we'll hook the swap_to_mapped_url() to our Jetpack sync filters for home_url and site_url. + * + * @return bool + */ + function hook_wpmu_dev_domain_mapping() { + if ( ! $this->class_exists( 'domain_map' ) || ! $this->method_exists( 'domain_map', 'utils' ) ) { + return false; + } + + $utils = $this->get_domain_mapping_utils_instance(); + add_filter( 'jetpack_sync_home_url', array( $utils, 'swap_to_mapped_url' ) ); + add_filter( 'jetpack_sync_site_url', array( $utils, 'swap_to_mapped_url' ) ); + + return true; + } + + /* + * Utility Methods + * + * These methods are very minimal, and in most cases, simply pass on arguments. Why create them you ask? + * So that we can test. + */ + + public function method_exists( $class, $method ) { + return method_exists( $class, $method ); + } + + public function class_exists( $class ) { + return class_exists( $class ); + } + + public function function_exists( $function ) { + return function_exists( $function ); + } + + public function get_domain_mapping_utils_instance() { + return domain_map::utils(); + } +} + +Jetpack_3rd_Party_Domain_Mapping::init(); diff --git a/plugins/jetpack/_inc/build/admin.js b/plugins/jetpack/_inc/build/admin.js index f4e07ed2..0ed22d10 100644 --- a/plugins/jetpack/_inc/build/admin.js +++ b/plugins/jetpack/_inc/build/admin.js @@ -1,40 +1,41 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(1),o=r(a),i=n(142),s=r(i),c=n(154),u=n(188),l=n(249),d=n(254),p=n(275),f=r(p),h=n(276),m=r(h),_=n(498),M=r(_),g=n(755),v=r(g);(0,f.default)();var b=window.Initial_State;b.locale=JSON.parse(b.locale),void 0!==b.locale[""]?(b.locale[""].localeSlug=b.localeSlug,Number.prototype.realToLocaleString=Number.prototype.toLocaleString,Number.prototype.toLocaleString=function(e,t){return e=e||b.localeSlug,t=t||{},this.realToLocaleString(e,t)}):b.locale={"":{localeSlug:b.localeSlug}},M.default.setLocale(b.locale);var y=(0,u.useRouterHistory)(d.createHashHistory)({queryKey:!1}),A=(0,l.syncHistoryWithStore)(y,m.default);!function(){var e=document.getElementById("jp-plugin-container");null!==e&&o.default.render(s.default.createElement("div",null,s.default.createElement(c.Provider,{store:m.default},s.default.createElement(u.Router,{history:A},s.default.createElement(u.Route,{path:"/",name:M.default.translate("At A Glance",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/jumpstart",component:v.default}),s.default.createElement(u.Route,{path:"/dashboard",name:M.default.translate("At A Glance"),component:v.default}),s.default.createElement(u.Route,{path:"/plans",name:M.default.translate("Plans",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/settings",name:M.default.translate("Settings",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/discussion",name:M.default.translate("Discussion",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/security",name:M.default.translate("Security",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/traffic",name:M.default.translate("Traffic",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/writing",name:M.default.translate("Writing",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/sharing",name:M.default.translate("Sharing",{context:"Navigation item."}),component:v.default}),s.default.createElement(u.Route,{path:"/wpbody-content",component:v.default}),s.default.createElement(u.Route,{path:"/wp-toolbar",component:v.default}),s.default.createElement(u.Route,{path:"*",component:v.default})))),e)}()},function(e,t,n){"use strict";e.exports=n(2)},function(e,t,n){"use strict";var r=n(3),a=n(4),o=n(69),i=n(43),s=n(26),c=n(16),u=n(48),l=n(52),d=n(140),p=n(89),f=n(141);n(23);o.inject();var h=c.measure("React","render",s.render),m={findDOMNode:p,render:h,unmountComponentAtNode:s.unmountComponentAtNode,version:d,unstable_batchedUpdates:l.batchedUpdates,unstable_renderSubtreeIntoContainer:f};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:r,InstanceHandles:i,Mount:s,Reconciler:u,TextComponent:a});e.exports=m},function(e,t){"use strict";var n={current:null};e.exports=n},function(e,t,n){"use strict";var r=n(5),a=n(20),o=n(24),i=n(26),s=n(37),c=n(19),u=n(18),l=(n(68),function(e){});s(l.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t,n){if(this._rootNodeID=e,t.useCreateElement){var r=n[i.ownerDocumentContextKey],o=r.createElement("span");return a.setAttributeForID(o,e),i.getID(o),u(o,this._stringText),o}var s=c(this._stringText);return t.renderToStaticMarkup?s:""+s+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var a=i.getNode(this._rootNodeID);r.updateTextContent(a,n)}}},unmountComponent:function(){o.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=l},function(e,t,n){"use strict";function r(e,t,n){var r=n>=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var a=n(6),o=n(14),i=n(16),s=n(17),c=n(18),u=n(11),l={dangerouslyReplaceNodeWithMarkup:a.dangerouslyReplaceNodeWithMarkup,updateTextContent:c,processUpdates:function(e,t){for(var n,i=null,l=null,d=0;d]+)/,'$1 data-danger-index="'+p+'" ')}for(var m=o(f.join(""),i),_=0;_":"<"+e+">",s[e]=!i.firstChild),s[e]?p[e]:null}var a=n(7),o=n(11),i=a.canUseDOM?document.createElement("div"):null,s={},c=[1,'"],u=[1,"","
"],l=[3,"","
"],d=[1,'',""],p={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:c,option:c,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:l,th:l};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){p[e]=d,s[e]=!0}),e.exports=r},function(e,t){"use strict";function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=n(15),a=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});e.exports=a},function(e,t,n){"use strict";var r=n(11),a=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)||r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=a},function(e,t,n){"use strict";function r(e,t,n){return n}var a={enableMeasure:!1,storedMeasure:r,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){a.storedMeasure=e}}};e.exports=a},function(e,t,n){"use strict";var r=n(7),a=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,i=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(i=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(i=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=i},function(e,t,n){"use strict";var r=n(7),a=n(19),o=n(17),i=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){o(e,a(t))})),e.exports=i},function(e,t){"use strict";function n(e){return a[e]}function r(e){return(""+e).replace(o,n)}var a={"&":"&",">":">","<":"<",'"':""","'":"'"},o=/[&><"']/g;e.exports=r},function(e,t,n){"use strict";function r(e){return!!l.hasOwnProperty(e)||!u.hasOwnProperty(e)&&(c.test(e)?(l[e]=!0,!0):(u[e]=!0,!1))}function a(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var o=n(21),i=n(16),s=n(22),c=(n(23),/^[a-zA-Z_][\w\.\-]*$/),u={},l={},d={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(o.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=o.properties.hasOwnProperty(e)?o.properties[e]:null;if(n){if(a(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?r+'=""':r+"="+s(t)}return o.isCustomAttribute(e)?null==t?"":e+"="+s(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,t,n){var r=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(r){var i=r.mutationMethod;if(i)i(e,n);else if(a(r,n))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute){var s=r.attributeName,c=r.attributeNamespace;c?e.setAttributeNS(c,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(s,""):e.setAttribute(s,""+n)}else{var u=r.propertyName;r.hasSideEffects&&""+e[u]==""+n||(e[u]=n)}}else o.isCustomAttribute(t)&&d.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var a=n.propertyName,i=o.getDefaultValueForProperty(e.nodeName,a);n.hasSideEffects&&""+e[a]===i||(e[a]=i)}}else o.isCustomAttribute(t)&&e.removeAttribute(t)}};i.measureMethods(d,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),e.exports=d},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var a=n(11),o={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=o,n=e.Properties||{},i=e.DOMAttributeNamespaces||{},c=e.DOMAttributeNames||{},u=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var d in n){s.properties.hasOwnProperty(d)&&a(!1);var p=d.toLowerCase(),f=n[d],h={attributeName:p,attributeNamespace:null,propertyName:d,mutationMethod:null,mustUseAttribute:r(f,t.MUST_USE_ATTRIBUTE),mustUseProperty:r(f,t.MUST_USE_PROPERTY),hasSideEffects:r(f,t.HAS_SIDE_EFFECTS),hasBooleanValue:r(f,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(f,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(f,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(f,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.mustUseAttribute&&h.mustUseProperty&&a(!1),!h.mustUseProperty&&h.hasSideEffects&&a(!1),h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1||a(!1),c.hasOwnProperty(d)){var m=c[d];h.attributeName=m}i.hasOwnProperty(d)&&(h.attributeNamespace=i[d]),u.hasOwnProperty(d)&&(h.propertyName=u[d]),l.hasOwnProperty(d)&&(h.mutationMethod=l[d]),s.properties[d]=h}}},i={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t-1||i(!1),!u.plugins[n]){t.extractEvents||i(!1),u.plugins[n]=t;var r=t.eventTypes;for(var o in r)a(r[o],t,o)||i(!1)}}}function a(e,t,n){u.eventNameDispatchConfigs.hasOwnProperty(n)&&i(!1),u.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];o(s,t,n)}return!0}return!!e.registrationName&&(o(e.registrationName,t,n),!0)}function o(e,t,n){u.registrationNameModules[e]&&i(!1),u.registrationNameModules[e]=t,u.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var i=n(11),s=null,c={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s&&i(!1),s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];c.hasOwnProperty(n)&&c[n]===a||(c[n]&&i(!1),c[n]=a,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return u.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in c)c.hasOwnProperty(e)&&delete c[e];u.plugins.length=0;var t=u.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=u.registrationNameModules;for(var a in r)r.hasOwnProperty(a)&&delete r[a]}};e.exports=u},function(e,t,n){"use strict";function r(e){return e===_.topMouseUp||e===_.topTouchEnd||e===_.topTouchCancel}function a(e){return e===_.topMouseMove||e===_.topTouchMove}function o(e){return e===_.topMouseDown||e===_.topTouchStart}function i(e,t,n,r){var a=e.type||"unknown-event";e.currentTarget=m.Mount.getNode(r),t?f.invokeGuardedCallbackWithCatch(a,n,e,r):f.invokeGuardedCallback(a,n,e,r),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var a=0;a1){for(var d=Array(l),p=0;p1){for(var f=Array(p),h=0;h1){var t=e.indexOf(f,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,a){var o=u(e,t);o!==e&&l(e,o,n,r,!1,!0),o!==t&&l(o,t,n,a,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,n){e&&(l("",e,t,n,!0,!0),l(e,"",t,n,!0,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},getFirstCommonAncestorID:u,_getNextDescendantID:c,isAncestorIDOf:i,SEPARATOR:f};e.exports=_},function(e,t){"use strict";var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};e.exports=r},function(e,t){"use strict";var n={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=n},function(e,t,n){"use strict";var r=n(47),a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(/\/?>/," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t){"use strict";function n(e){for(var t=1,n=0,a=0,o=e.length,i=-4&o;a8&&A<=11),L=32,w=String.fromCharCode(L),k=p.topLevelTypes,S={beforeInput:{phasedRegistrationNames:{bubbled:g({onBeforeInput:null}),captured:g({onBeforeInputCapture:null})},dependencies:[k.topCompositionEnd,k.topKeyPress,k.topTextInput,k.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:g({onCompositionEnd:null}),captured:g({onCompositionEndCapture:null})},dependencies:[k.topBlur,k.topCompositionEnd,k.topKeyDown,k.topKeyPress,k.topKeyUp,k.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:g({onCompositionStart:null}),captured:g({onCompositionStartCapture:null})},dependencies:[k.topBlur,k.topCompositionStart,k.topKeyDown,k.topKeyPress,k.topKeyUp,k.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:g({onCompositionUpdate:null}),captured:g({onCompositionUpdateCapture:null})},dependencies:[k.topBlur,k.topCompositionUpdate,k.topKeyDown,k.topKeyPress,k.topKeyUp,k.topMouseDown]}},O=!1,C=null,z={eventTypes:S,extractEvents:function(e,t,n,r,a){return[c(e,t,n,r,a),d(e,t,n,r,a)]}};e.exports=z},function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return g(e,r)}function a(e,t,n){var a=t?M.bubbled:M.captured,o=r(e,n,a);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchIDs=m(n._dispatchIDs,e))}function o(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,a,e)}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(e.dispatchMarker,a,e)}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,a=g(e,r);a&&(n._dispatchListeners=m(n._dispatchListeners,a),n._dispatchIDs=m(n._dispatchIDs,e))}}function c(e){e&&e.dispatchConfig.registrationName&&s(e.dispatchMarker,null,e)}function u(e){_(e,o)}function l(e){_(e,i)}function d(e,t,n,r){h.injection.getInstanceHandle().traverseEnterLeave(n,r,s,e,t)}function p(e){_(e,c)}var f=n(28),h=n(29),m=(n(23),n(33)),_=n(34),M=f.PropagationPhases,g=h.getListener,v={accumulateTwoPhaseDispatches:u,accumulateTwoPhaseDispatchesSkipTarget:l,accumulateDirectDispatches:p,accumulateEnterLeaveDispatches:d};e.exports=v},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var a=n(54),o=n(37),i=n(73);o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,a=this.getText(),o=a.length;for(e=0;e1?1-t:void 0;return this._fallbackText=a.slice(e,s),this._fallbackText}}),a.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(){return!o&&a.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var a=n(7),o=null;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(75),o={data:null};a.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var a=this.constructor.Interface;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var c=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;this.isDefaultPrevented=c?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse}var a=n(54),o=n(37),i=n(13),s=(n(23),{type:null,target:null,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null});o(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=i.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=i.thatReturnsTrue)},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=s,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);o(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=o({},n.Interface,t),e.augmentClass=n.augmentClass,a.addPoolingTo(e,a.fourArgumentPooler)},a.addPoolingTo(r,a.fourArgumentPooler),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(75),o={data:null};a.augmentClass(r,o),e.exports=r},function(e,t){"use strict";var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function a(e){var t=E.getPooled(O.change,z,e,T(e));b.accumulateTwoPhaseDispatches(t),A.batchedUpdates(o,t)}function o(e){v.enqueueEvents(e),v.processEventQueue(!1)}function i(e,t){C=e,z=t,C.attachEvent("onchange",a)}function s(){C&&(C.detachEvent("onchange",a),C=null,z=null)}function c(e,t,n){if(e===S.topChange)return n}function u(e,t,n){e===S.topFocus?(s(),i(t,n)):e===S.topBlur&&s()}function l(e,t){C=e,z=t,N=e.value,D=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(C,"value",j),C.attachEvent("onpropertychange",p)}function d(){C&&(delete C.value,C.detachEvent("onpropertychange",p),C=null,z=null,N=null,D=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==N&&(N=t,a(e))}}function f(e,t,n){if(e===S.topInput)return n}function h(e,t,n){e===S.topFocus?(d(),l(t,n)):e===S.topBlur&&d()}function m(e,t,n){if((e===S.topSelectionChange||e===S.topKeyUp||e===S.topKeyDown)&&C&&C.value!==N)return N=C.value,z}function _(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function M(e,t,n){if(e===S.topClick)return n}var g=n(28),v=n(29),b=n(71),y=n(7),A=n(52),E=n(75),T=n(79),L=n(38),w=n(80),k=n(77),S=g.topLevelTypes,O={change:{phasedRegistrationNames:{bubbled:k({onChange:null}),captured:k({onChangeCapture:null})},dependencies:[S.topBlur,S.topChange,S.topClick,S.topFocus,S.topInput,S.topKeyDown,S.topKeyUp,S.topSelectionChange]}},C=null,z=null,N=null,D=null,P=!1;y.canUseDOM&&(P=L("change")&&(!("documentMode"in document)||document.documentMode>8));var x=!1;y.canUseDOM&&(x=L("input")&&(!("documentMode"in document)||document.documentMode>9));var j={get:function(){return D.get.call(this)},set:function(e){N=""+e,D.set.call(this,e)}},R={eventTypes:O,extractEvents:function(e,t,n,a,o){var i,s;if(r(t)?P?i=c:s=u:w(t)?x?i=f:(i=m,s=h):_(t)&&(i=M),i){var l=i(e,t,n);if(l){var d=E.getPooled(O.change,l,a,o);return d.type="change",b.accumulateTwoPhaseDispatches(d),d}}s&&s(e,t,n)}} -;e.exports=R},function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=n},function(e,t){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&r[e.type]||"textarea"===t)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};e.exports=r},function(e,t,n){"use strict";var r=n(77),a=[r({ResponderEventPlugin:null}),r({SimpleEventPlugin:null}),r({TapEventPlugin:null}),r({EnterLeaveEventPlugin:null}),r({ChangeEventPlugin:null}),r({SelectEventPlugin:null}),r({BeforeInputEventPlugin:null})];e.exports=a},function(e,t,n){"use strict";var r=n(28),a=n(71),o=n(84),i=n(26),s=n(77),c=r.topLevelTypes,u=i.getFirstReactDOM,l={mouseEnter:{registrationName:s({onMouseEnter:null}),dependencies:[c.topMouseOut,c.topMouseOver]},mouseLeave:{registrationName:s({onMouseLeave:null}),dependencies:[c.topMouseOut,c.topMouseOver]}},d=[null,null],p={eventTypes:l,extractEvents:function(e,t,n,r,s){if(e===c.topMouseOver&&(r.relatedTarget||r.fromElement))return null;if(e!==c.topMouseOut&&e!==c.topMouseOver)return null;var p;if(t.window===t)p=t;else{var f=t.ownerDocument;p=f?f.defaultView||f.parentWindow:window}var h,m,_="",M="";if(e===c.topMouseOut?(h=t,_=n,m=u(r.relatedTarget||r.toElement),m?M=i.getID(m):m=p,m=m||p):(h=p,m=t,M=n),h===m)return null;var g=o.getPooled(l.mouseLeave,_,r,s);g.type="mouseleave",g.target=h,g.relatedTarget=m;var v=o.getPooled(l.mouseEnter,M,r,s);return v.type="mouseenter",v.target=m,v.relatedTarget=h,a.accumulateEnterLeaveDispatches(g,v,_,M),d[0]=g,d[1]=v,d}};e.exports=p},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(85),o=n(36),i=n(86),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:i,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};a.augmentClass(r,s),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(75),o=n(79),i={view:function(e){if(e.view)return e.view;var t=o(e);if(null!=t&&t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};a.augmentClass(r,i),e.exports=r},function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=a[e];return!!r&&!!n[r]}function r(e){return n}var a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=r},function(e,t,n){"use strict";var r,a=n(21),o=n(7),i=a.injection.MUST_USE_ATTRIBUTE,s=a.injection.MUST_USE_PROPERTY,c=a.injection.HAS_BOOLEAN_VALUE,u=a.injection.HAS_SIDE_EFFECTS,l=a.injection.HAS_NUMERIC_VALUE,d=a.injection.HAS_POSITIVE_NUMERIC_VALUE,p=a.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(o.canUseDOM){var f=document.implementation;r=f&&f.hasFeature&&f.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:i|c,allowTransparency:i,alt:null,async:c,autoComplete:null,autoPlay:c,capture:i|c,cellPadding:null,cellSpacing:null,charSet:i,challenge:i,checked:s|c,classID:i,className:r?i:s,cols:i|d,colSpan:null,content:null,contentEditable:null,contextMenu:i,controls:s|c,coords:null,crossOrigin:null,data:null,dateTime:i,default:c,defer:c,dir:null,disabled:i|c,download:p,draggable:null,encType:null,form:i,formAction:i,formEncType:i,formMethod:i,formNoValidate:c,formTarget:i,frameBorder:i,headers:null,height:i,hidden:i|c,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,inputMode:i,integrity:null,is:i,keyParams:i,keyType:i,kind:null,label:null,lang:null,list:i,loop:s|c,low:null,manifest:i,marginHeight:null,marginWidth:null,max:null,maxLength:i,media:i,mediaGroup:null,method:null,min:null,minLength:i,multiple:s|c,muted:s|c,name:null,nonce:i,noValidate:c,open:c,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|c,rel:null,required:c,reversed:c,role:i,rows:i|d,rowSpan:null,sandbox:null,scope:null,scoped:c,scrolling:null,seamless:i|c,selected:s|c,shape:null,size:i|d,sizes:i,span:d,spellCheck:null,src:null,srcDoc:s,srcLang:null,srcSet:i,start:l,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|u,width:i,wmode:i,wrap:null,about:i,datatype:i,inlist:i,prefix:i,property:i,resource:i,typeof:i,vocab:i,autoCapitalize:i,autoCorrect:i,autoSave:null,color:null,itemProp:i,itemScope:i|c,itemType:i,itemID:i,itemRef:i,results:null,security:i,unselectable:i},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};e.exports=h},function(e,t,n){"use strict";var r=(n(45),n(89)),a=(n(23),{getDOMNode:function(){return this.constructor._getDOMNodeDidWarn=!0,r(this)}});e.exports=a},function(e,t,n){"use strict";function r(e){return null==e?null:1===e.nodeType?e:a.has(e)?o.getNodeFromInstance(e):(null!=e.render&&"function"==typeof e.render&&i(!1),void i(!1))}var a=(n(3),n(45)),o=n(26),i=n(11);n(23);e.exports=r},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var a=n(52),o=n(55),i=n(37),s=n(13),c={initialize:s,close:function(){p.isBatchingUpdates=!1}},u={initialize:s,close:a.flushBatchedUpdates.bind(a)},l=[u,c];i(r.prototype,o.Mixin,{getTransactionWrappers:function(){return l}});var d=new r,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,a,o){var i=p.isBatchingUpdates;p.isBatchingUpdates=!0,i?e(t,n,r,a,o):d.perform(e,null,t,n,r,a,o)}};e.exports=p},function(e,t,n){"use strict";function r(){return this}function a(){var e=this._reactInternalComponent;return!!e}function o(){}function i(e,t){var n=this._reactInternalComponent;n&&(N.enqueueSetPropsInternal(n,e),t&&N.enqueueCallbackInternal(n,t))}function s(e,t){var n=this._reactInternalComponent;n&&(N.enqueueReplacePropsInternal(n,e),t&&N.enqueueCallbackInternal(n,t))}function c(e,t){t&&(null!=t.dangerouslySetInnerHTML&&(null!=t.children&&j(!1),"object"==typeof t.dangerouslySetInnerHTML&&X in t.dangerouslySetInnerHTML||j(!1)),null!=t.style&&"object"!=typeof t.style&&j(!1))}function u(e,t,n,r){var a=O.findReactContainerForID(e);if(a){var o=a.nodeType===V?a.ownerDocument:a;B(t,o)}r.getReactMountReady().enqueue(l,{id:e,registrationName:t,listener:n})}function l(){var e=this;A.putListener(e.id,e.registrationName,e.listener)}function d(){var e=this;e._rootNodeID||j(!1);var t=O.getNode(e._rootNodeID);switch(t||j(!1),e._tag){case"iframe":e._wrapperState.listeners=[A.trapBubbledEvent(y.topLevelTypes.topLoad,"load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in J)J.hasOwnProperty(n)&&e._wrapperState.listeners.push(A.trapBubbledEvent(y.topLevelTypes[n],J[n],t));break;case"img":e._wrapperState.listeners=[A.trapBubbledEvent(y.topLevelTypes.topError,"error",t),A.trapBubbledEvent(y.topLevelTypes.topLoad,"load",t)];break;case"form":e._wrapperState.listeners=[A.trapBubbledEvent(y.topLevelTypes.topReset,"reset",t),A.trapBubbledEvent(y.topLevelTypes.topSubmit,"submit",t)]}}function p(){L.mountReadyWrapper(this)}function f(){k.postUpdateWrapper(this)}function h(e){Z.call($,e)||(Q.test(e)||j(!1),$[e]=!0)}function m(e,t){return e.indexOf("-")>=0||null!=t.is}function _(e){h(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null}var M=n(92),g=n(94),v=n(21),b=n(20),y=n(28),A=n(27),E=n(24),T=n(102),L=n(103),w=n(107),k=n(110),S=n(111),O=n(26),C=n(112),z=n(16),N=n(51),D=n(37),P=n(41),x=n(19),j=n(11),R=(n(38),n(77)),Y=n(17),W=n(18),q=(n(115),n(68),n(23),A.deleteListener),B=A.listenTo,I=A.registrationNameModules,U={string:!0,number:!0},H=R({children:null}),F=R({style:null}),X=R({__html:null}),V=1,J={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},K={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},G={listing:!0,pre:!0,textarea:!0},Q=(D({menuitem:!0},K),/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/),$={},Z={}.hasOwnProperty;_.displayName="ReactDOMComponent",_.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(d,this);break;case"button":r=T.getNativeProps(this,r,n);break;case"input":L.mountWrapper(this,r,n),r=L.getNativeProps(this,r,n);break;case"option":w.mountWrapper(this,r,n),r=w.getNativeProps(this,r,n);break;case"select":k.mountWrapper(this,r,n),r=k.getNativeProps(this,r,n),n=k.processChildContext(this,r,n);break;case"textarea":S.mountWrapper(this,r,n),r=S.getNativeProps(this,r,n)}c(this,r);var a;if(t.useCreateElement){var o=n[O.ownerDocumentContextKey],i=o.createElement(this._currentElement.type);b.setAttributeForID(i,this._rootNodeID),O.getID(i),this._updateDOMProperties({},r,t,i),this._createInitialChildren(t,r,n,i),a=i}else{var s=this._createOpenTagMarkupAndPutListeners(t,r),u=this._createContentMarkup(t,r,n);a=!u&&K[this._tag]?s+"/>":s+">"+u+""}switch(this._tag){case"input":t.getReactMountReady().enqueue(p,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(M.focusDOMComponent,this)}return a},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if(null!=a)if(I.hasOwnProperty(r))a&&u(this._rootNodeID,r,a,e);else{r===F&&(a&&(a=this._previousStyleCopy=D({},t.style)),a=g.createMarkupForStyles(a));var o=null;null!=this._tag&&m(this._tag,t)?r!==H&&(o=b.createMarkupForCustomAttribute(r,a)):o=b.createMarkupForProperty(r,a),o&&(n+=" "+o)}}return e.renderToStaticMarkup?n:n+" "+b.createMarkupForID(this._rootNodeID)},_createContentMarkup:function(e,t,n){var r="",a=t.dangerouslySetInnerHTML;if(null!=a)null!=a.__html&&(r=a.__html);else{var o=U[typeof t.children]?t.children:null,i=null!=o?null:t.children;if(null!=o)r=x(o);else if(null!=i){var s=this.mountChildren(i,e,n);r=s.join("")}}return G[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var a=t.dangerouslySetInnerHTML;if(null!=a)null!=a.__html&&Y(r,a.__html);else{var o=U[typeof t.children]?t.children:null,i=null!=o?null:t.children;if(null!=o)W(r,o);else if(null!=i)for(var s=this.mountChildren(i,e,n),c=0;c>"}var m=n(40),_=n(64),M=n(13),g=n(106),v="<>",b={array:a("array"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),any:function(){return r(M.thatReturns(null))}(),arrayOf:o,element:function(){function e(e,t,n,r,a){if(!m.isValidElement(e[t])){var o=_[r];return new Error("Invalid "+o+" `"+a+"` supplied to `"+n+"`, expected a single ReactElement.")}return null}return r(e)}(),instanceOf:i,node:function(){function e(e,t,n,r,a){if(!d(e[t])){var o=_[r];return new Error("Invalid "+o+" `"+a+"` supplied to `"+n+"`, expected a ReactNode.")}return null}return r(e)}(),objectOf:c,oneOf:s,oneOfType:u,shape:l};e.exports=b},function(e,t){"use strict";function n(e){var t=e&&(r&&e[r]||e[a]);if("function"==typeof t)return t}var r="function"==typeof Symbol&&Symbol.iterator,a="@@iterator";e.exports=n},function(e,t,n){"use strict";var r=n(108),a=n(110),o=n(37),i=(n(23),a.valueContextKey),s={mountWrapper:function(e,t,n){var r=n[i],a=null;if(null!=r)if(a=!1,Array.isArray(r)){for(var o=0;o"+s+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var a=i.getNode(this._rootNodeID);r.updateTextContent(a,n)}}},unmountComponent:function(){o.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=l},function(e,t,n){"use strict";function r(e,t,n){var r=n>=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var a=n(6),o=n(14),i=n(16),s=n(17),c=n(18),u=n(11),l={dangerouslyReplaceNodeWithMarkup:a.dangerouslyReplaceNodeWithMarkup,updateTextContent:c,processUpdates:function(e,t){for(var n,i=null,l=null,d=0;d]+)/,l={dangerouslyRenderMarkup:function(e){a.canUseDOM||c(!1);for(var t,n={},l=0;l":"<"+e+">",s[e]=!i.firstChild),s[e]?p[e]:null}var a=n(7),o=n(11),i=a.canUseDOM?document.createElement("div"):null,s={},c=[1,'"],u=[1,"","
"],l=[3,"","
"],d=[1,'',""],p={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:c,option:c,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:l,th:l};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){p[e]=d,s[e]=!0}),e.exports=r},function(e,t){"use strict";function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=n(15),a=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});e.exports=a},function(e,t,n){"use strict";var r=n(11),a=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)||r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=a},function(e,t,n){"use strict";function r(e,t,n){return n}var a={enableMeasure:!1,storedMeasure:r,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){a.storedMeasure=e}}};e.exports=a},function(e,t,n){"use strict";var r=n(7),a=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,i=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(i=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(i=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=i},function(e,t,n){"use strict";var r=n(7),a=n(19),o=n(17),i=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){o(e,a(t))})),e.exports=i},function(e,t){"use strict";function n(e){return a[e]}function r(e){return(""+e).replace(o,n)}var a={"&":"&",">":">","<":"<",'"':""","'":"'"},o=/[&><"']/g;e.exports=r},function(e,t,n){"use strict";function r(e){return!!l.hasOwnProperty(e)||!u.hasOwnProperty(e)&&(c.test(e)?(l[e]=!0,!0):(u[e]=!0,!1))}function a(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var o=n(21),i=n(16),s=n(22),c=(n(23),/^[a-zA-Z_][\w\.\-]*$/),u={},l={},d={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(o.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=o.properties.hasOwnProperty(e)?o.properties[e]:null;if(n){if(a(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?r+'=""':r+"="+s(t)}return o.isCustomAttribute(e)?null==t?"":e+"="+s(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,t,n){var r=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(r){var i=r.mutationMethod;if(i)i(e,n);else if(a(r,n))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute){var s=r.attributeName,c=r.attributeNamespace;c?e.setAttributeNS(c,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(s,""):e.setAttribute(s,""+n)}else{var u=r.propertyName;r.hasSideEffects&&""+e[u]==""+n||(e[u]=n)}}else o.isCustomAttribute(t)&&d.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var a=n.propertyName,i=o.getDefaultValueForProperty(e.nodeName,a);n.hasSideEffects&&""+e[a]===i||(e[a]=i)}}else o.isCustomAttribute(t)&&e.removeAttribute(t)}};i.measureMethods(d,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),e.exports=d},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var a=n(11),o={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=o,n=e.Properties||{},i=e.DOMAttributeNamespaces||{},c=e.DOMAttributeNames||{},u=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var d in n){s.properties.hasOwnProperty(d)&&a(!1);var p=d.toLowerCase(),f=n[d],h={attributeName:p,attributeNamespace:null,propertyName:d,mutationMethod:null,mustUseAttribute:r(f,t.MUST_USE_ATTRIBUTE),mustUseProperty:r(f,t.MUST_USE_PROPERTY),hasSideEffects:r(f,t.HAS_SIDE_EFFECTS),hasBooleanValue:r(f,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(f,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(f,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(f,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.mustUseAttribute&&h.mustUseProperty&&a(!1),!h.mustUseProperty&&h.hasSideEffects&&a(!1),h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1||a(!1),c.hasOwnProperty(d)){var m=c[d];h.attributeName=m}i.hasOwnProperty(d)&&(h.attributeNamespace=i[d]),u.hasOwnProperty(d)&&(h.propertyName=u[d]),l.hasOwnProperty(d)&&(h.mutationMethod=l[d]),s.properties[d]=h}}},i={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t-1||i(!1),!u.plugins[n]){t.extractEvents||i(!1),u.plugins[n]=t;var r=t.eventTypes;for(var o in r)a(r[o],t,o)||i(!1)}}}function a(e,t,n){u.eventNameDispatchConfigs.hasOwnProperty(n)&&i(!1),u.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];o(s,t,n)}return!0}return!!e.registrationName&&(o(e.registrationName,t,n),!0)}function o(e,t,n){u.registrationNameModules[e]&&i(!1),u.registrationNameModules[e]=t,u.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var i=n(11),s=null,c={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s&&i(!1),s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];c.hasOwnProperty(n)&&c[n]===a||(c[n]&&i(!1),c[n]=a,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return u.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in c)c.hasOwnProperty(e)&&delete c[e];u.plugins.length=0;var t=u.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=u.registrationNameModules;for(var a in r)r.hasOwnProperty(a)&&delete r[a]}};e.exports=u},function(e,t,n){"use strict";function r(e){return e===_.topMouseUp||e===_.topTouchEnd||e===_.topTouchCancel}function a(e){return e===_.topMouseMove||e===_.topTouchMove}function o(e){return e===_.topMouseDown||e===_.topTouchStart}function i(e,t,n,r){var a=e.type||"unknown-event";e.currentTarget=m.Mount.getNode(r),t?f.invokeGuardedCallbackWithCatch(a,n,e,r):f.invokeGuardedCallback(a,n,e,r),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var a=0;a1){for(var d=Array(l),p=0;p1){for(var f=Array(p),h=0;h1){var t=e.indexOf(f,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,a){var o=u(e,t);o!==e&&l(e,o,n,r,!1,!0),o!==t&&l(o,t,n,a,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,n){e&&(l("",e,t,n,!0,!0),l(e,"",t,n,!0,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},getFirstCommonAncestorID:u,_getNextDescendantID:c,isAncestorIDOf:i,SEPARATOR:f};e.exports=_},function(e,t){"use strict";var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};e.exports=r},function(e,t){"use strict";var n={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=n},function(e,t,n){"use strict";var r=n(47),a=/\/?>/,o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(a," "+o.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(o.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=o},function(e,t){"use strict";function n(e){for(var t=1,n=0,a=0,o=e.length,i=-4&o;a8&&A<=11),L=32,w=String.fromCharCode(L),k=p.topLevelTypes,S={beforeInput:{phasedRegistrationNames:{bubbled:g({onBeforeInput:null}),captured:g({onBeforeInputCapture:null})},dependencies:[k.topCompositionEnd,k.topKeyPress,k.topTextInput,k.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:g({onCompositionEnd:null}),captured:g({onCompositionEndCapture:null})},dependencies:[k.topBlur,k.topCompositionEnd,k.topKeyDown,k.topKeyPress,k.topKeyUp,k.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:g({onCompositionStart:null}),captured:g({onCompositionStartCapture:null})},dependencies:[k.topBlur,k.topCompositionStart,k.topKeyDown,k.topKeyPress,k.topKeyUp,k.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:g({onCompositionUpdate:null}),captured:g({onCompositionUpdateCapture:null})},dependencies:[k.topBlur,k.topCompositionUpdate,k.topKeyDown,k.topKeyPress,k.topKeyUp,k.topMouseDown]}},C=!1,O=null,z={eventTypes:S,extractEvents:function(e,t,n,r,a){return[c(e,t,n,r,a),d(e,t,n,r,a)]}};e.exports=z},function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return g(e,r)}function a(e,t,n){var a=t?M.bubbled:M.captured,o=r(e,n,a);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchIDs=m(n._dispatchIDs,e))}function o(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,a,e)}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(e.dispatchMarker,a,e)}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,a=g(e,r);a&&(n._dispatchListeners=m(n._dispatchListeners,a),n._dispatchIDs=m(n._dispatchIDs,e))}}function c(e){e&&e.dispatchConfig.registrationName&&s(e.dispatchMarker,null,e)}function u(e){_(e,o)}function l(e){_(e,i)}function d(e,t,n,r){h.injection.getInstanceHandle().traverseEnterLeave(n,r,s,e,t)}function p(e){_(e,c)}var f=n(28),h=n(29),m=(n(23),n(33)),_=n(34),M=f.PropagationPhases,g=h.getListener,v={accumulateTwoPhaseDispatches:u,accumulateTwoPhaseDispatchesSkipTarget:l,accumulateDirectDispatches:p,accumulateEnterLeaveDispatches:d};e.exports=v},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var a=n(54),o=n(37),i=n(73);o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,a=this.getText(),o=a.length;for(e=0;e1?1-t:void 0;return this._fallbackText=a.slice(e,s),this._fallbackText}}),a.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(){return!o&&a.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var a=n(7),o=null;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(75),o={data:null};a.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var a=this.constructor.Interface;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var c=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;this.isDefaultPrevented=c?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse}var a=n(54),o=n(37),i=n(13),s=(n(23),{type:null,target:null,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null});o(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=i.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=i.thatReturnsTrue)},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=s,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);o(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=o({},n.Interface,t),e.augmentClass=n.augmentClass,a.addPoolingTo(e,a.fourArgumentPooler)},a.addPoolingTo(r,a.fourArgumentPooler),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(75),o={data:null};a.augmentClass(r,o),e.exports=r},function(e,t){"use strict";var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function a(e){var t=E.getPooled(C.change,z,e,T(e));b.accumulateTwoPhaseDispatches(t),A.batchedUpdates(o,t)}function o(e){v.enqueueEvents(e),v.processEventQueue(!1)}function i(e,t){O=e,z=t,O.attachEvent("onchange",a)}function s(){O&&(O.detachEvent("onchange",a),O=null,z=null)}function c(e,t,n){if(e===S.topChange)return n}function u(e,t,n){e===S.topFocus?(s(),i(t,n)):e===S.topBlur&&s()}function l(e,t){O=e,z=t,N=e.value,P=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(O,"value",j),O.attachEvent("onpropertychange",p)}function d(){O&&(delete O.value,O.detachEvent("onpropertychange",p),O=null,z=null,N=null,P=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==N&&(N=t,a(e))}}function f(e,t,n){if(e===S.topInput)return n}function h(e,t,n){e===S.topFocus?(d(),l(t,n)):e===S.topBlur&&d()}function m(e,t,n){if((e===S.topSelectionChange||e===S.topKeyUp||e===S.topKeyDown)&&O&&O.value!==N)return N=O.value,z}function _(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function M(e,t,n){if(e===S.topClick)return n}var g=n(28),v=n(29),b=n(71),y=n(7),A=n(52),E=n(75),T=n(79),L=n(38),w=n(80),k=n(77),S=g.topLevelTypes,C={change:{phasedRegistrationNames:{bubbled:k({onChange:null}),captured:k({onChangeCapture:null})},dependencies:[S.topBlur,S.topChange,S.topClick,S.topFocus,S.topInput,S.topKeyDown,S.topKeyUp,S.topSelectionChange]}},O=null,z=null,N=null,P=null,D=!1;y.canUseDOM&&(D=L("change")&&(!("documentMode"in document)||document.documentMode>8));var x=!1;y.canUseDOM&&(x=L("input")&&(!("documentMode"in document)||document.documentMode>9));var j={get:function(){return P.get.call(this)},set:function(e){N=""+e,P.set.call(this,e)}},R={eventTypes:C,extractEvents:function(e,t,n,a,o){var i,s;if(r(t)?D?i=c:s=u:w(t)?x?i=f:(i=m,s=h):_(t)&&(i=M),i){var l=i(e,t,n);if(l){var d=E.getPooled(C.change,l,a,o);return d.type="change",b.accumulateTwoPhaseDispatches(d),d}}s&&s(e,t,n)}} +;e.exports=R},function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=n},function(e,t){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&r[e.type]||"textarea"===t)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};e.exports=r},function(e,t,n){"use strict";var r=n(77),a=[r({ResponderEventPlugin:null}),r({SimpleEventPlugin:null}),r({TapEventPlugin:null}),r({EnterLeaveEventPlugin:null}),r({ChangeEventPlugin:null}),r({SelectEventPlugin:null}),r({BeforeInputEventPlugin:null})];e.exports=a},function(e,t,n){"use strict";var r=n(28),a=n(71),o=n(84),i=n(26),s=n(77),c=r.topLevelTypes,u=i.getFirstReactDOM,l={mouseEnter:{registrationName:s({onMouseEnter:null}),dependencies:[c.topMouseOut,c.topMouseOver]},mouseLeave:{registrationName:s({onMouseLeave:null}),dependencies:[c.topMouseOut,c.topMouseOver]}},d=[null,null],p={eventTypes:l,extractEvents:function(e,t,n,r,s){if(e===c.topMouseOver&&(r.relatedTarget||r.fromElement))return null;if(e!==c.topMouseOut&&e!==c.topMouseOver)return null;var p;if(t.window===t)p=t;else{var f=t.ownerDocument;p=f?f.defaultView||f.parentWindow:window}var h,m,_="",M="";if(e===c.topMouseOut?(h=t,_=n,m=u(r.relatedTarget||r.toElement),m?M=i.getID(m):m=p,m=m||p):(h=p,m=t,M=n),h===m)return null;var g=o.getPooled(l.mouseLeave,_,r,s);g.type="mouseleave",g.target=h,g.relatedTarget=m;var v=o.getPooled(l.mouseEnter,M,r,s);return v.type="mouseenter",v.target=m,v.relatedTarget=h,a.accumulateEnterLeaveDispatches(g,v,_,M),d[0]=g,d[1]=v,d}};e.exports=p},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(85),o=n(36),i=n(86),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:i,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};a.augmentClass(r,s),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(75),o=n(79),i={view:function(e){if(e.view)return e.view;var t=o(e);if(null!=t&&t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};a.augmentClass(r,i),e.exports=r},function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=a[e];return!!r&&!!n[r]}function r(e){return n}var a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=r},function(e,t,n){"use strict";var r,a=n(21),o=n(7),i=a.injection.MUST_USE_ATTRIBUTE,s=a.injection.MUST_USE_PROPERTY,c=a.injection.HAS_BOOLEAN_VALUE,u=a.injection.HAS_SIDE_EFFECTS,l=a.injection.HAS_NUMERIC_VALUE,d=a.injection.HAS_POSITIVE_NUMERIC_VALUE,p=a.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(o.canUseDOM){var f=document.implementation;r=f&&f.hasFeature&&f.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:i|c,allowTransparency:i,alt:null,async:c,autoComplete:null,autoPlay:c,capture:i|c,cellPadding:null,cellSpacing:null,charSet:i,challenge:i,checked:s|c,classID:i,className:r?i:s,cols:i|d,colSpan:null,content:null,contentEditable:null,contextMenu:i,controls:s|c,coords:null,crossOrigin:null,data:null,dateTime:i,default:c,defer:c,dir:null,disabled:i|c,download:p,draggable:null,encType:null,form:i,formAction:i,formEncType:i,formMethod:i,formNoValidate:c,formTarget:i,frameBorder:i,headers:null,height:i,hidden:i|c,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,inputMode:i,integrity:null,is:i,keyParams:i,keyType:i,kind:null,label:null,lang:null,list:i,loop:s|c,low:null,manifest:i,marginHeight:null,marginWidth:null,max:null,maxLength:i,media:i,mediaGroup:null,method:null,min:null,minLength:i,multiple:s|c,muted:s|c,name:null,nonce:i,noValidate:c,open:c,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|c,rel:null,required:c,reversed:c,role:i,rows:i|d,rowSpan:null,sandbox:null,scope:null,scoped:c,scrolling:null,seamless:i|c,selected:s|c,shape:null,size:i|d,sizes:i,span:d,spellCheck:null,src:null,srcDoc:s,srcLang:null,srcSet:i,start:l,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|u,width:i,wmode:i,wrap:null,about:i,datatype:i,inlist:i,prefix:i,property:i,resource:i,typeof:i,vocab:i,autoCapitalize:i,autoCorrect:i,autoSave:null,color:null,itemProp:i,itemScope:i|c,itemType:i,itemID:i,itemRef:i,results:null,security:i,unselectable:i},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};e.exports=h},function(e,t,n){"use strict";var r=(n(45),n(89)),a=(n(23),{getDOMNode:function(){return this.constructor._getDOMNodeDidWarn=!0,r(this)}});e.exports=a},function(e,t,n){"use strict";function r(e){return null==e?null:1===e.nodeType?e:a.has(e)?o.getNodeFromInstance(e):(null!=e.render&&"function"==typeof e.render&&i(!1),void i(!1))}var a=(n(3),n(45)),o=n(26),i=n(11);n(23);e.exports=r},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var a=n(52),o=n(55),i=n(37),s=n(13),c={initialize:s,close:function(){p.isBatchingUpdates=!1}},u={initialize:s,close:a.flushBatchedUpdates.bind(a)},l=[u,c];i(r.prototype,o.Mixin,{getTransactionWrappers:function(){return l}});var d=new r,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,a,o){var i=p.isBatchingUpdates;p.isBatchingUpdates=!0,i?e(t,n,r,a,o):d.perform(e,null,t,n,r,a,o)}};e.exports=p},function(e,t,n){"use strict";function r(){return this}function a(){var e=this._reactInternalComponent;return!!e}function o(){}function i(e,t){var n=this._reactInternalComponent;n&&(N.enqueueSetPropsInternal(n,e),t&&N.enqueueCallbackInternal(n,t))}function s(e,t){var n=this._reactInternalComponent;n&&(N.enqueueReplacePropsInternal(n,e),t&&N.enqueueCallbackInternal(n,t))}function c(e,t){t&&(null!=t.dangerouslySetInnerHTML&&(null!=t.children&&j(!1),"object"==typeof t.dangerouslySetInnerHTML&&X in t.dangerouslySetInnerHTML||j(!1)),null!=t.style&&"object"!=typeof t.style&&j(!1))}function u(e,t,n,r){var a=C.findReactContainerForID(e);if(a){var o=a.nodeType===V?a.ownerDocument:a;I(t,o)}r.getReactMountReady().enqueue(l,{id:e,registrationName:t,listener:n})}function l(){var e=this;A.putListener(e.id,e.registrationName,e.listener)}function d(){var e=this;e._rootNodeID||j(!1);var t=C.getNode(e._rootNodeID);switch(t||j(!1),e._tag){case"iframe":e._wrapperState.listeners=[A.trapBubbledEvent(y.topLevelTypes.topLoad,"load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in J)J.hasOwnProperty(n)&&e._wrapperState.listeners.push(A.trapBubbledEvent(y.topLevelTypes[n],J[n],t));break;case"img":e._wrapperState.listeners=[A.trapBubbledEvent(y.topLevelTypes.topError,"error",t),A.trapBubbledEvent(y.topLevelTypes.topLoad,"load",t)];break;case"form":e._wrapperState.listeners=[A.trapBubbledEvent(y.topLevelTypes.topReset,"reset",t),A.trapBubbledEvent(y.topLevelTypes.topSubmit,"submit",t)]}}function p(){L.mountReadyWrapper(this)}function f(){k.postUpdateWrapper(this)}function h(e){$.call(Z,e)||(Q.test(e)||j(!1),Z[e]=!0)}function m(e,t){return e.indexOf("-")>=0||null!=t.is}function _(e){h(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null}var M=n(92),g=n(94),v=n(21),b=n(20),y=n(28),A=n(27),E=n(24),T=n(102),L=n(103),w=n(107),k=n(110),S=n(111),C=n(26),O=n(112),z=n(16),N=n(51),P=n(37),D=n(41),x=n(19),j=n(11),R=(n(38),n(77)),Y=n(17),W=n(18),q=(n(115),n(68),n(23),A.deleteListener),I=A.listenTo,B=A.registrationNameModules,U={string:!0,number:!0},H=R({children:null}),F=R({style:null}),X=R({__html:null}),V=1,J={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},K={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},G={listing:!0,pre:!0,textarea:!0},Q=(P({menuitem:!0},K),/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/),Z={},$={}.hasOwnProperty;_.displayName="ReactDOMComponent",_.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(d,this);break;case"button":r=T.getNativeProps(this,r,n);break;case"input":L.mountWrapper(this,r,n),r=L.getNativeProps(this,r,n);break;case"option":w.mountWrapper(this,r,n),r=w.getNativeProps(this,r,n);break;case"select":k.mountWrapper(this,r,n),r=k.getNativeProps(this,r,n),n=k.processChildContext(this,r,n);break;case"textarea":S.mountWrapper(this,r,n),r=S.getNativeProps(this,r,n)}c(this,r);var a;if(t.useCreateElement){var o=n[C.ownerDocumentContextKey],i=o.createElement(this._currentElement.type);b.setAttributeForID(i,this._rootNodeID),C.getID(i),this._updateDOMProperties({},r,t,i),this._createInitialChildren(t,r,n,i),a=i}else{var s=this._createOpenTagMarkupAndPutListeners(t,r),u=this._createContentMarkup(t,r,n);a=!u&&K[this._tag]?s+"/>":s+">"+u+""}switch(this._tag){case"input":t.getReactMountReady().enqueue(p,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(M.focusDOMComponent,this)}return a},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if(null!=a)if(B.hasOwnProperty(r))a&&u(this._rootNodeID,r,a,e);else{r===F&&(a&&(a=this._previousStyleCopy=P({},t.style)),a=g.createMarkupForStyles(a));var o=null;null!=this._tag&&m(this._tag,t)?r!==H&&(o=b.createMarkupForCustomAttribute(r,a)):o=b.createMarkupForProperty(r,a),o&&(n+=" "+o)}}return e.renderToStaticMarkup?n:n+" "+b.createMarkupForID(this._rootNodeID)},_createContentMarkup:function(e,t,n){var r="",a=t.dangerouslySetInnerHTML;if(null!=a)null!=a.__html&&(r=a.__html);else{var o=U[typeof t.children]?t.children:null,i=null!=o?null:t.children;if(null!=o)r=x(o);else if(null!=i){var s=this.mountChildren(i,e,n);r=s.join("")}}return G[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var a=t.dangerouslySetInnerHTML;if(null!=a)null!=a.__html&&Y(r,a.__html);else{var o=U[typeof t.children]?t.children:null,i=null!=o?null:t.children;if(null!=o)W(r,o);else if(null!=i)for(var s=this.mountChildren(i,e,n),c=0;c>"}var m=n(40),_=n(64),M=n(13),g=n(106),v="<>",b={array:a("array"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),any:function(){return r(M.thatReturns(null))}(),arrayOf:o,element:function(){function e(e,t,n,r,a){if(!m.isValidElement(e[t])){var o=_[r];return new Error("Invalid "+o+" `"+a+"` supplied to `"+n+"`, expected a single ReactElement.")}return null}return r(e)}(),instanceOf:i,node:function(){function e(e,t,n,r,a){if(!d(e[t])){var o=_[r];return new Error("Invalid "+o+" `"+a+"` supplied to `"+n+"`, expected a ReactNode.")}return null}return r(e)}(),objectOf:c,oneOf:s,oneOfType:u,shape:l};e.exports=b},function(e,t){"use strict";function n(e){var t=e&&(r&&e[r]||e[a]);if("function"==typeof t)return t}var r="function"==typeof Symbol&&Symbol.iterator,a="@@iterator";e.exports=n},function(e,t,n){"use strict";var r=n(108),a=n(110),o=n(37),i=(n(23),a.valueContextKey),s={mountWrapper:function(e,t,n){var r=n[i],a=null;if(null!=r)if(a=!1,Array.isArray(r)){for(var o=0;ot.end?(n=t.end,r=t.start):(n=t.start,r=t.end),a.moveToElementText(e),a.moveStart("character",n),a.setEndPoint("EndToStart",a),a.moveEnd("character",r-n),a.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[l()].length,a=Math.min(t.start,r),o=void 0===t.end?a:Math.min(t.end,r);if(!n.extend&&a>o){var i=o;o=a,a=i}var s=u(e,a),c=u(e,o);if(s&&c){var d=document.createRange();d.setStart(s.node,s.offset),n.removeAllRanges(),a>o?(n.addRange(d),n.extend(c.node,c.offset)):(d.setEnd(c.node,c.offset),n.addRange(d))}}}var c=n(7),u=n(126),l=n(73),d=c.canUseDOM&&"selection"in document&&!("getSelection"in window),p={getOffsets:d?a:o,setOffsets:d?i:s};e.exports=p},function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function a(e,t){for(var a=n(e),o=0,i=0;a;){if(3===a.nodeType){if(i=o+a.textContent.length,o<=t&&i>=t)return{node:a,offset:t-o};o=i}a=n(r(a))}}e.exports=a},function(e,t){"use strict";function n(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}e.exports=n},function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&c.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function a(e,t){if(b||null==M||M!==l())return null;var n=r(M);if(!v||!f(v,n)){v=n;var a=u.getPooled(_.select,g,e,t);return a.type="select",a.target=M,i.accumulateTwoPhaseDispatches(a),a}return null}var o=n(28),i=n(71),s=n(7),c=n(124),u=n(75),l=n(127),d=n(80),p=n(77),f=n(115),h=o.topLevelTypes,m=s.canUseDOM&&"documentMode"in document&&document.documentMode<=11,_={select:{phasedRegistrationNames:{bubbled:p({onSelect:null}),captured:p({onSelectCapture:null})},dependencies:[h.topBlur,h.topContextMenu,h.topFocus,h.topKeyDown,h.topMouseDown,h.topMouseUp,h.topSelectionChange]}},M=null,g=null,v=null,b=!1,y=!1,A=p({onSelect:null}),E={eventTypes:_,extractEvents:function(e,t,n,r,o){if(!y)return null;switch(e){case h.topFocus:(d(t)||"true"===t.contentEditable)&&(M=t,g=n,v=null);break;case h.topBlur:M=null,g=null,v=null;break;case h.topMouseDown:b=!0;break;case h.topContextMenu:case h.topMouseUp:return b=!1,a(r,o);case h.topSelectionChange:if(m)break;case h.topKeyDown:case h.topKeyUp:return a(r,o)}return null},didPutListener:function(e,t,n){t===A&&(y=!0)}};e.exports=E},function(e,t){"use strict";var n=Math.pow(2,53),r={createReactRootIndex:function(){return Math.ceil(Math.random()*n)}};e.exports=r},function(e,t,n){"use strict";var r=n(28),a=n(117),o=n(71),i=n(26),s=n(131),c=n(75),u=n(132),l=n(133),d=n(84),p=n(136),f=n(137),h=n(85),m=n(138),_=n(13),M=n(134),g=n(11),v=n(77),b=r.topLevelTypes,y={abort:{phasedRegistrationNames:{bubbled:v({onAbort:!0}),captured:v({onAbortCapture:!0})}},blur:{phasedRegistrationNames:{bubbled:v({onBlur:!0}),captured:v({onBlurCapture:!0})}},canPlay:{phasedRegistrationNames:{bubbled:v({onCanPlay:!0}),captured:v({onCanPlayCapture:!0})}},canPlayThrough:{phasedRegistrationNames:{bubbled:v({onCanPlayThrough:!0}),captured:v({onCanPlayThroughCapture:!0})}},click:{phasedRegistrationNames:{bubbled:v({onClick:!0}),captured:v({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:v({onContextMenu:!0}),captured:v({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:v({onCopy:!0}),captured:v({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:v({onCut:!0}),captured:v({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:v({onDoubleClick:!0}),captured:v({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:v({onDrag:!0}),captured:v({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:v({onDragEnd:!0}),captured:v({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:v({onDragEnter:!0}),captured:v({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:v({onDragExit:!0}),captured:v({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:v({onDragLeave:!0}),captured:v({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:v({onDragOver:!0}),captured:v({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:v({onDragStart:!0}),captured:v({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:v({onDrop:!0}),captured:v({onDropCapture:!0})}},durationChange:{phasedRegistrationNames:{bubbled:v({onDurationChange:!0}),captured:v({onDurationChangeCapture:!0})}},emptied:{phasedRegistrationNames:{bubbled:v({onEmptied:!0}),captured:v({onEmptiedCapture:!0})}},encrypted:{phasedRegistrationNames:{bubbled:v({onEncrypted:!0}),captured:v({onEncryptedCapture:!0})}},ended:{phasedRegistrationNames:{bubbled:v({onEnded:!0}),captured:v({onEndedCapture:!0})}},error:{phasedRegistrationNames:{bubbled:v({onError:!0}),captured:v({onErrorCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:v({onFocus:!0}),captured:v({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:v({onInput:!0}),captured:v({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:v({onKeyDown:!0}),captured:v({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:v({onKeyPress:!0}),captured:v({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:v({onKeyUp:!0}),captured:v({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:v({onLoad:!0}),captured:v({onLoadCapture:!0})}},loadedData:{phasedRegistrationNames:{bubbled:v({onLoadedData:!0}),captured:v({onLoadedDataCapture:!0})}},loadedMetadata:{phasedRegistrationNames:{bubbled:v({onLoadedMetadata:!0}),captured:v({onLoadedMetadataCapture:!0})}},loadStart:{phasedRegistrationNames:{bubbled:v({onLoadStart:!0}),captured:v({onLoadStartCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:v({onMouseDown:!0}),captured:v({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:v({onMouseMove:!0}),captured:v({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:v({onMouseOut:!0}),captured:v({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:v({onMouseOver:!0}),captured:v({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:v({onMouseUp:!0}),captured:v({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:v({onPaste:!0}),captured:v({onPasteCapture:!0})}},pause:{phasedRegistrationNames:{bubbled:v({onPause:!0}),captured:v({onPauseCapture:!0})}},play:{phasedRegistrationNames:{bubbled:v({onPlay:!0}),captured:v({onPlayCapture:!0})}},playing:{phasedRegistrationNames:{bubbled:v({onPlaying:!0}),captured:v({onPlayingCapture:!0})}},progress:{phasedRegistrationNames:{bubbled:v({onProgress:!0}),captured:v({onProgressCapture:!0})}},rateChange:{phasedRegistrationNames:{bubbled:v({onRateChange:!0}),captured:v({onRateChangeCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:v({onReset:!0}),captured:v({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:v({onScroll:!0}),captured:v({onScrollCapture:!0})}},seeked:{phasedRegistrationNames:{bubbled:v({onSeeked:!0}),captured:v({onSeekedCapture:!0})}},seeking:{phasedRegistrationNames:{bubbled:v({onSeeking:!0}),captured:v({onSeekingCapture:!0})}},stalled:{phasedRegistrationNames:{bubbled:v({onStalled:!0}),captured:v({onStalledCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:v({onSubmit:!0}),captured:v({onSubmitCapture:!0})}},suspend:{phasedRegistrationNames:{bubbled:v({onSuspend:!0}),captured:v({onSuspendCapture:!0})}},timeUpdate:{phasedRegistrationNames:{bubbled:v({onTimeUpdate:!0}),captured:v({onTimeUpdateCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:v({onTouchCancel:!0}),captured:v({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:v({onTouchEnd:!0}),captured:v({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:v({onTouchMove:!0}),captured:v({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:v({onTouchStart:!0}),captured:v({onTouchStartCapture:!0})}},volumeChange:{phasedRegistrationNames:{bubbled:v({onVolumeChange:!0}),captured:v({onVolumeChangeCapture:!0})}},waiting:{phasedRegistrationNames:{bubbled:v({onWaiting:!0}),captured:v({onWaitingCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:v({onWheel:!0}),captured:v({onWheelCapture:!0})}}},A={topAbort:y.abort,topBlur:y.blur,topCanPlay:y.canPlay,topCanPlayThrough:y.canPlayThrough,topClick:y.click,topContextMenu:y.contextMenu,topCopy:y.copy,topCut:y.cut,topDoubleClick:y.doubleClick,topDrag:y.drag,topDragEnd:y.dragEnd,topDragEnter:y.dragEnter,topDragExit:y.dragExit,topDragLeave:y.dragLeave,topDragOver:y.dragOver,topDragStart:y.dragStart,topDrop:y.drop,topDurationChange:y.durationChange,topEmptied:y.emptied,topEncrypted:y.encrypted,topEnded:y.ended,topError:y.error,topFocus:y.focus,topInput:y.input,topKeyDown:y.keyDown,topKeyPress:y.keyPress,topKeyUp:y.keyUp,topLoad:y.load,topLoadedData:y.loadedData,topLoadedMetadata:y.loadedMetadata,topLoadStart:y.loadStart,topMouseDown:y.mouseDown,topMouseMove:y.mouseMove,topMouseOut:y.mouseOut,topMouseOver:y.mouseOver,topMouseUp:y.mouseUp,topPaste:y.paste,topPause:y.pause,topPlay:y.play,topPlaying:y.playing,topProgress:y.progress,topRateChange:y.rateChange,topReset:y.reset,topScroll:y.scroll,topSeeked:y.seeked,topSeeking:y.seeking,topStalled:y.stalled,topSubmit:y.submit,topSuspend:y.suspend,topTimeUpdate:y.timeUpdate,topTouchCancel:y.touchCancel,topTouchEnd:y.touchEnd,topTouchMove:y.touchMove,topTouchStart:y.touchStart,topVolumeChange:y.volumeChange,topWaiting:y.waiting,topWheel:y.wheel};for(var E in A)A[E].dependencies=[E];var T=v({onClick:null}),L={},w={eventTypes:y,extractEvents:function(e,t,n,r,a){var i=A[e];if(!i)return null;var _;switch(e){case b.topAbort:case b.topCanPlay:case b.topCanPlayThrough:case b.topDurationChange:case b.topEmptied:case b.topEncrypted:case b.topEnded:case b.topError:case b.topInput:case b.topLoad:case b.topLoadedData:case b.topLoadedMetadata:case b.topLoadStart:case b.topPause:case b.topPlay:case b.topPlaying:case b.topProgress:case b.topRateChange:case b.topReset:case b.topSeeked:case b.topSeeking:case b.topStalled:case b.topSubmit:case b.topSuspend:case b.topTimeUpdate:case b.topVolumeChange:case b.topWaiting:_=c;break;case b.topKeyPress:if(0===M(r))return null;case b.topKeyDown:case b.topKeyUp:_=l;break;case b.topBlur:case b.topFocus:_=u;break;case b.topClick:if(2===r.button)return null;case b.topContextMenu:case b.topDoubleClick:case b.topMouseDown:case b.topMouseMove:case b.topMouseOut:case b.topMouseOver:case b.topMouseUp:_=d;break;case b.topDrag:case b.topDragEnd:case b.topDragEnter:case b.topDragExit:case b.topDragLeave:case b.topDragOver:case b.topDragStart:case b.topDrop:_=p;break;case b.topTouchCancel:case b.topTouchEnd:case b.topTouchMove:case b.topTouchStart:_=f;break;case b.topScroll:_=h;break;case b.topWheel:_=m;break;case b.topCopy:case b.topCut:case b.topPaste:_=s}_||g(!1);var v=_.getPooled(i,n,r,a);return o.accumulateTwoPhaseDispatches(v),v},didPutListener:function(e,t,n){if(t===T){var r=i.getNode(e);L[e]||(L[e]=a.listen(r,"click",_))}},willDeleteListener:function(e,t){t===T&&(L[e].remove(),delete L[e])}};e.exports=w},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(75),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};a.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(85),o={relatedTarget:null};a.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(85),o=n(134),i=n(135),s=n(86),c={key:i,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};a.augmentClass(r,c),e.exports=r},function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}e.exports=n},function(e,t,n){"use strict";function r(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=a(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}var a=n(134),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(84),o={dataTransfer:null};a.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(85),o=n(86),i={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:o};a.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){a.call(this,e,t,n,r)}var a=n(84),o={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};a.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";var r=n(21),a=r.injection.MUST_USE_ATTRIBUTE,o={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},i={Properties:{clipPath:a,cx:a,cy:a,d:a,dx:a,dy:a,fill:a,fillOpacity:a,fontFamily:a,fontSize:a,fx:a,fy:a,gradientTransform:a,gradientUnits:a,markerEnd:a,markerMid:a,markerStart:a,offset:a,opacity:a,patternContentUnits:a,patternUnits:a,points:a,preserveAspectRatio:a,r:a,rx:a,ry:a,spreadMethod:a,stopColor:a,stopOpacity:a,stroke:a,strokeDasharray:a,strokeLinecap:a,strokeOpacity:a,strokeWidth:a,textAnchor:a,transform:a,version:a,viewBox:a,x1:a,x2:a,x:a,xlinkActuate:a,xlinkArcrole:a,xlinkHref:a,xlinkRole:a,xlinkShow:a,xlinkTitle:a,xlinkType:a,xmlBase:a,xmlLang:a,xmlSpace:a,y1:a,y2:a,y:a},DOMAttributeNamespaces:{xlinkActuate:o.xlink,xlinkArcrole:o.xlink,xlinkHref:o.xlink,xlinkRole:o.xlink,xlinkShow:o.xlink,xlinkTitle:o.xlink,xlinkType:o.xlink,xmlBase:o.xml,xmlLang:o.xml,xmlSpace:o.xml},DOMAttributeNames:{clipPath:"clip-path",fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space"}};e.exports=i},function(e,t){"use strict";e.exports="0.14.9"},function(e,t,n){"use strict";var r=n(26);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";e.exports=n(143)},function(e,t,n){"use strict";var r=n(2),a=n(144),o=n(148),i=n(37),s=n(153),c={};i(c,o),i(c,{findDOMNode:s("findDOMNode","ReactDOM","react-dom",r,r.findDOMNode),render:s("render","ReactDOM","react-dom",r,r.render),unmountComponentAtNode:s("unmountComponentAtNode","ReactDOM","react-dom",r,r.unmountComponentAtNode),renderToString:s("renderToString","ReactDOMServer","react-dom/server",a,a.renderToString),renderToStaticMarkup:s("renderToStaticMarkup","ReactDOMServer","react-dom/server",a,a.renderToStaticMarkup)}),c.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r,c.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a,e.exports=c},function(e,t,n){"use strict";var r=n(69),a=n(145),o=n(140);r.inject();var i={renderToString:a.renderToString,renderToStaticMarkup:a.renderToStaticMarkup,version:o};e.exports=i},function(e,t,n){"use strict";function r(e){i.isValidElement(e)||h(!1);var t;try{d.injection.injectBatchingStrategy(u);var n=s.createReactRootID();return t=l.getPooled(!1),t.perform(function(){var r=f(e,null),a=r.mountComponent(n,t,p);return c.addChecksumToMarkup(a)},null)}finally{l.release(t),d.injection.injectBatchingStrategy(o)}}function a(e){i.isValidElement(e)||h(!1);var t;try{d.injection.injectBatchingStrategy(u);var n=s.createReactRootID();return t=l.getPooled(!0),t.perform(function(){return f(e,null).mountComponent(n,t,p)},null)}finally{l.release(t),d.injection.injectBatchingStrategy(o)}}var o=n(90),i=n(40),s=n(43),c=n(46),u=n(146),l=n(147),d=n(52),p=n(56),f=n(60),h=n(11);e.exports={renderToString:r,renderToStaticMarkup:a}},function(e,t){"use strict";var n={isBatchingUpdates:!1,batchedUpdates:function(e){}};e.exports=n},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=o.getPooled(null),this.useCreateElement=!1}var a=n(54),o=n(53),i=n(55),s=n(37),c=n(13),u={initialize:function(){this.reactMountReady.reset()},close:c},l=[u],d={getTransactionWrappers:function(){return l},getReactMountReady:function(){return this.reactMountReady},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};s(r.prototype,i.Mixin,d),a.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(108),a=n(121),o=n(120),i=n(149),s=n(40),c=(n(150),n(105)),u=n(140),l=n(37),d=n(152),p=s.createElement,f=s.createFactory,h=s.cloneElement,m={Children:{map:r.map,forEach:r.forEach,count:r.count,toArray:r.toArray,only:d},Component:a,createElement:p,cloneElement:h,isValidElement:s.isValidElement,PropTypes:c,createClass:o.createClass,createFactory:f,createMixin:function(e){return e},DOM:i,version:u,__spread:l};e.exports=m},function(e,t,n){"use strict";function r(e){return a.createFactory(e)}var a=n(40),o=(n(150),n(151)),i=o({a:"a",abbr:"abbr",address:"address",area:"area", -article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul",var:"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);e.exports=i},function(e,t,n){"use strict";function r(){if(d.current){var e=d.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function a(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;o("uniqueKey",e,t)}}function o(e,t,n){var a=r();if(!a){var o="string"==typeof n?n:n.displayName||n.name;o&&(a=" Check the top-level render call using <"+o+">.")}var i=h[e]||(h[e]={});if(i[a])return null;i[a]=!0;var s={parentOrOwner:a,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==d.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function i(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:{},u=Boolean(e),p=e||T,h=void 0;h="function"==typeof t?t:t?(0,M.default)(t):L;var _=n||w,g=r.pure,v=void 0===g||g,b=r.withRef,A=void 0!==b&&b,O=v&&_!==w,C=S++;return function(e){function t(e,t,n){var r=_(e,t,n);return r}var n="Connect("+s(e)+")",r=function(r){function s(e,t){a(this,s);var i=o(this,r.call(this,e,t));i.version=C,i.store=e.store||t.store,(0,E.default)(i.store,'Could not find "store" in either the context or props of "'+n+'". Either wrap the root component in a , or explicitly pass "store" as a prop to "'+n+'".');var c=i.store.getState();return i.state={storeState:c},i.clearCache(),i}return i(s,r),s.prototype.shouldComponentUpdate=function(){return!v||this.haveOwnPropsChanged||this.hasStoreStateChanged},s.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return r},s.prototype.configureFinalMapState=function(e,t){var n=p(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:p,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},s.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return r},s.prototype.configureFinalMapDispatch=function(e,t){var n=h(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:h,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},s.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,m.default)(e,this.stateProps))&&(this.stateProps=e,!0)},s.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,m.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},s.prototype.updateMergedPropsIfNeeded=function(){var e=t(this.stateProps,this.dispatchProps,this.props);return!(this.mergedProps&&O&&(0,m.default)(e,this.mergedProps))&&(this.mergedProps=e,!0)},s.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},s.prototype.trySubscribe=function(){u&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},s.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},s.prototype.componentDidMount=function(){this.trySubscribe()},s.prototype.componentWillReceiveProps=function(e){v&&(0,m.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},s.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},s.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},s.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!v||t!==e){if(v&&!this.doStatePropsDependOnOwnProps){var n=c(this.updateStatePropsIfNeeded,this);if(!n)return;n===k&&(this.statePropsPrecalculationError=k.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},s.prototype.getWrappedInstance=function(){return(0,E.default)(A,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},s.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,r=this.haveStatePropsBeenPrecalculated,a=this.statePropsPrecalculationError,o=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,a)throw a;var i=!0,s=!0;v&&o&&(i=n||t&&this.doStatePropsDependOnOwnProps,s=t&&this.doDispatchPropsDependOnOwnProps);var c=!1,u=!1;r?c=!0:i&&(c=this.updateStatePropsIfNeeded()),s&&(u=this.updateDispatchPropsIfNeeded());return!(!!(c||u||t)&&this.updateMergedPropsIfNeeded())&&o?o:(this.renderedElement=A?(0,d.createElement)(e,l({},this.mergedProps,{ref:"wrappedInstance"})):(0,d.createElement)(e,this.mergedProps),this.renderedElement)},s}(d.Component);return r.displayName=n,r.WrappedComponent=e,r.contextTypes={store:f.default},r.propTypes={store:f.default},(0,y.default)(r,e)}}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t2?n-2:0),a=2;a should not have a "'+t+'" prop')}t.__esModule=!0,t.routes=t.route=t.components=t.component=t.history=void 0,t.falsy=r;var a=n(142),o=a.PropTypes.func,i=a.PropTypes.object,s=a.PropTypes.arrayOf,c=a.PropTypes.oneOfType,u=a.PropTypes.element,l=a.PropTypes.shape,d=a.PropTypes.string,p=(t.history=l({listen:o.isRequired,push:o.isRequired,replace:o.isRequired,go:o.isRequired,goBack:o.isRequired,goForward:o.isRequired}),t.component=c([o,d])),f=(t.components=c([p,i]),t.route=c([i,u]));t.routes=c([f,s(f)])},function(e,t,n){"use strict";function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a(e){for(var t="",n=[],a=[],o=void 0,i=0,s=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g;o=s.exec(e);)o.index!==i&&(a.push(e.slice(i,o.index)),t+=r(e.slice(i,o.index))),o[1]?(t+="([^/]+)",n.push(o[1])):"**"===o[0]?(t+="(.*)",n.push("splat")):"*"===o[0]?(t+="(.*?)",n.push("splat")):"("===o[0]?t+="(?:":")"===o[0]&&(t+=")?"),a.push(o[0]),i=s.lastIndex;return i!==e.length&&(a.push(e.slice(i,e.length)),t+=r(e.slice(i,e.length))),{pattern:e,regexpSource:t,paramNames:n,tokens:a}}function o(e){return p[e]||(p[e]=a(e)),p[e]}function i(e,t){"/"!==e.charAt(0)&&(e="/"+e);var n=o(e),r=n.regexpSource,a=n.paramNames,i=n.tokens;"/"!==e.charAt(e.length-1)&&(r+="/?"),"*"===i[i.length-1]&&(r+="$");var s=t.match(new RegExp("^"+r,"i"));if(null==s)return null;var c=s[0],u=t.substr(c.length);if(u){if("/"!==c.charAt(c.length-1))return null;u="/"+u}return{remainingPathname:u,paramNames:a,paramValues:s.slice(1).map(function(e){return e&&decodeURIComponent(e)})}}function s(e){return o(e).paramNames}function c(e,t){var n=i(e,t);if(!n)return null;var r=n.paramNames,a=n.paramValues,o={};return r.forEach(function(e,t){o[e]=a[t]}),o}function u(e,t){t=t||{};for(var n=o(e),r=n.tokens,a=0,i="",s=0,c=void 0,u=void 0,l=void 0,p=0,f=r.length;p0||(0,d.default)(!1),null!=l&&(i+=encodeURI(l))):"("===c?a+=1:")"===c?a-=1:":"===c.charAt(0)?(u=c.substring(1),l=t[u],null!=l||a>0||(0,d.default)(!1),null!=l&&(i+=encodeURIComponent(l))):i+=c;return i.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=o,t.matchPattern=i,t.getParamNames=s,t.getParams=c,t.formatPattern=u;var l=n(187),d=function(e){return e&&e.__esModule?e:{default:e}}(l),p=Object.create(null)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return!e||!e.__v2_compatible__}function i(e){return e&&e.getCurrentLocation}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t=0&&0===window.sessionStorage.length)return;throw e}}function o(e){var t=void 0;try{t=window.sessionStorage.getItem(r(e))}catch(e){if(e.name===u)return null}if(t)try{return JSON.parse(t)}catch(e){}return null}t.__esModule=!0,t.saveState=a,t.readState=o;var i=n(198),s=(function(e){e&&e.__esModule}(i),"@@History/"),c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],u="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){function t(e){return c.canUseDOM||s.default(!1),n.listen(e)}var n=d.default(o({getUserConfirmation:u.getUserConfirmation},e,{go:u.go}));return o({},n,{listen:t})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t0&&"number"!=typeof e[0]))}function o(e,t,n){var o,l;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(c(e))return!!c(t)&&(e=i.call(e),t=i.call(t),u(e,t,n));if(a(e)){if(!a(t))return!1;if(e.length!==t.length)return!1;for(o=0;o=0;o--)if(d[o]!=p[o])return!1;for(o=d.length-1;o>=0;o--)if(l=d[o],!u(e[l],t[l],n))return!1;return typeof e==typeof t}var i=Array.prototype.slice,s=n(207),c=n(208),u=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:o(e,t,n))}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=a?n:r,t.supported=n,t.unsupported=r},function(e,t){"use strict";function n(e,t,n){function a(){if(s=!0,c)return void(l=[].concat(r.call(arguments)));n.apply(this,arguments)}function o(){if(!s&&(u=!0,!c)){for(c=!0;!s&&i=e&&u&&(s=!0,n())}}var i=0,s=!1,c=!1,u=!1,l=void 0;o()}t.__esModule=!0;var r=Array.prototype.slice;t.loopAsync=n},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?i.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];return"string"==typeof e&&(e=s.parsePath(e)),"object"==typeof t&&(e=a({},e,{state:t}),t=n||i.POP,n=r),{pathname:e.pathname||"/",search:e.search||"",hash:e.hash||"",state:e.state||null,action:t,key:n}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t1?r-1:0),o=1;o=e&&c&&(i=!0,n())}}var o=0,i=!1,s=!1,c=!1,u=void 0;a()}function r(e,t,n){function r(e,t,r){i||(t?(i=!0,n(t)):(o[e]=r,(i=++s===a)&&n(null,o)))}var a=e.length,o=[];if(0===a)return n(null,o);var i=!1,s=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0,t.loopAsync=n,t.mapAsync=r},function(e,t,n){"use strict";function r(e,t){if(e==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});if("object"===(void 0===e?"undefined":c(e))){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))if(void 0===e[n]){if(void 0!==t[n])return!1}else{if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!r(e[n],t[n]))return!1}return!0}return String(e)===String(t)}function a(e,t){return"/"!==t.charAt(0)&&(t="/"+t),"/"!==e.charAt(e.length-1)&&(e+="/"),"/"!==t.charAt(t.length-1)&&(t+="/"),t===e}function o(e,t,n){for(var r=e,a=[],o=[],i=0,s=t.length;i=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return 0===e.button}function i(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function s(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function c(e,t){var n=t.query,r=t.hash,a=t.state;return n||r||a?{pathname:e,query:n,hash:r,state:a}:e}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t=0;r--){var a=e[r],o=a.path||"";if(n=o.replace(/\/*$/,"/")+n,0===o.indexOf("/"))break}return"/"+n}},propTypes:{path:p,from:p,to:p.isRequired,query:f,state:f,onEnter:l.falsy,children:l.falsy},render:function(){(0,s.default)(!1)}});t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=n(142),o=r(a),i=n(192),s=(r(i),n(187)),c=r(s),u=n(189),l=n(194),d=o.default.PropTypes.func,p=o.default.createClass({displayName:"IndexRoute",statics:{createRouteFromReactElement:function(e,t){t&&(t.indexRoute=(0,u.createRouteFromReactElement)(e))}},propTypes:{path:l.falsy,component:l.component,components:l.components,getComponent:d,getComponents:d},render:function(){(0,c.default)(!1)}});t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=n(142),o=r(a),i=n(187),s=r(i),c=n(189),u=n(194),l=o.default.PropTypes,d=l.string,p=l.func,f=o.default.createClass({displayName:"Route",statics:{createRouteFromReactElement:c.createRouteFromReactElement},propTypes:{path:d,component:u.component,components:u.components,getComponent:p,getComponents:p},render:function(){(0,s.default)(!1)}});t.default=f,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(192),a=(function(e){e&&e.__esModule}(r),n(194)),o={contextTypes:{history:a.history},componentWillMount:function(){this.history=this.context.history}};t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=n(192),o=(r(a),n(142)),i=r(o),s=n(187),c=r(s),u=i.default.PropTypes.object,l={contextTypes:{history:u.isRequired,route:u},propTypes:{route:u},componentDidMount:function(){this.routerWillLeave||(0,c.default)(!1);var e=this.props.route||this.context.route;e||(0,c.default)(!1),this._unlistenBeforeLeavingRoute=this.context.history.listenBeforeLeavingRoute(e,this.routerWillLeave)},componentWillUnmount:function(){this._unlistenBeforeLeavingRoute&&this._unlistenBeforeLeavingRoute()}};t.default=l,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=n(192),o=(r(a),n(142)),i=r(o),s=i.default.PropTypes.object,c={propTypes:{route:s.isRequired},childContextTypes:{route:s.isRequired},getChildContext:function(){return{ -route:this.props.route}},componentWillMount:function(){}};t.default=c,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.routes,r=a(t,["routes"]),o=(0,c.default)(e)(r),s=(0,l.default)(o,n);return i({},o,s)}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){var n=e.history,r=e.routes,o=e.location,c=a(e,["history","routes","location"]);n||o||(0,u.default)(!1),n=n||(0,d.default)(c);var l=(0,f.default)(n,(0,h.createRoutes)(r)),p=void 0;o?o=n.createLocation(o):p=n.listen(function(e){o=e});var _=(0,m.createRouterObject)(n,l);n=(0,m.createRoutingHistory)(n,l),l.match(o,function(e,r,a){t(e,r&&_.createLocation(r,s.REPLACE),a&&i({},a,{history:n,router:_,matchContext:{history:n,transitionManager:l,router:_}})),p&&p()})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o=0&&t=0&&_0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,i=t.payload;return n===a?r({},e,{locationBeforeTransitions:i}):e}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},r=n.selectLocationState,s=void 0===r?i:r,c=n.adjustUrlOnReplay,u=void 0===c||c;if(void 0===s(t.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var l=void 0,d=void 0,p=void 0,f=void 0,h=void 0,m=function(e){return s(t.getState()).locationBeforeTransitions||(e?l:void 0)};if(l=m(),u){var _=function(){var t=m(!0);h!==t&&l!==t&&(d=!0,h=t,e.transitionTo(a({},t,{action:"PUSH"})),d=!1)};p=t.subscribe(_),_()}var M=function(e){d||(h=e,!l&&(l=e,m())||t.dispatch({type:o.LOCATION_CHANGE,payload:e}))};return f=e.listen(M),e.getCurrentLocation&&M(e.getCurrentLocation()),a({},e,{listen:function(n){var r=m(!0),a=!1,o=t.subscribe(function(){var e=m(!0);e!==r&&(r=e,a||n(r))});return e.getCurrentLocation||n(r),function(){a=!0,o()}},unsubscribe:function(){u&&p(),f()}})}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t=0&&0===window.sessionStorage.length)return;throw e}}function o(e){var t=void 0;try{t=window.sessionStorage.getItem(r(e))}catch(e){if(e.name===u)return null}if(t)try{return JSON.parse(t)}catch(e){}return null}t.__esModule=!0,t.saveState=a,t.readState=o;var i=n(256),s=(function(e){e&&e.__esModule}(i),"@@History/"),c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],u="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){function t(e){return c.canUseDOM||s.default(!1),n.listen(e)}var n=d.default(o({getUserConfirmation:u.getUserConfirmation},e,{go:u.go}));return o({},n,{listen:t})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t=0&&t=0&&_=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return function(){function t(e){return v&&null==e.basename&&(0===e.pathname.indexOf(v)?(e.pathname=e.pathname.substring(v.length),e.basename=v,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){if(!v)return e;"string"==typeof e&&(e=c.parsePath(e));var t=e.pathname,n="/"===v.slice(-1)?v:v+"/",r="/"===t.charAt(0)?t.slice(1):t;return i({},e,{pathname:n+r})}function r(e){return y.listenBefore(function(n,r){l.default(e,t(n),r)})}function o(e){return y.listen(function(n){e(t(n))})}function u(e){y.push(n(e))}function d(e){y.replace(n(e))}function f(e){return y.createPath(n(e))}function h(e){return y.createHref(n(e))}function m(e){for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;o0&&(p=p.filter(function(t){return t!==e}),0===p.length&&l())}var u=e(t),l=void 0,p=[];return i({},u,{listenBeforeUnload:r,registerBeforeUnloadHook:d.default(o,"registerBeforeUnloadHook is deprecated; use listenBeforeUnload instead"),unregisterBeforeUnloadHook:d.default(s,"unregisterBeforeUnloadHook is deprecated; use the callback returned from listenBeforeUnload instead")})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return u.stringify(e).replace(/%20/g,"+")}function i(e){return function(){function t(e){if(null==e.query){var t=e.search;e.query=A(t.substring(1)),e[m]={search:t,searchBase:""}}return e}function n(e,t){var n,r=e[m],a=t?y(t):"";if(!r&&!a)return e;"string"==typeof e&&(e=p.parsePath(e));var o=void 0;o=r&&e.search===r.search?r.searchBase:e.search||"";var i=o;return a&&(i+=(i?"&":"?")+a),s({},e,(n={search:i},n[m]={search:i,searchBase:o},n))}function r(e){return T.listenBefore(function(n,r){d.default(e,t(n),r)})}function i(e){return T.listen(function(n){e(t(n))})}function c(e){T.push(n(e,e.query))}function u(e){T.replace(n(e,e.query))}function l(e,t){return T.createPath(n(e,t||e.query))}function f(e,t){return T.createHref(n(e,t||e.query))}function M(e){for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;o=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(282),a=n(283);e.exports=function(e){return function(t,n){var o,i,s=String(a(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(i=s.charCodeAt(c+1))<56320||i>57343?e?s.charAt(c):o:e?s.slice(c,c+2):i-56320+(o-55296<<10)+65536)}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";var r=n(285),a=n(286),o=n(301),i=n(291),s=n(302),c=n(303),u=n(304),l=n(320),d=n(322),p=n(321)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,m,_,M,g){u(n,t,m);var v,b,y,A=function(e){if(!f&&e in w)return w[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",T="values"==_,L=!1,w=e.prototype,k=w[p]||w["@@iterator"]||_&&w[_],S=k||A(_),O=_?T?A("entries"):S:void 0,C="Array"==t?w.entries||k:k;if(C&&(y=d(C.call(new e)))!==Object.prototype&&(l(y,E,!0),r||s(y,p)||i(y,p,h)),T&&k&&"values"!==k.name&&(L=!0,S=function(){return k.call(this)}),r&&!g||!f&&!L&&w[p]||i(w,p,S),c[t]=S,c[E]=h,_)if(v={values:T?S:A("values"),keys:M?S:A("keys"),entries:O},g)for(b in v)b in w||o(w,b,v[b]);else a(a.P+a.F*(f||L),t,v);return v}},function(e,t){e.exports=!0},function(e,t,n){var r=n(287),a=n(288),o=n(289),i=n(291),s=function(e,t,n){var c,u,l,d=e&s.F,p=e&s.G,f=e&s.S,h=e&s.P,m=e&s.B,_=e&s.W,M=p?a:a[t]||(a[t]={}),g=M.prototype,v=p?r:f?r[t]:(r[t]||{}).prototype;p&&(n=t);for(c in n)(u=!d&&v&&void 0!==v[c])&&c in M||(l=u?v[c]:n[c],M[c]=p&&"function"!=typeof v[c]?n[c]:m&&u?o(l,r):_&&v[c]==l?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):h&&"function"==typeof l?o(Function.call,l):l,h&&((M.virtual||(M.virtual={}))[c]=l,e&s.R&&g&&!g[c]&&i(g,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(290);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(292),a=n(300);e.exports=n(296)?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(293),a=n(295),o=n(299),i=Object.defineProperty;t.f=n(296)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),a)try{return i(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(294);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(296)&&!n(297)(function(){return 7!=Object.defineProperty(n(298)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){e.exports=!n(297)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(294),a=n(287).document,o=r(a)&&r(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},function(e,t,n){var r=n(294);e.exports=function(e,t){if(!r(e))return e;var n,a;if(t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;if("function"==typeof(n=e.valueOf)&&!r(a=n.call(e)))return a;if(!t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){e.exports=n(291)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(305),a=n(300),o=n(320),i={};n(291)(i,n(321)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(i,{next:a(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(293),a=n(306),o=n(318),i=n(315)("IE_PROTO"),s=function(){},c=function(){var e,t=n(298)("iframe"),r=o.length;for(t.style.display="none",n(319).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(" + + + + + + + + + + + + + + + + + + + + + + + + + + + + ' ), + index = 0, + named, + fields = '', + field; + + if ( ! shortcode.content ) { + shortcode.content = grunionEditorView.default_form; + } + + // Render the fields. + while ( ( field = wp.shortcode.next( 'contact-field', shortcode.content, index ) ) ) { + index = field.index + field.content.length; + named = field.shortcode.attrs.named; + if ( named.options && 'string' === typeof named.options ) { + named.options = named.options.split( ',' ); + } + fields += this.edit_template( named ); + } + + $editframe.on( 'checkheight', function() { + var innerDoc = ( this.contentDocument ) ? this.contentDocument : this.contentWindow.document; + this.style.height = '10px'; + this.style.height = ( 5 + innerDoc.body.scrollHeight ) + 'px'; + tinyMCE.activeEditor.execCommand( 'wpAutoResize' ); + } ); + + $editframe.on( 'load', function() { + var stylesheet_url = ( 1 === window.isRtl ) ? grunionEditorView.inline_editing_style_rtl : grunionEditorView.inline_editing_style, + $stylesheet = $( '' ), + $dashicons_css = $( '' ); + + $stylesheet.on( 'load', function() { + $editframe.contents().find( 'body' ).css( 'visibility', 'visible' ); + $editframe.trigger( 'checkheight' ); + } ); + $editframe.contents().find( 'head' ).append( $stylesheet ).append( $dashicons_css ); + + $editframe.contents().find( 'body' ).html( wp.mce.grunion_wp_view_renderer.editor_inline( { + to : shortcode.attrs.named.to, + subject : shortcode.attrs.named.subject, + fields : fields + } ) ).css( 'visibility', 'hidden' ); + + $editframe.contents().find( 'input:first' ).focus(); + + setTimeout( function(){ + $editframe.trigger( 'checkheight' ); + }, 250 ); + + var $editfields = $editframe.contents().find( '.grunion-fields' ), + $buttons = $editframe.contents().find( '.grunion-controls' ); + + $editfields.sortable(); + + // Now, add all the listeners! + + $editfields.on( 'change select', 'select[name=type]', function() { + $( this ).closest( '.grunion-field-edit' )[ 0 ].className = + 'card is-compact grunion-field-edit grunion-field-' + $( this ).val(); + $editframe.trigger( 'checkheight' ); + } ); + + $editfields.on( 'click', '.delete-option', function( e ) { + e.preventDefault(); + $( this ).closest( 'li' ).remove(); + $editframe.trigger( 'checkheight' ); + } ); + + $editfields.on( 'click', '.add-option', function( e ) { + var $new_option = $( wp.mce.grunion_wp_view_renderer.editor_option() ); + e.preventDefault(); + $( this ).closest( 'li' ).before( $new_option ); + $editframe.trigger( 'checkheight' ); + $new_option.find( 'input:first' ).focus(); + } ); + + $editfields.on( 'click', '.delete-field', function( e ) { + e.preventDefault(); + $( this ).closest( '.card' ).remove(); + $editframe.trigger( 'checkheight' ); + } ); + + $buttons.find( 'input[name=submit]' ).on( 'click', function(){ + var new_data = shortcode; + + new_data.type = 'closed'; + new_data.attrs = {}; + new_data.content = ''; + + $editfields.children().each( function() { + var field_shortcode = { + tag : 'contact-field', + type : 'single', + attrs : { + label : $( this ).find( 'input[name=label]' ).val(), + type : $( this ).find( 'select[name=type]' ).val() + } + }, + options = []; + + if ( $( this ).find( 'input[name=required]:checked' ).length ) { + field_shortcode.attrs.required = '1'; + } + + $( this ).find( 'input[name=option]' ).each( function() { + if ( $( this ).val() ) { + options.push( $( this ).val() ); + } + } ); + if ( options.length ) { + field_shortcode.attrs.options = options.join( ',' ); + } + + new_data.content += wp.shortcode.string( field_shortcode ); + } ); + + if ( $editframe.contents().find( 'input[name=to]' ).val() ) { + new_data.attrs.to = $editframe.contents().find( 'input[name=to]' ).val(); + } + if ( $editframe.contents().find( 'input[name=subject]' ).val() ) { + new_data.attrs.subject = $editframe.contents().find( 'input[name=subject]' ).val(); + } + + update_callback( wp.shortcode.string( new_data ) ); + } ); + + $buttons.find( 'input[name=cancel]' ).on( 'click', function() { + update_callback( wp.shortcode.string( shortcode ) ); + } ); + + $buttons.find( 'input[name=add-field]' ).on( 'click', function() { + var $new_field = $( wp.mce.grunion_wp_view_renderer.edit_template( {} ) ); + $editfields.append( $new_field ); + $editfields.sortable( 'refresh' ); + $editframe.trigger( 'checkheight' ); + $new_field.find( 'input:first' ).focus(); + } ); + } ); + + $view.html( $editframe ); + } + }; + wp.mce.views.register( 'contact-form', wp.mce.grunion_wp_view_renderer ); + + // Add the 'text' editor button. + QTags.addButton( + 'grunion_shortcode', + grunionEditorView.labels.quicktags_label, + function() { + QTags.insertContent( '[contact-form]' + grunionEditorView.default_form + '[/contact-form]' ); + } + ); + + var $wp_content_wrap = $( '#wp-content-wrap' ); + $( '#insert-jetpack-contact-form' ).on( 'click', function( e ) { + e.preventDefault(); + if ( $wp_content_wrap.hasClass( 'tmce-active' ) ) { + tinyMCE.execCommand( 'grunion_add_form' ); + } else if ( $wp_content_wrap.hasClass( 'html-active' ) ) { + QTags.insertContent( '[contact-form]' + grunionEditorView.default_form + '[/contact-form]' ); + } else { + window.console.error( 'Neither TinyMCE nor QuickTags is active. Unable to insert form.' ); + } + } ); +}( jQuery, wp, grunionEditorView ) ); diff --git a/plugins/jetpack/modules/contact-form/js/tinymce-plugin-form-button.js b/plugins/jetpack/modules/contact-form/js/tinymce-plugin-form-button.js new file mode 100644 index 00000000..9825c1b4 --- /dev/null +++ b/plugins/jetpack/modules/contact-form/js/tinymce-plugin-form-button.js @@ -0,0 +1,34 @@ +/* global grunionEditorView, tinymce */ +(function() { + tinymce.create( 'tinymce.plugins.grunion_form', { + + init : function( editor ) { + editor.addButton( 'grunion', { + title : grunionEditorView.labels.tinymce_label, + cmd : 'grunion_add_form', + icon : 'grunion' + }); + editor.addCommand('grunion_add_form', function() { + if ( grunionEditorView.default_form ) { + editor.execCommand( 'mceInsertContent', 0, '[contact-form]' + grunionEditorView.default_form + '[/contact-form]' ); + } else { + editor.execCommand( 'mceInsertContent', 0, '[contact-form /]' ); + } + }); + }, + + createControl : function() { + return null; + }, + + getInfo : function() { + return { + longname : 'Grunion Contact Form', + author : 'Automattic', + version : '1' + }; + } + }); + + tinymce.PluginManager.add( 'grunion_form', tinymce.plugins.grunion_form ); +})(); \ No newline at end of file diff --git a/plugins/jetpack/modules/likes.php b/plugins/jetpack/modules/likes.php index 52faccca..a3e67c45 100644 --- a/plugins/jetpack/modules/likes.php +++ b/plugins/jetpack/modules/likes.php @@ -19,9 +19,10 @@ Jetpack::dns_prefetch( array( '//2.gravatar.com', ) ); -class Jetpack_Likes { - public $version = '20160429'; +include_once dirname( __FILE__ ) . '/likes/jetpack-likes-master-iframe.php'; +include_once dirname( __FILE__ ) . '/likes/jetpack-likes-settings.php'; +class Jetpack_Likes { public static function init() { static $instance = NULL; @@ -34,6 +35,7 @@ class Jetpack_Likes { function __construct() { $this->in_jetpack = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? false : true; + $this->settings = new Jetpack_Likes_Settings(); add_action( 'init', array( &$this, 'action_init' ) ); add_action( 'admin_init', array( $this, 'admin_init' ) ); @@ -45,34 +47,36 @@ class Jetpack_Likes { Jetpack::enable_module_configurable( __FILE__ ); Jetpack::module_configuration_load( __FILE__, array( $this, 'configuration_redirect' ) ); - add_action('admin_print_scripts-settings_page_sharing', array( &$this, 'load_jp_css' ) ); + add_action( 'admin_print_scripts-settings_page_sharing', array( &$this, 'load_jp_css' ) ); add_filter( 'sharing_show_buttons_on_row_start', array( $this, 'configuration_target_area' ) ); $active = Jetpack::get_active_modules(); if ( ! in_array( 'sharedaddy', $active ) && ! in_array( 'publicize', $active ) ) { - add_action( 'admin_menu', array( $this, 'sharing_menu' ) ); // we don't have a sharing page yet + // we don't have a sharing page yet + add_action( 'admin_menu', array( $this->settings, 'sharing_menu' ) ); } if ( in_array( 'publicize', $active ) && ! in_array( 'sharedaddy', $active ) ) { - add_action( 'pre_admin_screen_sharing', array( $this, 'sharing_block' ), 20 ); // we have a sharing page but not the global options area - add_action( 'pre_admin_screen_sharing', array( $this, 'updated_message' ), -10 ); + // we have a sharing page but not the global options area + add_action( 'pre_admin_screen_sharing', array( $this->settings, 'sharing_block' ), 20 ); + add_action( 'pre_admin_screen_sharing', array( $this->settings, 'updated_message' ), -10 ); } if( ! in_array( 'sharedaddy', $active ) ) { - add_action( 'admin_init', array( $this, 'process_update_requests_if_sharedaddy_not_loaded' ) ); - add_action( 'sharing_global_options', array( $this, 'admin_settings_showbuttonon_init' ), 19 ); - add_action( 'sharing_admin_update', array( $this, 'admin_settings_showbuttonon_callback' ), 19 ); - add_action( 'admin_init', array( $this, 'add_meta_box' ) ); + add_action( 'admin_init', array( $this->settings, 'process_update_requests_if_sharedaddy_not_loaded' ) ); + add_action( 'sharing_global_options', array( $this->settings, 'admin_settings_showbuttonon_init' ), 19 ); + add_action( 'sharing_admin_update', array( $this->settings, 'admin_settings_showbuttonon_callback' ), 19 ); + add_action( 'admin_init', array( $this->settings, 'add_meta_box' ) ); } else { - add_filter( 'sharing_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) ); - add_action( 'start_sharing_meta_box_content', array( $this, 'meta_box_content' ) ); + add_filter( 'sharing_meta_box_title', array( $this->settings, 'add_likes_to_sharing_meta_box_title' ) ); + add_action( 'start_sharing_meta_box_content', array( $this->settings, 'meta_box_content' ) ); } } else { // wpcom add_action( 'wpmu_new_blog', array( $this, 'enable_comment_likes' ), 10, 1 ); - add_action( 'admin_init', array( $this, 'add_meta_box' ) ); - add_action( 'end_likes_meta_box_content', array( $this, 'sharing_meta_box_content' ) ); - add_filter( 'likes_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) ); + add_action( 'admin_init', array( $this->settings, 'add_meta_box' ) ); + add_action( 'end_likes_meta_box_content', array( $this->settings, 'sharing_meta_box_content' ) ); + add_filter( 'likes_meta_box_title', array( $this->settings, 'add_likes_to_sharing_meta_box_title' ) ); } add_action( 'admin_init', array( $this, 'admin_discussion_likes_settings_init' ) ); // Likes notifications @@ -81,10 +85,10 @@ class Jetpack_Likes { add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_register_scripts' ) ); - add_action( 'save_post', array( $this, 'meta_box_save' ) ); - add_action( 'edit_attachment', array( $this, 'meta_box_save' ) ); - add_action( 'sharing_global_options', array( $this, 'admin_settings_init' ), 20 ); - add_action( 'sharing_admin_update', array( $this, 'admin_settings_callback' ), 20 ); + add_action( 'save_post', array( $this->settings, 'meta_box_save' ) ); + add_action( 'edit_attachment', array( $this->settings, 'meta_box_save' ) ); + add_action( 'sharing_global_options', array( $this->settings, 'admin_settings_init' ), 20 ); + add_action( 'sharing_admin_update', array( $this->settings, 'admin_settings_callback' ), 20 ); } /** @@ -131,7 +135,10 @@ class Jetpack_Likes { */ function load_styles_register_scripts() { if ( $this->in_jetpack ) { - wp_enqueue_style( 'jetpack_likes', plugins_url( 'likes/style.css', __FILE__ ), array(), JETPACK__VERSION ); + if ( ! wp_style_is( 'open-sans', 'registered' ) ) { + wp_register_style( 'open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans', array(), JETPACK__VERSION ); + } + wp_enqueue_style( 'jetpack_likes', plugins_url( 'likes/style.css', __FILE__ ), array( 'open-sans' ), JETPACK__VERSION ); $this->register_scripts(); } } @@ -146,126 +153,6 @@ class Jetpack_Likes { return $html; } - /** - * Replaces the "Sharing" title for the post screen metabox with "Likes and Shares" - */ - function add_likes_to_sharing_meta_box_title() { - return __( 'Likes and Shares', 'jetpack' ); - } - - /** - * Adds a metabox to the post screen if the sharing one doesn't currently exist. - */ - function add_meta_box() { - if ( - /** - * Allow disabling of the Likes metabox on the post editor screen. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool false Should the Likes metabox be disabled? Default to false. - */ - apply_filters( 'post_flair_disable', false ) - ) { - return; - } - - $post_types = get_post_types( array( 'public' => true ) ); - /** - * Filters the Likes metabox title. - * - * @module likes - * - * @since 2.2.0 - * - * @param string Likes metabox title. Default to "Likes". - */ - $title = apply_filters( 'likes_meta_box_title', __( 'Likes', 'jetpack' ) ); - foreach( $post_types as $post_type ) { - add_meta_box( 'likes_meta', $title, array( $this, 'meta_box_content' ), $post_type, 'advanced', 'high' ); - } - } - - function meta_box_save( $post_id ) { - if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) - return $post_id; - - if ( empty( $_POST['wpl_like_status_hidden'] ) ) - return $post_id; - - // Record sharing disable. Only needs to be done for WPCOM - if ( ! $this->in_jetpack ) { - if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], get_post_types( array( 'public' => true ) ) ) ) { - if ( ! isset( $_POST['wpl_enable_post_sharing'] ) ) { - update_post_meta( $post_id, 'sharing_disabled', 1 ); - } else { - delete_post_meta( $post_id, 'sharing_disabled' ); - } - } - } - - if ( 'post' == $_POST['post_type'] ) { - if ( !current_user_can( 'edit_post', $post_id ) ) { - return $post_id; - } - } - - // Record a change in like status for this post - only if it contradicts the - // site like setting. - if ( ( $this->is_enabled_sitewide() && empty( $_POST['wpl_enable_post_likes'] ) ) || ( ! $this->is_enabled_sitewide() && !empty( $_POST['wpl_enable_post_likes'] ) ) ) { - update_post_meta( $post_id, 'switch_like_status', 1 ); - } else { - delete_post_meta( $post_id, 'switch_like_status' ); - } - - return $post_id; - } - - /** - * Shows the likes option in the post screen metabox. - */ - function meta_box_content( $post ) { - $post_id = ! empty( $post->ID ) ? (int) $post->ID : get_the_ID(); - $checked = true; - $disabled = ! $this->is_enabled_sitewide(); - $switched_status = get_post_meta( $post_id, 'switch_like_status', true ); - - if ( $disabled && empty( $switched_status ) || false == $disabled && !empty( $switched_status ) ) - $checked = false; - - /** - * Fires before the Likes meta box content in the post editor. - * - * @module likes - * - * @since 2.2.0 - * - * @param WP_Post|array|null $post Post data. - */ - do_action( 'start_likes_meta_box_content', $post ); - ?> - -

- - -

- - - - - -
- -
-
- -
- - - in_jetpack ) : ?> - - - - - -
- -
-
- -
- - - - - - - -
- -
- - - - - - ' ); - ?> - - - true ) ) ); - array_unshift( $shows, 'index' ); - $global = $this->get_options(); - foreach ( $shows as $show ) : - if ( 'index' == $show ) { - $label = __( 'Front Page, Archive Pages, and Search Results', 'jetpack' ); - } else { - $post_type_object = get_post_type_object( $show ); - $label = $post_type_object->labels->name; - } - ?> - '; ?> - - - ' ); - ?> - true ) ) ); - $shows[] = 'index'; - $data = $_POST; - - if ( isset( $data['show'] ) ) { - if ( is_scalar( $data['show'] ) ) { - switch ( $data['show'] ) { - case 'posts' : - $data['show'] = array( 'post', 'page' ); - break; - case 'index' : - $data['show'] = array( 'index' ); - break; - case 'posts-index' : - $data['show'] = array( 'post', 'page', 'index' ); - break; - } - } - - if ( $data['show'] = array_intersect( $data['show'], $shows ) ) { - $options['global']['show'] = $data['show']; - } - } else { - $options['global']['show'] = array(); - } - - update_option( 'sharing-options', $options ); - } - - /** - * Adds the admin update hook so we can save settings even if Sharedaddy is not enabled. - */ - function process_update_requests_if_sharedaddy_not_loaded() { - if ( isset( $_GET['page'] ) && ( $_GET['page'] == 'sharing.php' || $_GET['page'] == 'sharing' ) ) { - if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'sharing-options' ) ) { - /** This action is documented in modules/sharedaddy/sharing.php */ - do_action( 'sharing_admin_update' ); - wp_safe_redirect( admin_url( 'options-general.php?page=sharing&update=saved' ) ); - die(); - } - } - } - - /** - * Saves the setting in the database, bumps a stat on WordPress.com - */ - function admin_settings_callback() { - // We're looking for these, and doing a dance to set some stats and save - // them together in array option. - $new_state = !empty( $_POST['wpl_default'] ) ? $_POST['wpl_default'] : 'on'; - $db_state = $this->is_enabled_sitewide(); - - $reblogs_new_state = !empty( $_POST['jetpack_reblogs_enabled'] ) ? $_POST['jetpack_reblogs_enabled'] : 'on'; - $reblogs_db_state = $this->reblogs_enabled_sitewide(); - /** Default State *********************************************************/ - - // Checked (enabled) - switch( $new_state ) { - case 'off' : - if ( true == $db_state && ! $this->in_jetpack ) { - $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_likes=disabled_likes' ); - } - update_option( 'disabled_likes', 1 ); - break; - case 'on' : - default: - if ( false == $db_state && ! $this->in_jetpack ) { - $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_likes=reenabled_likes' ); - } - delete_option( 'disabled_likes' ); - break; - } - - switch( $reblogs_new_state ) { - case 'off' : - if ( true == $reblogs_db_state && ! $this->in_jetpack ) { - $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_reblogs=disabled_reblogs' ); - } - update_option( 'disabled_reblogs', 1 ); - break; - case 'on' : - default: - if ( false == $reblogs_db_state && ! $this->in_jetpack ) { - $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_reblogs=reenabled_reblogs' ); - } - delete_option( 'disabled_reblogs' ); - break; - } - - // comment setting - $new_comments_state = !empty( $_POST['jetpack_comment_likes_enabled'] ) ? $_POST['jetpack_comment_likes_enabled'] : false; - switch( (bool) $new_comments_state ) { - case true: - update_option( 'jetpack_comment_likes_enabled', 1 ); - break; - case false: - default: - update_option( 'jetpack_comment_likes_enabled', 0 ); - break; - } - } - - /** - * Force comment likes on for a blog - * Used when a new blog is created - */ - function enable_comment_likes( $blog_id ) { - switch_to_blog( $blog_id ); - update_option( 'jetpack_comment_likes_enabled', 1 ); - restore_current_blog(); - } - - /** - * Adds the 'sharing' menu to the settings menu. - * Only ran if sharedaddy and publicize are not already active. - */ - function sharing_menu() { - add_submenu_page( 'options-general.php', esc_html__( 'Sharing Settings', 'jetpack' ), esc_html__( 'Sharing', 'jetpack' ), 'manage_options', 'sharing', array( $this, 'sharing_page' ) ); - } - - /** - * Provides a sharing page with the sharing_global_options hook - * so we can display the setting. - * Only ran if sharedaddy and publicize are not already active. - */ - function sharing_page() { - $this->updated_message(); ?> -
-

-

- - sharing_block(); ?> -

' . esc_html__( 'Settings have been saved', 'jetpack' ) . '

'; - } - - /** - * Returns just the "sharing buttons" w/ like option block, so it can be inserted into different sharing page contexts - */ - function sharing_block() { ?> -

-
- - - - -
- -

- -

- - -
in_jetpack ) { add_filter( 'the_content', array( &$this, 'post_likes' ), 30, 1 ); add_filter( 'the_excerpt', array( &$this, 'post_likes' ), 30, 1 ); @@ -644,9 +258,8 @@ class Jetpack_Likes { add_filter( 'post_flair_block_css', array( $this, 'post_flair_service_enabled_like' ) ); wp_enqueue_script( 'postmessage', '/wp-content/js/postmessage.js', array( 'jquery' ), JETPACK__VERSION, false ); - wp_enqueue_script( 'jquery_inview', '/wp-content/js/jquery/jquery.inview.js', array( 'jquery' ), JETPACK__VERSION, false ); wp_enqueue_script( 'jetpack_resize', '/wp-content/js/jquery/jquery.jetpack-resize.js', array( 'jquery' ), JETPACK__VERSION, false ); - wp_enqueue_script( 'jetpack_likes_queuehandler', plugins_url( 'queuehandler.js' , __FILE__ ), array( 'jquery', 'postmessage', 'jetpack_resize', 'jquery_inview' ), JETPACK__VERSION, true ); + wp_enqueue_script( 'jetpack_likes_queuehandler', plugins_url( 'queuehandler.js' , __FILE__ ), array( 'jquery', 'postmessage', 'jetpack_resize' ), JETPACK__VERSION, true ); wp_enqueue_style( 'jetpack_likes', plugins_url( 'jetpack-likes.css', __FILE__ ), array(), JETPACK__VERSION ); } } @@ -656,9 +269,8 @@ class Jetpack_Likes { */ function register_scripts() { wp_register_script( 'postmessage', plugins_url( '_inc/postmessage.js', dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false ); - wp_register_script( 'jquery_inview', plugins_url( '_inc/jquery.inview.js', dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false ); wp_register_script( 'jetpack_resize', plugins_url( '_inc/jquery.jetpack-resize.js' , dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false ); - wp_register_script( 'jetpack_likes_queuehandler', plugins_url( 'likes/queuehandler.js' , __FILE__ ), array( 'jquery', 'postmessage', 'jetpack_resize', 'jquery_inview' ), JETPACK__VERSION, true ); + wp_register_script( 'jetpack_likes_queuehandler', plugins_url( 'likes/queuehandler.js' , __FILE__ ), array( 'jquery', 'postmessage', 'jetpack_resize' ), JETPACK__VERSION, true ); } /** @@ -762,7 +374,7 @@ class Jetpack_Likes { function post_likes( $content ) { $post_id = get_the_ID(); - if ( ! is_numeric( $post_id ) || ! $this->is_likes_visible() ) + if ( ! is_numeric( $post_id ) || ! $this->settings->is_likes_visible() ) return $content; if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { @@ -776,7 +388,7 @@ class Jetpack_Likes { $domain = $url_parts['host']; } // make sure to include the scripts before the iframe otherwise weird things happen - add_action( 'wp_footer', array( $this, 'likes_master' ), 21 ); + add_action( 'wp_footer', 'jetpack_likes_master_iframe', 21 ); /** * if the same post appears more then once on a page the page goes crazy @@ -784,7 +396,7 @@ class Jetpack_Likes { */ $uniqid = uniqid(); - $src = sprintf( '//widgets.wp.com/likes/#blog_id=%1$d&post_id=%2$d&origin=%3$s&obj_id=%1$d-%2$d-%4$s', $blog_id, $post_id, $domain, $uniqid ); + $src = sprintf( 'https://widgets.wp.com/likes/#blog_id=%1$d&post_id=%2$d&origin=%3$s&obj_id=%1$d-%2$d-%4$s', $blog_id, $post_id, $domain, $uniqid ); $name = sprintf( 'like-post-frame-%1$d-%2$d-%3$s', $blog_id, $post_id, $uniqid ); $wrapper = sprintf( 'like-post-wrapper-%1$d-%2$d-%3$s', $blog_id, $post_id, $uniqid ); $headline = sprintf( @@ -805,43 +417,36 @@ class Jetpack_Likes { return $content . $html; } - function comment_likes( $content, $comment = null ) { - if ( empty( $comment ) ) - return $content; + function post_flair_service_enabled_like( $classes ) { + $classes[] = 'sd-like-enabled'; + return $classes; + } - if ( ! $this->is_comments_enabled() ) - return $content; + function is_admin_bar_button_visible() { + global $wp_admin_bar; - $protocol = 'http'; - if ( is_ssl() ) - $protocol = 'https'; + if ( ! is_object( $wp_admin_bar ) ) + return false; - if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { - $blog_id = get_current_blog_id(); - $bloginfo = get_blog_details( (int) $blog_id ); - $domain = $bloginfo->domain; - } else { - $blog_id = Jetpack_Options::get_option( 'id' ); - $url = home_url(); - $url_parts = parse_url( $url ); - $domain = $url_parts['host']; - } - // make sure to include the scripts before the iframe otherwise weird things happen - add_action( 'wp_footer', array( $this, 'likes_master' ), 21 ); + if ( ( ! is_singular( 'post' ) && ! is_attachment() && ! is_page() ) ) + return false; - $src = sprintf( '%1$s://widgets.wp.com/likes/#blog_id=%2$d&comment_id=%3$d&origin=%1$s://%4$s', $protocol, $blog_id, $comment->comment_ID, $domain ); - $name = sprintf( 'like-comment-frame-%1$d-%2$d', $blog_id, $comment->comment_ID ); - $wrapper = sprintf( 'like-comment-wrapper-%1$d-%2$d', $blog_id, $comment->comment_ID ); + if ( ! $this->settings->is_likes_visible() ) + return false; - $html = "
"; - $html .= ""; - $html .= '
'; - return $content . $html; - } + if ( ! $this->settings->is_post_likeable() ) + return false; - function post_flair_service_enabled_like( $classes ) { - $classes[] = 'sd-like-enabled'; - return $classes; + /** + * Filters whether the Like button is enabled in the admin bar. + * + * @module likes + * + * @since 2.2.0 + * + * @param bool true Should the Like button be visible in the Admin bar. Default to true. + */ + return (bool) apply_filters( 'jetpack_admin_bar_likes_enabled', true ); } function admin_bar_likes() { @@ -868,9 +473,9 @@ class Jetpack_Likes { $domain = $url_parts['host']; } // make sure to include the scripts before the iframe otherwise weird things happen - add_action( 'wp_footer', array( $this, 'likes_master' ), 21 ); + add_action( 'wp_footer', 'jetpack_likes_master_iframe', 21 ); - $src = sprintf( '%1$s://widgets.wp.com/likes/#blog_id=%2$d&post_id=%3$d&origin=%1$s://%4$s', $protocol, $blog_id, $post_id, $domain ); + $src = sprintf( 'https://widgets.wp.com/likes/#blog_id=%2$d&post_id=%3$d&origin=%1$s://%4$s', $protocol, $blog_id, $post_id, $domain ); $html = ""; @@ -883,371 +488,6 @@ class Jetpack_Likes { $wp_admin_bar->add_node( $node ); } - - /** - * This function needs to get loaded after the scripts get added to the page. - * - */ - function likes_master() { - $protocol = 'http'; - if ( is_ssl() ) - $protocol = 'https'; - - $_locale = get_locale(); - - // We have to account for w.org vs WP.com locale divergence - if ( $this->in_jetpack ) { - if ( ! defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) || ! file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) { - return false; - } - - require_once JETPACK__GLOTPRESS_LOCALES_PATH; - - $gp_locale = GP_Locales::by_field( 'wp_locale', $_locale ); - $_locale = isset( $gp_locale->slug ) ? $gp_locale->slug : ''; - } - - $likes_locale = ( '' == $_locale || 'en' == $_locale ) ? '' : '&lang=' . strtolower( $_locale ); - - $src = sprintf( - '%1$s://widgets.wp.com/likes/master.html?ver=%2$s#ver=%2$s%3$s', - $protocol, - $this->version, - $likes_locale - ); - - /* translators: The value of %d is not available at the time of output */ - $likersText = wp_kses( __( '%d bloggers like this:', 'jetpack' ), array( 'span' => array() ) ); - ?> - -
    - is_post_likeable(); - } else { - // Otherwise, check and see if likes are enabled sitewide - $enabled = $this->is_enabled_sitewide(); - } - - if ( post_password_required() ) - $enabled = false; - - if ( in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) { - $enabled = false; - } - - // Sharing Setting Overrides **************************************** - - // Single post including custom post types - if ( is_single() ) { - if ( ! $this->is_single_post_enabled( $post->post_type ) ) { - $enabled = false; - } - - // Single page - } elseif ( is_page() && ! is_front_page() ) { - if ( ! $this->is_single_page_enabled() ) { - $enabled = false; - } - - // Attachment - } elseif ( is_attachment() ) { - if ( ! $this->is_attachment_enabled() ) { - $enabled = false; - } - - // All other loops - } elseif ( ! $this->is_index_enabled() ) { - $enabled = false; - } - } - - if ( $post instanceof WP_Post ) { - // Check that the post is a public, published post. - if ( 'attachment' == $post->post_type ) { - $post_status = get_post_status( $post->post_parent ); - } else { - $post_status = $post->post_status; - } - if ( 'publish' != $post_status ) { - $enabled = false; - } - } - - // Run through the sharing filters - /** This filter is documented in modules/sharedaddy/sharing-service.php */ - $enabled = apply_filters( 'sharing_show', $enabled, $post ); - - /** - * Filters whether the Likes should be visible or not. - * Allows overwriting the options set in Settings > Sharing. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool $enabled Should the Likes be visible? - */ - return (bool) apply_filters( 'wpl_is_likes_visible', $enabled ); - } - - /** - * Returns the current state of the "WordPress.com Likes are" option. - * @return boolean true if enabled sitewide, false if not - */ - function is_enabled_sitewide() { - /** - * Filters whether Likes are enabled by default on all posts. - * true if enabled sitewide, false if not. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool $option Are Likes enabled sitewide. - */ - return (bool) apply_filters( 'wpl_is_enabled_sitewide', ! Jetpack_Options::get_option_and_ensure_autoload( 'disabled_likes', 0 ) ); - } - - /** - * Returns the current state of the "WordPress.com Reblogs are" option. - * @return boolean true if enabled sitewide, false if not - */ - function reblogs_enabled_sitewide() { - /** - * Filters whether Reblogs are enabled by default on all posts. - * true if enabled sitewide, false if not. - * - * @module likes - * - * @since 3.0.0 - * - * @param bool $option Are Reblogs enabled sitewide. - */ - return (bool) apply_filters( 'wpl_reblogging_enabled_sitewide', ! get_option( 'disabled_reblogs' ) ); - } - - /** - * Returns if comment likes are enabled. Defaults to 'off' - * @return boolean true if we should show comment likes, false if not - */ - function is_comments_enabled() { - /** - * Filters whether Comment Likes are enabled. - * true if enabled, false if not. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool $option Are Comment Likes enabled sitewide. - */ - return (bool) apply_filters( 'jetpack_comment_likes_enabled', get_option( 'jetpack_comment_likes_enabled', false ) ); - } - - function is_admin_bar_button_visible() { - global $wp_admin_bar; - - if ( ! is_object( $wp_admin_bar ) ) - return false; - - if ( ( ! is_singular( 'post' ) && ! is_attachment() && ! is_page() ) ) - return false; - - if ( ! $this->is_likes_visible() ) - return false; - - if ( ! $this->is_post_likeable() ) - return false; - - /** - * Filters whether the Like button is enabled in the admin bar. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool true Should the Like button be visible in the Admin bar. Default to true. - */ - return (bool) apply_filters( 'jetpack_admin_bar_likes_enabled', true ); - } - - /** - * Are likes enabled for this post? - * - * @param int $post_id - * @retun bool - */ - function is_post_likeable( $post_id = 0 ) { - $post = get_post( $post_id ); - if ( !$post || is_wp_error( $post ) ) { - return false; - } - - $sitewide_likes_enabled = (bool) Jetpack_Likes::is_enabled_sitewide(); - $post_likes_switched = (bool) get_post_meta( $post->ID, 'switch_like_status', true ); - - $post_likes_enabled = $sitewide_likes_enabled; - if ( $post_likes_switched ) { - $post_likes_enabled = ! $post_likes_enabled; - } - - return $post_likes_enabled; - } - - /** - * Are Post Likes enabled on archive/front/search pages? - * - * @return bool - */ - function is_index_enabled() { - $options = $this->get_options(); - /** - * Filters whether Likes should be enabled on archive/front/search pages. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool $enabled Are Post Likes enabled on archive/front/search pages? - */ - return (bool) apply_filters( 'wpl_is_index_disabled', (bool) in_array( 'index', $options['show'] ) ); - } - - /** - * Are Post Likes enabled on single posts? - * - * @param String $post_type custom post type identifier - * @return bool - */ - function is_single_post_enabled( $post_type = 'post' ) { - $options = $this->get_options(); - return (bool) apply_filters( - /** - * Filters whether Likes should be enabled on single posts. - * - * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool $enabled Are Post Likes enabled on single posts? - */ - "wpl_is_single_{$post_type}_disabled", - (bool) in_array( $post_type, $options['show'] ) - ); - } - - /** - * Are Post Likes enabled on single pages? - * - * @return bool - */ - function is_single_page_enabled() { - $options = $this->get_options(); - /** - * Filters whether Likes should be enabled on single pages. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool $enabled Are Post Likes enabled on single pages? - */ - return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) ); - } - - /** - * Are Media Likes enabled on single pages? - * - * @return bool - */ - function is_attachment_enabled() { - $options = $this->get_options(); - /** - * Filters whether Likes should be enabled on attachment pages. - * - * @module likes - * - * @since 2.2.0 - * - * @param bool $enabled Are Post Likes enabled on attachment pages? - */ - return (bool) apply_filters( 'wpl_is_attachment_disabled', (bool) in_array( 'attachment', $options['show'] ) ); - } } Jetpack_Likes::init(); diff --git a/plugins/jetpack/modules/likes/jetpack-likes-master-iframe.php b/plugins/jetpack/modules/likes/jetpack-likes-master-iframe.php new file mode 100644 index 00000000..ffb68741 --- /dev/null +++ b/plugins/jetpack/modules/likes/jetpack-likes-master-iframe.php @@ -0,0 +1,38 @@ +slug ) ? $gp_locale->slug : ''; + } + + $likes_locale = ( '' == $_locale || 'en' == $_locale ) ? '' : '&lang=' . strtolower( $_locale ); + + $src = sprintf( + 'https://widgets.wp.com/likes/master.html?ver=%1$s#ver=%1$s%2$s', + $version, + $likes_locale + ); + + /* translators: The value of %d is not available at the time of output */ + $likersText = wp_kses( __( '%d bloggers like this:', 'jetpack' ), array( 'span' => array() ) ); + ?> + +
      + in_jetpack = ! ( defined( 'IS_WPCOM' ) && IS_WPCOM ); + } + + /** + * Replaces the "Sharing" title for the post screen metabox with "Likes and Shares" + */ + public function add_likes_to_sharing_meta_box_title() { + return __( 'Likes and Shares', 'jetpack' ); + } + + /** + * Adds a metabox to the post screen if the sharing one doesn't currently exist. + */ + public function add_meta_box() { + if ( + /** + * Allow disabling of the Likes metabox on the post editor screen. + * + * @module likes + * + * @since 2.2.0 + * + * @param bool false Should the Likes metabox be disabled? Default to false. + */ + apply_filters( 'post_flair_disable', false ) + ) { + return; + } + + $post_types = get_post_types( array( 'public' => true ) ); + /** + * Filters the Likes metabox title. + * + * @module likes + * + * @since 2.2.0 + * + * @param string Likes metabox title. Default to "Likes". + */ + $title = apply_filters( 'likes_meta_box_title', __( 'Likes', 'jetpack' ) ); + foreach( $post_types as $post_type ) { + add_meta_box( 'likes_meta', $title, array( $this, 'meta_box_content' ), $post_type, 'advanced', 'high' ); + } + } + + /** + * Shows the likes option in the post screen metabox. + */ + public function meta_box_content( $post ) { + $post_id = ! empty( $post->ID ) ? (int) $post->ID : get_the_ID(); + $checked = true; + $disabled = ! $this->is_enabled_sitewide(); + $switched_status = get_post_meta( $post_id, 'switch_like_status', true ); + + if ( $disabled && empty( $switched_status ) || false == $disabled && !empty( $switched_status ) ) + $checked = false; + + /** + * Fires before the Likes meta box content in the post editor. + * + * @module likes + * + * @since 2.2.0 + * + * @param WP_Post|array|null $post Post data. + */ + do_action( 'start_likes_meta_box_content', $post ); + ?> + +

      + + +

      in_jetpack ) { + if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], get_post_types( array( 'public' => true ) ) ) ) { + if ( ! isset( $_POST['wpl_enable_post_sharing'] ) ) { + update_post_meta( $post_id, 'sharing_disabled', 1 ); + } else { + delete_post_meta( $post_id, 'sharing_disabled' ); + } + } + } + + if ( 'post' == $_POST['post_type'] ) { + if ( !current_user_can( 'edit_post', $post_id ) ) { + return $post_id; + } + } + + // Record a change in like status for this post - only if it contradicts the + // site like setting. + if ( ( $this->is_enabled_sitewide() && empty( $_POST['wpl_enable_post_likes'] ) ) || ( ! $this->is_enabled_sitewide() && ! empty( $_POST['wpl_enable_post_likes'] ) ) ) { + update_post_meta( $post_id, 'switch_like_status', 1 ); + } else { + delete_post_meta( $post_id, 'switch_like_status' ); + } + + return $post_id; + } + + /** + * Adds the 'sharing' menu to the settings menu. + * Only ran if sharedaddy and publicize are not already active. + */ + function sharing_menu() { + add_submenu_page( 'options-general.php', esc_html__( 'Sharing Settings', 'jetpack' ), esc_html__( 'Sharing', 'jetpack' ), 'manage_options', 'sharing', array( $this, 'sharing_page' ) ); + } + + /** + * Provides a sharing page with the sharing_global_options hook + * so we can display the setting. + * Only ran if sharedaddy and publicize are not already active. + */ + function sharing_page() { + $this->updated_message(); ?> +
      +

      +

      + + sharing_block(); ?> +

      ' . esc_html__( 'Settings have been saved', 'jetpack' ) . '

      '; + } + } + + /** + * Returns just the "sharing buttons" w/ like option block, so it can be inserted into different sharing page contexts + */ + function sharing_block() { ?> +

      +
      + + + + +
      + +

      + +

      + + +
      is_enabled_sitewide(); + $post_likes_switched = (bool) get_post_meta( $post->ID, 'switch_like_status', true ); + + return $post_likes_switched xor $sitewide_likes_enabled; + } + + /** + * Are likes visible in this context? + * + * Some of this code was taken and modified from sharing_display() to ensure + * similar logic and filters apply here, too. + */ + function is_likes_visible() { + require_once JETPACK__PLUGIN_DIR . '/sync/class.jetpack-sync-settings.php'; + if ( Jetpack_Sync_Settings::is_syncing() ) { + return false; + } + + global $wp_current_filter; // Used to apply 'sharing_show' filter + + $post = get_post(); + + // Never show on feeds or previews + if ( is_feed() || is_preview() ) { + $enabled = false; + + // Not a feed or preview, so what is it? + } else { + + if ( in_the_loop() ) { + // If in the loop, check if the current post is likeable + $enabled = $this->is_post_likeable(); + } else { + // Otherwise, check and see if likes are enabled sitewide + $enabled = $this->is_enabled_sitewide(); + } + + if ( post_password_required() ) + $enabled = false; + + if ( in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) { + $enabled = false; + } + + // Sharing Setting Overrides **************************************** + + // Single post including custom post types + if ( is_single() ) { + if ( ! $this->is_single_post_enabled( $post->post_type ) ) { + $enabled = false; + } + + // Single page + } elseif ( is_page() && ! is_front_page() ) { + if ( ! $this->is_single_page_enabled() ) { + $enabled = false; + } + + // Attachment + } elseif ( is_attachment() ) { + if ( ! $this->is_attachment_enabled() ) { + $enabled = false; + } + + // All other loops + } elseif ( ! $this->is_index_enabled() ) { + $enabled = false; + } + } + + if ( $post instanceof WP_Post ) { + // Check that the post is a public, published post. + if ( 'attachment' == $post->post_type ) { + $post_status = get_post_status( $post->post_parent ); + } else { + $post_status = $post->post_status; + } + if ( 'publish' != $post_status ) { + $enabled = false; + } + } + + // Run through the sharing filters + /** This filter is documented in modules/sharedaddy/sharing-service.php */ + $enabled = apply_filters( 'sharing_show', $enabled, $post ); + + /** + * Filters whether the Likes should be visible or not. + * Allows overwriting the options set in Settings > Sharing. + * + * @module likes + * + * @since 2.2.0 + * + * @param bool $enabled Should the Likes be visible? + */ + return (bool) apply_filters( 'wpl_is_likes_visible', $enabled ); + } + + /** + * Are Post Likes enabled on single posts? + * + * @param String $post_type custom post type identifier + * @return bool + */ + function is_single_post_enabled( $post_type = 'post' ) { + $options = $this->get_options(); + return (bool) apply_filters( + /** + * Filters whether Likes should be enabled on single posts. + * + * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled. + * + * @module likes + * + * @since 2.2.0 + * + * @param bool $enabled Are Post Likes enabled on single posts? + */ + "wpl_is_single_{$post_type}_disabled", + (bool) in_array( $post_type, $options['show'] ) + ); + } + + /** + * Get the 'disabled_likes' option from the DB of the current blog. + * + * @return array + */ + function get_options() { + $setting = array(); + $setting['disabled'] = get_option( 'disabled_likes' ); + $sharing = get_option( 'sharing-options' ); + + // Default visibility settings + if ( ! isset( $sharing['global']['show'] ) ) { + $sharing['global']['show'] = array( 'post', 'page' ); + + // Scalar check + } elseif ( is_scalar( $sharing['global']['show'] ) ) { + switch ( $sharing['global']['show'] ) { + case 'posts' : + $sharing['global']['show'] = array( 'post', 'page' ); + break; + case 'index' : + $sharing['global']['show'] = array( 'index' ); + break; + case 'posts-index' : + $sharing['global']['show'] = array( 'post', 'page', 'index' ); + break; + } + } + + // Ensure it's always an array (even if not previously empty or scalar) + $setting['show'] = !empty( $sharing['global']['show'] ) ? (array) $sharing['global']['show'] : array(); + + /** + * Filters where the Likes are displayed. + * + * @module likes + * + * @since 2.2.0 + * + * @param array $setting Array of Likes display settings. + */ + return apply_filters( 'wpl_get_options', $setting ); + } + + /** + * Are Post Likes enabled on archive/front/search pages? + * + * @return bool + */ + function is_index_enabled() { + $options = $this->get_options(); + /** + * Filters whether Likes should be enabled on archive/front/search pages. + * + * @module likes + * + * @since 2.2.0 + * + * @param bool $enabled Are Post Likes enabled on archive/front/search pages? + */ + return (bool) apply_filters( 'wpl_is_index_disabled', (bool) in_array( 'index', $options['show'] ) ); + } + + /** + * Are Post Likes enabled on single pages? + * + * @return bool + */ + function is_single_page_enabled() { + $options = $this->get_options(); + /** + * Filters whether Likes should be enabled on single pages. + * + * @module likes + * + * @since 2.2.0 + * + * @param bool $enabled Are Post Likes enabled on single pages? + */ + return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) ); + } + + /** + * Are Media Likes enabled on single pages? + * + * @return bool + */ + function is_attachment_enabled() { + $options = $this->get_options(); + /** + * Filters whether Likes should be enabled on attachment pages. + * + * @module likes + * + * @since 2.2.0 + * + * @param bool $enabled Are Post Likes enabled on attachment pages? + */ + return (bool) apply_filters( 'wpl_is_attachment_disabled', (bool) in_array( 'attachment', $options['show'] ) ); + } + + /** + * The actual options block to be inserted into the sharing page. + */ + function admin_settings_init() { + ?> + + + + + +
      + +
      +
      + +
      + + + in_jetpack ) : ?> + + + + + +
      + +
      +
      + +
      + + + + + is_enabled_sitewide(); + + $reblogs_new_state = !empty( $_POST['jetpack_reblogs_enabled'] ) ? $_POST['jetpack_reblogs_enabled'] : 'on'; + $reblogs_db_state = $this->reblogs_enabled_sitewide(); + /** Default State *********************************************************/ + + // Checked (enabled) + switch( $new_state ) { + case 'off' : + if ( true == $db_state && ! $this->in_jetpack ) { + $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_likes=disabled_likes' ); + } + update_option( 'disabled_likes', 1 ); + break; + case 'on' : + default: + if ( false == $db_state && ! $this->in_jetpack ) { + $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_likes=reenabled_likes' ); + } + delete_option( 'disabled_likes' ); + break; + } + + switch( $reblogs_new_state ) { + case 'off' : + if ( true == $reblogs_db_state && ! $this->in_jetpack ) { + $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_reblogs=disabled_reblogs' ); + } + update_option( 'disabled_reblogs', 1 ); + break; + case 'on' : + default: + if ( false == $reblogs_db_state && ! $this->in_jetpack ) { + $g_gif = file_get_contents( 'https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_reblogs=reenabled_reblogs' ); + } + delete_option( 'disabled_reblogs' ); + break; + } + } + + /** + * Adds the admin update hook so we can save settings even if Sharedaddy is not enabled. + */ + function process_update_requests_if_sharedaddy_not_loaded() { + if ( isset( $_GET['page'] ) && ( $_GET['page'] == 'sharing.php' || $_GET['page'] == 'sharing' ) ) { + if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'sharing-options' ) ) { + /** This action is documented in modules/sharedaddy/sharing.php */ + do_action( 'sharing_admin_update' ); + wp_safe_redirect( admin_url( 'options-general.php?page=sharing&update=saved' ) ); + die(); + } + } + } + + /** + * If sharedaddy is not loaded, we don't have the "Show buttons on" yet, so we need to add that since it affects likes too. + */ + function admin_settings_showbuttonon_init() { + ?> + ' ); + ?> + + + true ) ) ); + array_unshift( $shows, 'index' ); + $global = $this->get_options(); + foreach ( $shows as $show ) : + if ( 'index' == $show ) { + $label = __( 'Front Page, Archive Pages, and Search Results', 'jetpack' ); + } else { + $post_type_object = get_post_type_object( $show ); + $label = $post_type_object->labels->name; + } + ?> + '; ?> + + + ' ); + ?> + true ) ) ); + $shows[] = 'index'; + $data = $_POST; + + if ( isset( $data['show'] ) ) { + if ( is_scalar( $data['show'] ) ) { + switch ( $data['show'] ) { + case 'posts' : + $data['show'] = array( 'post', 'page' ); + break; + case 'index' : + $data['show'] = array( 'index' ); + break; + case 'posts-index' : + $data['show'] = array( 'post', 'page', 'index' ); + break; + } + } + + if ( $data['show'] = array_intersect( $data['show'], $shows ) ) { + $options['global']['show'] = $data['show']; + } + } else { + $options['global']['show'] = array(); + } + + update_option( 'sharing-options', $options ); + } +} diff --git a/plugins/jetpack/modules/likes/queuehandler.js b/plugins/jetpack/modules/likes/queuehandler.js index ef67dc18..3eaeec38 100644 --- a/plugins/jetpack/modules/likes/queuehandler.js +++ b/plugins/jetpack/modules/likes/queuehandler.js @@ -1,10 +1,18 @@ /* global pm, wpcom_reblog, JSON */ -var jetpackLikesWidgetQueue = []; var jetpackLikesWidgetBatch = []; var jetpackLikesMasterReady = false; -function JetpackLikespostMessage( message, target ) { +// Due to performance problems on pages with a large number of widget iframes that need to be loaded, +// we are limiting the processing at any instant to unloaded widgets that are currently in viewport, +// plus this constant that will allow processing of widgets above and bellow the current fold. +// This aim of it is to improve the UX and hide the transition from unloaded to loaded state from users. +var jetpackLikesLookAhead = 2000; // pixels + +// Keeps track of loaded comment likes widget so we can unload them when they are scrolled out of view. +var jetpackCommentLikesLoadedWidgets = []; + +function JetpackLikesPostMessage(message, target ) { if ( 'string' === typeof message ){ try { message = JSON.parse( message ); @@ -27,7 +35,13 @@ function JetpackLikesBatchHandler() { if ( jetpackLikesWidgetBatch.indexOf( this.id ) > -1 ) { return; } + + if ( ! jetpackIsScrolledIntoView( this ) ) { + return; + } + jetpackLikesWidgetBatch.push( this.id ); + var regex = /like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/, match = regex.exec( this.id ), info; @@ -53,7 +67,7 @@ function JetpackLikesBatchHandler() { }); if ( requests.length > 0 ) { - JetpackLikespostMessage( { event: 'initialBatch', requests: requests }, window.frames['likes-master'] ); + JetpackLikesPostMessage( { event: 'initialBatch', requests: requests }, window.frames['likes-master'] ); } } @@ -65,140 +79,143 @@ function JetpackLikesMessageListener( event, message ) { } // We only allow messages from one origin - allowedOrigin = window.location.protocol + '//widgets.wp.com'; + allowedOrigin = 'https://widgets.wp.com'; if ( allowedOrigin !== message.origin ) { return; } - if ( 'masterReady' === event.event ) { - jQuery( document ).ready( function() { - jetpackLikesMasterReady = true; + switch ( event.event ) { + case 'masterReady': + jQuery( document ).ready( function() { + jetpackLikesMasterReady = true; + + var stylesData = { + event: 'injectStyles' + }, + $sdTextColor = jQuery( '.sd-text-color' ), + $sdLinkColor = jQuery( '.sd-link-color' ); + + if ( jQuery( 'iframe.admin-bar-likes-widget' ).length > 0 ) { + JetpackLikesPostMessage( { event: 'adminBarEnabled' }, window.frames[ 'likes-master' ] ); + + stylesData.adminBarStyles = { + background: jQuery( '#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a' ).css( 'background' ), + isRtl: ( 'rtl' === jQuery( '#wpadminbar' ).css( 'direction' ) ) + }; + } + + if ( ! window.addEventListener ) { + jQuery( '#wp-admin-bar-admin-bar-likes-widget' ).hide(); + } + + stylesData.textStyles = { + color: $sdTextColor.css( 'color' ), + fontFamily: $sdTextColor.css( 'font-family' ), + fontSize: $sdTextColor.css( 'font-size' ), + direction: $sdTextColor.css( 'direction' ), + fontWeight: $sdTextColor.css( 'font-weight' ), + fontStyle: $sdTextColor.css( 'font-style' ), + textDecoration: $sdTextColor.css( 'text-decoration' ) + }; - var stylesData = { - event: 'injectStyles' - }, - $sdTextColor = jQuery( '.sd-text-color' ), - $sdLinkColor = jQuery( '.sd-link-color' ); + stylesData.linkStyles = { + color: $sdLinkColor.css( 'color' ), + fontFamily: $sdLinkColor.css( 'font-family' ), + fontSize: $sdLinkColor.css( 'font-size' ), + textDecoration: $sdLinkColor.css( 'text-decoration' ), + fontWeight: $sdLinkColor.css( 'font-weight' ), + fontStyle: $sdLinkColor.css( 'font-style' ) + }; - if ( jQuery( 'iframe.admin-bar-likes-widget' ).length > 0 ) { - JetpackLikespostMessage( { event: 'adminBarEnabled' }, window.frames[ 'likes-master' ] ); + JetpackLikesPostMessage( stylesData, window.frames[ 'likes-master' ] ); - stylesData.adminBarStyles = { - background: jQuery( '#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a' ).css( 'background' ), - isRtl: ( 'rtl' === jQuery( '#wpadminbar' ).css( 'direction' ) ) - }; - } + JetpackLikesBatchHandler(); + } ); - if ( ! window.addEventListener ) { - jQuery( '#wp-admin-bar-admin-bar-likes-widget' ).hide(); - } + break; - stylesData.textStyles = { - color: $sdTextColor.css( 'color' ), - fontFamily: $sdTextColor.css( 'font-family' ), - fontSize: $sdTextColor.css( 'font-size' ), - direction: $sdTextColor.css( 'direction' ), - fontWeight: $sdTextColor.css( 'font-weight' ), - fontStyle: $sdTextColor.css( 'font-style' ), - textDecoration: $sdTextColor.css('text-decoration') - }; - - stylesData.linkStyles = { - color: $sdLinkColor.css('color'), - fontFamily: $sdLinkColor.css('font-family'), - fontSize: $sdLinkColor.css('font-size'), - textDecoration: $sdLinkColor.css('text-decoration'), - fontWeight: $sdLinkColor.css( 'font-weight' ), - fontStyle: $sdLinkColor.css( 'font-style' ) - }; - - JetpackLikespostMessage( stylesData, window.frames[ 'likes-master' ] ); - - JetpackLikesBatchHandler(); - - jQuery( document ).on( 'inview', 'div.jetpack-likes-widget-unloaded', function() { - jetpackLikesWidgetQueue.push( this.id ); - }); - }); - } + case 'showLikeWidget': + jQuery( '#' + event.id + ' .likes-widget-placeholder' ).fadeOut( 'fast' ); + break; - if ( 'showLikeWidget' === event.event ) { - jQuery( '#' + event.id + ' .post-likes-widget-placeholder' ).fadeOut( 'fast', function() { - jQuery( '#' + event.id + ' .post-likes-widget' ).fadeIn( 'fast', function() { - JetpackLikespostMessage( { event: 'likeWidgetDisplayed', blog_id: event.blog_id, post_id: event.post_id, obj_id: event.obj_id }, window.frames['likes-master'] ); - }); - }); - } + case 'showCommentLikeWidget': + jQuery( '#' + event.id + ' .likes-widget-placeholder' ).fadeOut( 'fast' ); + break; - if ( 'clickReblogFlair' === event.event ) { - wpcom_reblog.toggle_reblog_box_flair( event.obj_id ); - } + case 'killCommentLikes': + // If kill switch for comment likes is enabled remove all widgets wrappers and `Loading...` placeholders. + jQuery( '.jetpack-comment-likes-widget-wrapper' ).remove(); + break; - if ( 'showOtherGravatars' === event.event ) { - $container = jQuery( '#likes-other-gravatars' ); - $list = $container.find( 'ul' ); + case 'clickReblogFlair': + wpcom_reblog.toggle_reblog_box_flair( event.obj_id ); + break; - $container.hide(); - $list.html( '' ); + case 'showOtherGravatars': + $container = jQuery( '#likes-other-gravatars' ); + $list = $container.find( 'ul' ); - $container.find( '.likes-text span' ).text( event.total ); + $container.hide(); + $list.html( '' ); - jQuery.each( event.likers, function( i, liker ) { - var element; + $container.find( '.likes-text span' ).text( event.total ); - if ( 'http' !== liker.profile_URL.substr( 0, 4 ) ) { - // We only display gravatars with http or https schema - return; - } + jQuery.each( event.likers, function( i, liker ) { + var element; + + if ( 'http' !== liker.profile_URL.substr( 0, 4 ) ) { + // We only display gravatars with http or https schema + return; + } - element = jQuery( '
    • ' ); - element.addClass( liker.css_class ); + element = jQuery( '
    • ' ); + element.addClass( liker.css_class ); - element.find( 'a' ). - attr({ + element.find( 'a' ). + attr( { href: liker.profile_URL, rel: 'nofollow', target: '_parent' - }). + } ). addClass( 'wpl-liker' ); - element.find( 'img' ). - attr({ + element.find( 'img' ). + attr( { src: liker.avatar_URL, alt: liker.name - }). - css({ + } ). + css( { width: '30px', height: '30px', paddingRight: '3px' - }); + } ); - $list.append( element ); - } ); + $list.append( element ); + } ); - offset = jQuery( '[name=\'' + event.parent + '\']' ).offset(); + offset = jQuery( '[name=\'' + event.parent + '\']' ).offset(); - $container.css( 'left', offset.left + event.position.left - 10 + 'px' ); - $container.css( 'top', offset.top + event.position.top - 33 + 'px' ); + $container.css( 'left', offset.left + event.position.left - 10 + 'px' ); + $container.css( 'top', offset.top + event.position.top - 33 + 'px' ); - rowLength = Math.floor( event.width / 37 ); - height = ( Math.ceil( event.likers.length / rowLength ) * 37 ) + 13; - if ( height > 204 ) { - height = 204; - } + rowLength = Math.floor( event.width / 37 ); + height = ( Math.ceil( event.likers.length / rowLength ) * 37 ) + 13; + if ( height > 204 ) { + height = 204; + } - $container.css( 'height', height + 'px' ); - $container.css( 'width', rowLength * 37 - 7 + 'px' ); + $container.css( 'height', height + 'px' ); + $container.css( 'width', rowLength * 37 - 7 + 'px' ); - $list.css( 'width', rowLength * 37 + 'px' ); + $list.css( 'width', rowLength * 37 + 'px' ); - $container.fadeIn( 'slow' ); + $container.fadeIn( 'slow' ); - scrollbarWidth = $list[0].offsetWidth - $list[0].clientWidth; - if ( scrollbarWidth > 0 ) { - $container.width( $container.width() + scrollbarWidth ); - $list.width( $list.width() + scrollbarWidth ); - } + scrollbarWidth = $list[0].offsetWidth - $list[0].clientWidth; + if ( scrollbarWidth > 0 ) { + $container.width( $container.width() + scrollbarWidth ); + $list.width( $list.width() + scrollbarWidth ); + } } } @@ -213,66 +230,155 @@ jQuery( document ).click( function( e ) { }); function JetpackLikesWidgetQueueHandler() { - var $wrapper, wrapperID, found; + var wrapperID; + if ( ! jetpackLikesMasterReady ) { setTimeout( JetpackLikesWidgetQueueHandler, 500 ); return; } - if ( jetpackLikesWidgetQueue.length > 0 ) { - // We may have a widget that needs creating now - found = false; - while( jetpackLikesWidgetQueue.length > 0 ) { - // Grab the first member of the queue that isn't already loading. - wrapperID = jetpackLikesWidgetQueue.splice( 0, 1 )[0]; - if ( jQuery( '#' + wrapperID ).hasClass( 'jetpack-likes-widget-unloaded' ) ) { - found = true; - break; - } - } - if ( ! found ) { - setTimeout( JetpackLikesWidgetQueueHandler, 500 ); - return; - } - } else if ( jQuery( 'div.jetpack-likes-widget-unloaded' ).length > 0 ) { + // Restore widgets to initial unloaded state when they are scrolled out of view. + jetpackUnloadScrolledOutWidgets(); + + var unloadedWidgetsInView = jetpackGetUnloadedWidgetsInView(); + + if ( unloadedWidgetsInView.length > 0 ) { // Grab any unloaded widgets for a batch request JetpackLikesBatchHandler(); + } - // Get the next unloaded widget - wrapperID = jQuery( 'div.jetpack-likes-widget-unloaded' ).first()[0].id; - if ( ! wrapperID ) { - // Everything is currently loaded - setTimeout( JetpackLikesWidgetQueueHandler, 500 ); - return; + for ( var i=0, length = unloadedWidgetsInView.length; i <= length - 1; i++ ) { + wrapperID = unloadedWidgetsInView[i].id; + + if ( ! wrapperID ){ + continue; } + + jetpackLoadLikeWidgetIframe( wrapperID ); } +} +function jetpackLoadLikeWidgetIframe( wrapperID ) { + var $wrapper; + if ( 'undefined' === typeof wrapperID ) { - setTimeout( JetpackLikesWidgetQueueHandler, 500 ); return; } $wrapper = jQuery( '#' + wrapperID ); $wrapper.find( 'iframe' ).remove(); - if ( $wrapper.hasClass( 'slim-likes-widget' ) ) { - $wrapper.find( '.post-likes-widget-placeholder' ).after( '' ); - } else { - $wrapper.find( '.post-likes-widget-placeholder' ).after( '' ); + var placeholder = $wrapper.find( '.likes-widget-placeholder' ); + + // Post like iframe + if ( placeholder.hasClass( 'post-likes-widget-placeholder' ) ) { + var postLikesFrame = document.createElement( 'iframe' ); + + postLikesFrame['class'] = 'post-likes-widget jetpack-likes-widget'; + postLikesFrame.name = $wrapper.data( 'name' ); + postLikesFrame.src = $wrapper.data( 'src' ); + postLikesFrame.height = '18px'; + postLikesFrame.width = '200px'; + postLikesFrame.frameBorder = '0'; + postLikesFrame.scrolling = 'no'; + + if ( $wrapper.hasClass( 'slim-likes-widget' ) ) { + postLikesFrame.height = '22px'; + postLikesFrame.width = '68px'; + postLikesFrame.scrolling = 'no'; + } else { + postLikesFrame.height = '55px'; + postLikesFrame.width = '100%'; + } + + placeholder.after( postLikesFrame ); + } + + // Comment like iframe + if ( placeholder.hasClass( 'comment-likes-widget-placeholder' ) ) { + var commentLikesFrame = document.createElement( 'iframe' ); + + commentLikesFrame['class'] = 'comment-likes-widget-frame jetpack-likes-widget-frame'; + commentLikesFrame.name = $wrapper.data( 'name' ); + commentLikesFrame.src = $wrapper.data( 'src' ); + commentLikesFrame.height = '18px'; + commentLikesFrame.width = '200px'; + commentLikesFrame.frameBorder = '0'; + commentLikesFrame.scrolling = 'no'; + + $wrapper.find( '.comment-like-feedback' ).after( commentLikesFrame ); + + jetpackCommentLikesLoadedWidgets.push( commentLikesFrame ); } $wrapper.removeClass( 'jetpack-likes-widget-unloaded' ).addClass( 'jetpack-likes-widget-loading' ); $wrapper.find( 'iframe' ).load( function( e ) { var $iframe = jQuery( e.target ); - $wrapper.removeClass( 'jetpack-likes-widget-loading' ).addClass( 'jetpack-likes-widget-loaded' ); - JetpackLikespostMessage( { event: 'loadLikeWidget', name: $iframe.attr( 'name' ), width: $iframe.width() }, window.frames[ 'likes-master' ] ); + JetpackLikesPostMessage( { event: 'loadLikeWidget', name: $iframe.attr( 'name' ), width: $iframe.width() }, window.frames[ 'likes-master' ] ); + + $wrapper.removeClass( 'jetpack-likes-widget-loading' ).addClass( 'jetpack-likes-widget-loaded' ); if ( $wrapper.hasClass( 'slim-likes-widget' ) ) { $wrapper.find( 'iframe' ).Jetpack( 'resizeable' ); } }); - setTimeout( JetpackLikesWidgetQueueHandler, 250 ); } + +function jetpackGetUnloadedWidgetsInView() { + var $unloadedWidgets = jQuery( 'div.jetpack-likes-widget-unloaded' ); + + return $unloadedWidgets.filter( function() { + return jetpackIsScrolledIntoView( this ); + } ); +} + +function jetpackIsScrolledIntoView( element ) { + var top = element.getBoundingClientRect().top; + var bottom = element.getBoundingClientRect().bottom; + + // Allow some slack above and bellow the fold with jetpackLikesLookAhead, + // with the aim of hiding the transition from unloaded to loaded widget from users. + return ( top + jetpackLikesLookAhead >= 0 ) && ( bottom <= window.innerHeight + jetpackLikesLookAhead ); +} + +function jetpackUnloadScrolledOutWidgets() { + for ( var i = jetpackCommentLikesLoadedWidgets.length - 1; i >= 0; i-- ) { + var currentWidgetIframe = jetpackCommentLikesLoadedWidgets[ i ]; + + if ( ! jetpackIsScrolledIntoView( currentWidgetIframe ) ) { + var $widgetWrapper = jQuery( currentWidgetIframe ).parent().parent(); + + // Restore parent class to 'unloaded' so this widget can be picked up by queue manager again if needed. + $widgetWrapper + .removeClass( 'jetpack-likes-widget-loaded jetpack-likes-widget-loading' ) + .addClass( 'jetpack-likes-widget-unloaded' ); + + // Bring back the loading placeholder into view. + $widgetWrapper.children( '.comment-likes-widget-placeholder' ).fadeIn(); + + // Remove it from the list of loaded widgets. + jetpackCommentLikesLoadedWidgets.splice( i, 1 ); + + // Remove comment like widget iFrame. + jQuery( currentWidgetIframe ).remove(); + } + } +} + +var jetpackWidgetsDelayedExec = function( after, fn ) { + var timer; + return function() { + timer && clearTimeout( timer ); + timer = setTimeout( fn, after ); + }; +}; + +var jetpackOnScrollStopped = jetpackWidgetsDelayedExec( 250, JetpackLikesWidgetQueueHandler ); + +// Load initial batch of widgets, prior to any scrolling events. JetpackLikesWidgetQueueHandler(); + +// Add event listener to execute queue handler after scroll. +window.addEventListener( 'scroll', jetpackOnScrollStopped, true ); diff --git a/plugins/jetpack/modules/likes/style.css b/plugins/jetpack/modules/likes/style.css index ab8938a0..3dfb2207 100644 --- a/plugins/jetpack/modules/likes/style.css +++ b/plugins/jetpack/modules/likes/style.css @@ -1,9 +1,11 @@ /** * Like Button toolbar button, loading text & container styles - * - * @todo: doesn't look like "style.css" is used anymore. */ +@font-face { + font-family: Noticons; + src: url(https://wordpress.com/i/noticons/Noticons.woff); +} /* Master container */ #jp-post-flair { @@ -65,6 +67,16 @@ div.jetpack-likes-widget-wrapper.slim-likes-widget { min-height: 0; } +div.jetpack-comment-likes-widget-wrapper { + width: 100%; + position: relative; + min-height: 31px; +} + +div.jetpack-comment-likes-widget-wrapper iframe { + margin-bottom: 0; +} + #likes-other-gravatars { display: none; position: absolute; @@ -138,14 +150,34 @@ div.sd-box { display: block; } - /* Loading text */ -.post-likes-widget-placeholder { +.post-likes-widget-placeholder, +.comment-likes-widget-placeholder { margin: 0; border-width: 0; position: relative; } +.comment-likes-widget-placeholder { + height: 18px; + position: absolute; + display: flex; + font-family: "Open Sans", sans-serif; + margin-top: 4px; +} + +.comment-likes-widget-placeholder::before { + -webkit-font-smoothing: antialiased; + font-family: "Noticons"; + font-size: 20px; + line-height: .9; + color: #5CB5D4; + content: '\f408'; + width: 16px; + display: inline-block; + vertical-align: middle; +} + .post-likes-widget-placeholder .button { display: none; /* Let's not show a dummy like button, let's just make a great button experience once it's loaded */ } @@ -153,17 +185,24 @@ div.sd-box { .post-likes-widget-placeholder .button span { } -.post-likes-widget-placeholder .loading { +.post-likes-widget-placeholder .loading, +.comment-likes-widget-placeholder .loading { color: #999; font-size: 12px; } +.comment-likes-widget-placeholder .loading { + padding-left: 5px; + margin-top: 2px; + align-self: center; + color: #4E4E4E; +} + .slim-likes-widget .post-likes-widget { width: auto; float: none; } - /* Like Special cases (display on it's own) */ div.sharedaddy.sd-like-enabled .sd-like h3 { display: none; diff --git a/plugins/jetpack/modules/masterbar/masterbar.php b/plugins/jetpack/modules/masterbar/masterbar.php index 25346274..300c7bde 100644 --- a/plugins/jetpack/modules/masterbar/masterbar.php +++ b/plugins/jetpack/modules/masterbar/masterbar.php @@ -50,6 +50,7 @@ class A8C_WPCOM_Masterbar { // Extend core WP_Admin_Bar class in order to add rtl styles add_filter( 'wp_admin_bar_class', array( $this, 'get_rtl_admin_bar_class' ) ); } + add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) ); add_action( 'wp_before_admin_bar_render', array( $this, 'replace_core_masterbar' ), 99999 ); @@ -81,6 +82,19 @@ class A8C_WPCOM_Masterbar { return 'RTL_Admin_Bar'; } + /** + * Adds CSS classes to admin body tag. + * + * @since 5.1 + * + * @param string $admin_body_classes CSS classes that will be added. + * + * @return string + */ + public function admin_body_class( $admin_body_classes ) { + return "$admin_body_classes jetpack-masterbar"; + } + public function remove_core_styles() { wp_dequeue_style( 'admin-bar' ); } @@ -92,15 +106,15 @@ class A8C_WPCOM_Masterbar { public function add_styles_and_scripts() { if ( $this->is_rtl() ) { - wp_enqueue_style( 'a8c-wpcom-masterbar-rtl', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/rtl/wpcom-admin-bar-rtl.css' ) ); - wp_enqueue_style( 'a8c-wpcom-masterbar-overrides-rtl', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/rtl/masterbar-rtl.css' ) ); + wp_enqueue_style( 'a8c-wpcom-masterbar-rtl', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/rtl/wpcom-admin-bar-rtl.css' ), array(), JETPACK__VERSION ); + wp_enqueue_style( 'a8c-wpcom-masterbar-overrides-rtl', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/rtl/masterbar-rtl.css' ), array(), JETPACK__VERSION ); } else { - wp_enqueue_style( 'a8c-wpcom-masterbar', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/wpcom-admin-bar.css' ) ); - wp_enqueue_style( 'a8c-wpcom-masterbar-overrides', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/masterbar.css' ) ); + wp_enqueue_style( 'a8c-wpcom-masterbar', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/wpcom-admin-bar.css' ), array(), JETPACK__VERSION ); + wp_enqueue_style( 'a8c-wpcom-masterbar-overrides', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/masterbar.css' ), array(), JETPACK__VERSION ); } // Local overrides - wp_enqueue_style( 'a8c_wpcom_css_override', plugins_url( 'overrides.css', __FILE__ ) ); + wp_enqueue_style( 'a8c_wpcom_css_override', plugins_url( 'overrides.css', __FILE__ ), array(), JETPACK__VERSION ); if ( ! Jetpack::is_module_active( 'notes ' ) ) { // Masterbar is relying on some icons from noticons.css @@ -108,7 +122,7 @@ class A8C_WPCOM_Masterbar { } wp_enqueue_script( 'jetpack-accessible-focus', plugins_url( '_inc/accessible-focus.js', JETPACK__PLUGIN_FILE ), array(), JETPACK__VERSION ); - wp_enqueue_script( 'a8c_wpcom_masterbar_overrides', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/masterbar.js' ) ); + wp_enqueue_script( 'a8c_wpcom_masterbar_overrides', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/masterbar.js' ), array(), JETPACK__VERSION ); } function wpcom_static_url( $file ) { @@ -182,13 +196,13 @@ class A8C_WPCOM_Masterbar { $wp_admin_bar->add_node( array( 'id' => 'notes', 'title' => ' - ' . __( 'Notifications', 'jetpack' ) . ' + ' . esc_html__( 'Notifications', 'jetpack' ) . ' ', 'meta' => array( 'html' => '