!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./src/index.js")}({"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}t.createStore=function e(t,n,o){var a;if("function"==typeof n&&"function"==typeof o||"function"==typeof o&&"function"==typeof arguments[3])throw Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function");if("function"==typeof n&&void 0===o&&(o=n,n=void 0),void 0!==o){if("function"!=typeof o)throw Error("Expected the enhancer to be a function.");return o(e)(t,n)}if("function"!=typeof t)throw Error("Expected the reducer to be a function.");var s=t,u=n,c=[],p=c,l=!1;function d(){p===c&&(p=c.slice())}function f(){if(l)throw Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function w(e){if("function"!=typeof e)throw Error("Expected the listener to be a function.");if(l)throw Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var t=!0;return d(),p.push(e),function(){if(t){if(l)throw Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");t=!1,d();var n=p.indexOf(e);p.splice(n,1)}}}function m(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(l)throw Error("Reducers may not dispatch actions.");try{l=!0,u=s(u,e)}finally{l=!1}for(var t=c=p,n=0;t.length>n;n++)(0,t[n])();return e}return m({type:i.INIT}),(a={dispatch:m,subscribe:w,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw Error("Expected the nextReducer to be a function.");s=e,m({type:i.REPLACE})}})[r]=function(){var e,t=w;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[r]=function(){return this},e},a},t.combineReducers=function(e){for(var t=Object.keys(e),n={},r=0;t.length>r;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var s,u=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:i.INIT}))throw Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+i.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){s=e}return function(e,t){if(void 0===e&&(e={}),s)throw s;for(var r=!1,o={},i=0;u.length>i;i++){var c=u[i],p=e[c],l=(0,n[c])(p,t);if(void 0===l){var d=a(c,t);throw Error(d)}o[c]=l,r=r||l!==p}return r?o:e}},t.bindActionCreators=function(e,t){if("function"==typeof e)return s(e,t);if("object"!=typeof e||null===e)throw Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},o=0;n.length>o;o++){var i=n[o],a=e[i];"function"==typeof a&&(r[i]=s(a,t))}return r},t.applyMiddleware=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return function(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}({},n,{dispatch:r=c.apply(void 0,i)(n.dispatch)})}}},t.compose=c,t.__DO_NOT_USE__ActionTypes=i,Object.defineProperty(t,"__esModule",{value:!0})}(t)}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./src/index.js":function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"boot",(function(){return Ne})),n.d(r,"fetch",(function(){return De})),n.d(r,"linkDwell",(function(){return Ye})),n.d(r,"abandon",(function(){return He})),n.d(r,"linkClick",(function(){return Me})),n.d(r,"previewDwell",(function(){return Fe})),n.d(r,"previewShow",(function(){return Ge})),n.d(r,"pageviewLogged",(function(){return Ue})),n.d(r,"showSettings",(function(){return $e})),n.d(r,"hideSettings",(function(){return We})),n.d(r,"saveSettings",(function(){return Xe})),n.d(r,"statsvLogged",(function(){return Be}));var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),i=n.n(o),a=n("./node_modules/redux/dist/redux.min.js"),s=n("./node_modules/redux-thunk/dist/redux-thunk.min.js"),u=n.n(s),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.devicePixelRatio;return e?e>1.5?2:e>1?1.5:1:1}(),p={BRACKETED_DEVICE_PIXEL_RATIO:c,THUMBNAIL_SIZE:320*Math.max(c,1.5),EXTRACT_LENGTH:525},l={TYPE_GENERIC:"generic",TYPE_PAGE:"page",TYPE_DISAMBIGUATION:"disambiguation",TYPE_REFERENCE:"reference"};function d(e,t,n,r,o,i,a,s){var u=function(e){if(null==e||0===e.length)return;return e}(o);return{title:e,url:t,languageCode:n,languageDirection:r,extract:u,type:function(e,t){if(void 0===t)return l.TYPE_GENERIC;switch(e){case l.TYPE_GENERIC:case l.TYPE_DISAMBIGUATION:case l.TYPE_PAGE:return e;default:return l.TYPE_PAGE}}(i,u),thumbnail:a,pageId:s}}function f(e,t){return d(e,t,"","",[],"")}var w=[];function m(e){var t=w.filter((function(t){return n=e,r=t.selector,n.matches(r);var n,r}));return t.length>0?t[t.length-1].name:null}var h=[];function g(e,t){h.push(t),w.push({name:e,selector:t})}function v(e,t){var n=e;return void 0===e||0===n.length?[]:n=function(e,t){var n=[],r=""),o="");t=t.replace(/\s+/g," ").trim();var i=mw.util.escapeRegExp(t),a=new RegExp("(^|\\s)(".concat(i,")(|$)"),"i");return(e=(e=(e=e.replace(/\s+/," ")).replace(a,"$1".concat(o).concat(r,"$2").concat(o,"$3"))).split(o)).forEach((function(e){0===e.indexOf(r)?n.push($("").text(e.slice(r.length))):n.push(document.createTextNode(e))})),n}(n,t)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return e.promise?e.promise({abort:t}):(e.abort=t,e)}var y={};function E(e,t){y[e]=t}function x(e){if(e.query&&e.query.pages&&e.query.pages.length)return e.query.pages[0];throw new Error("API response `query.pages` is empty.")}function T(e){var t=Object.assign({},e);return t.extract=v(e.extract,e.title),t}function P(e){return d(e.title,e.canonicalurl,e.pagelanguagehtmlcode,e.pagelanguagedir,e.extract,e.type,e.thumbnail,e.pageid)}function k(e,t,n){function r(n){var r=t.endpoint;return e({url:r+encodeURIComponent(n),headers:{Accept:'application/json; charset=utf-8; profile="'.concat("https://www.mediawiki.org/wiki/Specs/Summary/1.2.0",'"'),"Accept-Language":t.acceptLanguage}})}return{fetch:r,convertPageToModel:S,fetchPreviewForTitle:function(e){var o=e.getPrefixedDb(),i=r(o);return b(i.then((function(e){return(e=e||{}).title=e.title||o,e.extract=e.extract||"",S(e,t.THUMBNAIL_SIZE,n)})).catch((function(e,t,n){return Promise.reject("http",{xhr:e,textStatus:t,exception:n})})),(function(){return i.abort()}))}}}function _(e,t,n){var r=e.source.split("/"),o=r[r.length-1],i=function(e){return new RegExp(/\.(jpg|jpeg|png|gif)$/i).test(e)}(t.source)||void 0,a=o.indexOf("px-");if(-1===a)return i&&t;var s,u,c=o.slice(a+3);return e.width>e.height?(s=n,u=Math.floor(n/e.width*e.height)):(s=Math.floor(n/e.height*e.width),u=n),s>=t.width&&-1===c.indexOf(".svg")?i&&t:(r[r.length-1]="".concat(s,"px-").concat(c),{source:r.join("/"),width:s,height:u})}function S(e,t,n){return d(e.title,new mw.Title(e.title).getUrl(),e.lang,e.dir,n(e),e.type,e.thumbnail?_(e.thumbnail,e.originalimage,t):void 0,e.pageid)}function A(e){var t=e.extract_html;return 0===t.length?[]:$.parseHTML(t)}function R(e){return v(e.extract,e.title)}function C(e){var t=new AbortController,n=t.signal;return b(fetch(e.url,{headers:e.headers,signal:n}).then((function(e){return e.json()})),(function(){t.abort()}))}function O(e){var t=Object.assign({},p,{acceptLanguage:e.get("wgPageContentLanguage")}),n=Object.assign({},t,{endpoint:e.get("wgPopupsRestGatewayEndpoint")});switch(e.get("wgPopupsGateway")){case"mwApiPlain":return function(e,t){function n(n){return e.get({action:"query",prop:"info|extracts|pageimages|revisions|info",formatversion:2,redirects:!0,exintro:mw.config.get("wgPopupsTextExtractsIntroOnly",!0),exchars:t.EXTRACT_LENGTH,explaintext:!0,exsectionformat:"plain",piprop:"thumbnail",pithumbsize:t.THUMBNAIL_SIZE,pilicense:"any",rvprop:"timestamp",inprop:"url",titles:n,smaxage:300,maxage:300,uselang:"content"},{headers:{"X-Analytics":"preview=1","Accept-Language":t.acceptLanguage}})}return{fetch:n,extractPageFromResponse:x,convertPageToModel:P,fetchPreviewForTitle:function(e){var t=n(e.getPrefixedDb());return b(t.then((function(e){return P(T(x(e)))})),(function(){return t.abort()}))},formatPlainTextExtract:T}}(new mw.Api,t);case"restbasePlain":return k(C,n,R);case"restbaseHTML":return k(C,n,A);default:throw new Error("Unknown gateway")}}function I(){function e(e){var t=["book","journal","news","note","web"],n=null;return e.find("cite[class]").each((function(e,r){for(var o=r.className.split(/\s+/),i=o.length;i--;)if(-1!==t.indexOf(o[i]))return n=o[i],!1})),n}return{fetchPreviewForTitle:function(t,n){var r=t.getFragment().replace(/ /g,"_"),o=function(e){var t="#".concat($.escapeSelector(e));return $("".concat(t," .mw-reference-text, ").concat(t," .reference-text"))}(r);if(!o.length||!o.text().trim()&&!o.children().length)return Promise.reject({textStatus:"abort",textContext:"Footnote not found or empty",xhr:{readyState:0}});var i={url:"#".concat(r),extract:o.html(),type:l.TYPE_REFERENCE,referenceType:e(o),sourceElementId:n.parentNode.id};return b(Promise.resolve(i))}}}function j(e){return mw.html.escape(e)}var N={};function L(e){if(!N[e]){var t=document.createElement("div");t.innerHTML=e,N[e]=t.firstElementChild}return N[e].cloneNode(!0)}function D(e){var t=j(e.heading),n=j(e.saveLabel),r=j(e.closeLabel),o=j(e.helpText),i=j(e.okLabel),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){var t=e.id,n=e.name,r=e.description,o=e.isChecked;return{id:j(t),name:j(n),description:r?j(r):"",isChecked:o}}))}(e.choices);return $($.parseHTML("\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
".concat(r,"
\n\t\t\t\t
\n\t\t\t\t

").concat(t,"

\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t").concat(a.map((function(e){var t=e.id,n=e.name,r=e.description,o=e.isChecked;return'\n\t\t\t\t\t

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t

")})).join(""),"\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t
\n\t").trim()))}function Y(e){var t,n;return function(r){return t||(t=function(e){var t=[{id:l.TYPE_PAGE,name:mw.msg("popups-settings-option-page"),description:mw.msg("popups-settings-option-page-description")},{id:l.TYPE_REFERENCE,name:mw.msg("popups-settings-option-reference"),description:mw.msg("popups-settings-option-reference-description")}];return e||t.splice(1,1),D({heading:mw.msg("popups-settings-title"),closeLabel:mw.msg("popups-settings-cancel"),saveLabel:mw.msg("popups-settings-save"),helpText:mw.msg("popups-settings-help"),okLabel:mw.msg("popups-settings-help-ok"),choices:t})}(e),n=$("
").addClass("mwe-popups-overlay"),t.find(".save").on("click",(function(){var e={};t.find("input").each((function(t,n){e[n.value]=$(n).is(":checked")})),r.saveSettings(e)})),t.find(".close, .okay").on("click",r.hideSettings)),{appendTo:function(e){n.appendTo(e),t.appendTo(n)},show:function(){n.show()},hide:function(){n.hide()},toggleHelp:function(e){!function(e,t){var n=$("#mwe-popups-settings");t?(n.find("main, .save, .close").hide(),n.find(".mwe-popups-settings-help, .okay").show()):(n.find("main, .save, .close").show(),n.find(".mwe-popups-settings-help, .okay").hide())}(0,e)},setEnabled:function(e){Object.keys(e).forEach((function(n){t.find("#mwe-popups-settings-"+n).prop("checked",e[n])}))}}}}function H(e,t){var n;e.subscribe((function(){var r=e.getState();n!==r&&(t(n,r),n=r)}))}function M(e,t){if(e.dataset.title)return mw.Title.newFromText(e.dataset.title);if(function(e){return e.hash&&e.host===location.host&&e.pathname===location.pathname&&e.search===location.search}(e))try{return mw.Title.newFromText(t.get("wgPageName")+decodeURIComponent(e.hash))}catch(e){return null}return function(e,t){if(!e)return null;var n=mw.Title.newFromText(e);return n&&t.indexOf(n.namespace)>=0?n:null}(function(e,t){var n;try{n=new mw.Uri(e)}catch(e){return}if(n.host===location.hostname){var r,o=Object.keys(n.query).length;if(o)1===o&&"title"in n.query&&(r=n.query.title);else{var i=mw.util.escapeRegExp(t.get("wgArticlePath")).replace("\\$1","([^?#]+)"),a=new RegExp(i).exec(n.path);try{r=a&&decodeURIComponent(a[1])}catch(e){}}return r?"".concat(r).concat(n.fragment?"#".concat(n.fragment):""):void 0}}(e.href,t),t.get("wgContentNamespaces"))}function F(e){return new Promise((function(t){setTimeout((function(){t()}),e)}))}var G=n("./src/ui/pointer-mask.svg"),U=n.n(G),W={h:250,w:203},X={h:200,w:320};function B(e,t){var n=p.BRACKETED_DEVICE_PIXEL_RATIO;if(!e)return null;var r=e.width/n,o=e.height/n,i=e.height>e.width||r-1||e.source.indexOf("'")>-1||e.source.indexOf('"')>-1)return null;var a,s,u,c,l=r/o,d=l>.7&&l<1.3;i?(a=r>W.w?(r-W.w)/-2:W.w-r,s=o>W.h?(o-W.h)/-2:0,u=W.w,c=W.h,rX.h?(o-X.h)/-2:0,u=X.w,c=o>X.h?X.h:o);var f,w,m=i&&r
\n');return n.className="mwe-popups mwe-popups-type-".concat(e),t.className="mwe-popups-container",n.appendChild(t),$(n)}function q(e,t,n,r){var o=V(e.type,L('\n\t
\n\t\t
\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t
\n\t
\n'));return o.find(".mw-ui-icon ").addClass("mw-ui-icon-preview-".concat(e.type)),o.find(".mwe-popups-extract").attr("href",e.url),o.find(".mwe-popups-message").html(j(n)),o.find(".mwe-popups-read-link").html(j(r)).attr("href",e.url),t?o.find(".mwe-popups-title").html(j(e.title)):o.find(".mwe-popups-title").remove(),o}var K=!1,z="event.ReferencePreviewsPopups";function Z(){return K}function J(e){var t=e.referenceType||"generic",n=mw.message("popups-refpreview-".concat(t));n.exists()||(n=mw.message("popups-refpreview-reference"));var r=V(e.type,L('\n
\n
\n
\n \n \n \n \n
\n
\n
\n
\n\t
\n\t\t
\n\t
\n
'));return r.find(".mwe-popups-title-placeholder").replaceWith(j(n.text())),r.find(".mwe-popups-title .mw-ui-icon").addClass("mw-ui-icon-reference-".concat(t)),r.find(".mw-parser-output").html(e.extract),r.find('.mwe-popups-extract a[href][class~="external"]:not([target])').each((function(e,t){t.target="_blank",t.rel="".concat(t.rel?"".concat(t.rel," "):"","noopener")})),r.find(".mw-collapsible").replaceWith($("
").addClass("mwe-collapsible-placeholder").append($("").addClass("mw-ui-icon mw-ui-icon-element mw-ui-icon-infoFilled"),$("
").addClass("mwe-collapsible-placeholder-label").text(mw.msg("popups-refpreview-collapsible-placeholder")))),r.find("table.sortable").removeClass("sortable jquery-tablesorter").find(".headerSort").removeClass("headerSort").attr({tabindex:null,title:null}),mw.config.get("wgPopupsReferencePreviewsBetaFeature")?r.find(".mwe-popups-container").addClass("footer-empty"):r.find(".mwe-popups-settings").append($("").addClass("mwe-popups-settings-icon").append($("").addClass("mw-ui-icon mw-ui-icon-element mw-ui-icon-small mw-ui-icon-settings"))),Z()&&r.find(".mw-parser-output").on("click","a",(function(){mw.track(z,{action:"clickedReferencePreviewsContentLink"})})),r.find(".mwe-popups-scroll").on("scroll",(function(e){var t=e.target,n=t.scrollTop>=t.scrollHeight-t.clientHeight-1;if(Z()&&(t.isOpenRecorded||(mw.track(z,{action:"poppedOpen",scrollbarsPresent:t.scrollHeight>t.clientHeight}),t.isOpenRecorded=!0),t.scrollTop>0&&!t.isScrollRecorded&&(mw.track(z,{action:"scrolled"}),t.isScrollRecorded=!0)),n||!t.isScrolling){var r=$(t).parent(),o=t.scrollWidth>t.clientWidth,i=t.offsetHeight-t.clientHeight,a=t.scrollHeight>t.clientHeight,s=t.offsetWidth-t.clientWidth;r.find(".mwe-popups-fade").css({bottom:o?"".concat(i,"px"):0,right:a?"".concat(s,"px"):0}),t.isScrolling=!n,r.toggleClass("mwe-popups-fade-out",t.isScrolling)}})),r}function Q(e,t,n,r){var o=V(e.type,L('\n
\n \n \n \n
\n\t'));o.find(".mwe-popups-discreet, .mwe-popups-extract").attr("href",e.url),o.find(".mwe-popups-extract").attr("dir",e.languageDirection).attr("lang",e.languageCode),o.find(".mwe-popups-settings-icon").attr("title",r),t?o.find(".mwe-popups-discreet").append(t.el):o.find(".mwe-popups-discreet").remove();var i=o.find(".mwe-popups-extract");if(e.extract){i.append(e.extract);var a=function(e){return e&&e.isNarrow?"".concat(215+e.offset,"px"):""}(t);n||(i.css("width",a),o.find("footer").css("width",a))}return o}function ee(){var e;oe()||(e=document.body,$("
").attr("id","mwe-popups-svg").html(U.a).appendTo(e))}function te(e){var t=function(e){return(ne[e.type]||ae)(e)}(e);return{show:function(e,n,r){return function(e,t,n,r,o,i,a){var s=function(e,t,n,r){var o,i=!1,a=!1,s=t.pageY?ce(t.pageY-t.scrollTop,t.clientRects,!1)+t.scrollTop+n:t.offset.top+t.height+8,u=t.clientY?t.clientY:s;o=t.pageX?t.width>28?t.pageX:t.offset.left+t.width/2:t.offset.left;o>t.windowWidth/2&&(o+=t.pageX?0:t.width,o-=e?450:320,i=!0);t.pageX&&(o+=i?18:-18);u>t.windowHeight/2&&(a=!0,s=t.offset.top,t.pageY&&(s=ce(t.pageY-t.scrollTop,t.clientRects,!0)+t.scrollTop),s-=n);return{offset:{top:s,left:o},flippedX:"rtl"===r?!i:i,flippedY:a,dir:r}}(e.isTall,t,8,a);e.el.appendTo(i),function(e,t,n,r,o,i){var a=e.el,s=e.isTall,u=e.hasThumbnail,c=e.thumbnail,p=t.flippedY;!p&&!s&&u&&c.heighti)&&(o=i,r=n?Math.floor(t.top):Math.ceil(t.bottom))})),r}function pe(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function le(e,t,n,r){var o=pe(t,n);e&&pe(e,n)!==o&&r(o)}var de={footerLink:function(e){var t;return function(n,r){void 0===t&&(t=function(){var e=document.createElement("li"),t=document.createElement("a");t.href="#",t.textContent=mw.message("popups-settings-enable").text(),e.appendChild(t),e.style.display="none";var n=document.querySelector("#footer-places, #f-list");if(!n){var r=document.querySelector("#footer li");r&&(n=r.parentNode)}return n&&n.appendChild(e),e}()).addEventListener("click",(function(t){t.preventDefault(),e.showSettings()})),r.settings.shouldShowFooterLink?t.style.display="":t.style.display="none"}},linkTitle:function(){var e;return function(t,n){var r,o=t&&t.preview.activeLink;o!==n.preview.activeLink&&((r=o)&&e&&($(r).attr("title",e),e=void 0),n.preview.enabled[n.preview.previewType]&&function(t){if(t&&!e){var n=$(t);e=n.attr("title"),n.attr("title","")}}(n.preview.activeLink))}},pageviews:function(e,t){return function(n,r){var o,i;r.pageviews&&r.pageviews.pageview&&r.pageviews.page&&(o=r.pageviews.page,i=r.pageviews.pageview,t("event.VirtualPageView",{source_page_id:o.id,source_namespace:o.namespaceId,source_title:mw.Title.newFromText(o.title).getPrefixedDb(),source_url:o.url,page_id:i.page_id,page_namespace:i.page_namespace,page_title:mw.Title.newFromText(i.page_title).getPrefixedDb()}),e.pageviewLogged())}},render:function(e){var t;return function(n,r){r.preview.shouldShow&&!t?(t=te(r.preview.fetchResponse)).show(r.preview.measures,e,r.preview.activeToken):!r.preview.shouldShow&&t&&(t.hide(),t=void 0)}},settings:function(e,t){var n;return function(r,o){r&&(!1===r.settings.shouldShow&&o.settings.shouldShow?(n||(n=t(e)).appendTo(document.body),n.setEnabled(o.preview.enabled),n.show()):r.settings.shouldShow&&!1===o.settings.shouldShow&&n.hide(),r.settings.showHelp!==o.settings.showHelp&&n.toggleHelp(o.settings.showHelp))}},statsv:function(e,t){return function(n,r){var o=r.statsv;o.action&&(t(o.action,o.data),e.statsvLogged())}},syncUserSettings:function(e){return function(t,n){le(t,n,"preview.enabled."+l.TYPE_PAGE,e.storePagePreviewsEnabled),le(t,n,"preview.enabled."+l.TYPE_REFERENCE,e.storeReferencePreviewsEnabled)}}},fe=n("./node_modules/@babel/runtime/helpers/slicedToArray.js"),we=n.n(fe),me="BOOT",he="LINK_DWELL",ge="ABANDON_START",ve="ABANDON_END",be="LINK_CLICK",ye="FETCH_START",Ee="FETCH_END",xe="FETCH_COMPLETE",Te="FETCH_FAILED",Pe="FETCH_ABORTED",ke="PAGEVIEW_LOGGED",_e="PREVIEW_DWELL",Se="PREVIEW_SHOW",Ae="PREVIEW_SEEN",Re="SETTINGS_SHOW",Ce="SETTINGS_HIDE",Oe="SETTINGS_CHANGE",Ie="STATSV_LOGGED";function je(e){return e.timestamp=mw.now(),e}function Ne(e,t,n,r,o){var i=r.get("wgUserEditCount");return{type:me,initiallyEnabled:e,isNavPopupsEnabled:r.get("wgPopupsConflictsWithNavPopupGadget"),sessionToken:t.sessionId(),pageToken:t.getPageviewToken(),page:{url:o,title:r.get("wgTitle"),namespaceId:r.get("wgNamespaceNumber"),id:r.get("wgArticleId")},user:{isAnon:t.isAnon(),editCount:i}}}function Le(e){switch(e){case l.TYPE_PAGE:return 350;case l.TYPE_REFERENCE:return 150;default:return 0}}function De(e,t,n,r,o){var i=t.getPrefixedDb(),a=t.namespace;return function(s){var u=e.fetchPreviewForTitle(t,n);s(je({type:ye,el:n,title:i,namespaceId:a,promise:u}));var c=u.then((function(e){return s(je({type:Ee,el:n})),e})).catch((function(e,t){var o=new Error(e),i=t&&t.textStatus&&"abort"===t.textStatus?Pe:Te;throw o.data=t,s({type:i,el:n,token:r}),o}));return Promise.all([c,F(Le(o))]).then((function(e){var t=we()(e,1)[0];s({type:xe,el:n,result:t,token:r})})).catch((function(e){var o=e.data,a=!0;o&&o.xhr&&0===o.xhr.readyState&&(a=!("error"===o.textStatus&&""===o.exception||"abort"===o.textStatus));a&&s({type:xe,el:n,result:f(i,t.getUrl()),token:r})}))}}function Ye(e,t,n,r,o,i){var a=o(),s=e.getPrefixedDb(),u=e.namespace;return function(o,c){var p=F(150),l=je({type:he,el:t,previewType:i,measures:n,token:a,title:s,namespaceId:u,promise:p});function d(){return c().preview.activeToken===a}return o(l),d()?p.then((function(){var n=c().preview.enabled[i];if((void 0===n||n)&&d())return o(De(r,e,t,a,i))})):Promise.resolve()}}function He(){return function(e,t){var n=t().preview,r=n.activeToken,o=n.promise;return r?(e(je({type:ge,token:r})),"abort"in o&&o.abort(),F(300).then((function(){e({type:ve,token:r})}))):Promise.resolve()}}function Me(e){return je({type:be,el:e})}function Fe(){return{type:_e}}function Ge(e){return function(t,n){return t(je({type:Se,token:e})),F(1e3).then((function(){var r=n().preview,o=r&&r.fetchResponse,i=r&&r.activeToken,a=o&&[l.TYPE_PAGE,l.TYPE_DISAMBIGUATION].indexOf(o.type)>-1;i&&i===e&&o&&a&&t({type:Ae,title:o.title,pageId:o.pageId,namespace:0})}))}}function Ue(){return{type:ke}}function $e(){return{type:Re}}function We(){return{type:Ce}}function Xe(e){return function(t,n){t({type:Oe,oldValue:n().preview.enabled,newValue:e})}}function Be(){return{type:Ie}}function Ve(e,t){var n,r=Object.prototype.hasOwnProperty,o={};for(var i in e)r.call(e,i)&&!r.call(t,i)&&(o[i]=e[i]);for(var a in t)if(r.call(t,a))if((n=t[a])&&n.constructor===Object){var s=e[a]?Ve({},e[a]):{};o[a]=Ve(s,t[a])}else o[a]=t[a];return o}var qe={pageviews:function(e,t){switch(void 0===e&&(e={pageview:void 0}),t.type){case me:return Ve(e,{page:t.page});case ke:return Ve(e,{pageview:void 0});case Ae:return Ve(e,{pageview:{page_title:t.title,page_id:t.pageId,page_namespace:t.namespace}});default:return e}},preview:function(e,t){switch(void 0===e&&(e={enabled:{},activeLink:void 0,previewType:void 0,measures:void 0,activeToken:"",shouldShow:!1,isUserDwelling:!1,wasClicked:!1}),t.type){case me:return Ve(e,{enabled:t.initiallyEnabled});case Oe:return Ve(e,{enabled:t.newValue});case he:return t.el!==e.activeLink?Ve(e,{activeLink:t.el,previewType:t.previewType,measures:t.measures,activeToken:t.token,shouldShow:!1,isUserDwelling:!0,promise:t.promise}):Ve(e,{isUserDwelling:!0});case Pe:case ve:return t.token!==e.activeToken||e.isUserDwelling?e:Ve(e,{activeLink:void 0,previewType:void 0,activeToken:void 0,measures:void 0,fetchResponse:void 0,shouldShow:!1});case _e:return Ve(e,{isUserDwelling:!0});case ge:return Ve(e,{isUserDwelling:!1,wasClicked:!1});case ye:return Ve(e,{fetchResponse:void 0,promise:t.promise});case xe:if(t.token===e.activeToken)return Ve(e,{fetchResponse:t.result,shouldShow:e.isUserDwelling});default:return e}},settings:function(e,t){switch(void 0===e&&(e={shouldShow:!1,showHelp:!1,shouldShowFooterLink:!1}),t.type){case Re:return Ve(e,{shouldShow:!0,showHelp:!1});case Ce:return Ve(e,{shouldShow:!1,showHelp:!1});case Oe:var n=Object.keys(t.newValue),r=n.every((function(e){return t.oldValue[e]===t.newValue[e]})),o=n.some((function(e){return t.oldValue[e]&&!t.newValue[e]})),i=n.some((function(e){return!1===t.newValue[e]}));return Ve(e,r?{shouldShow:!1}:{shouldShow:o,showHelp:o,shouldShowFooterLink:i});case me:var a=Object.keys(t.initiallyEnabled).some((function(e){return!1===t.initiallyEnabled[e]}));return Ve(e,{shouldShowFooterLink:t.user.isAnon&&a});default:return e}},statsv:function(e,t){switch(e=e||{},t.type){case ye:return Ve(e,{fetchStartedAt:t.timestamp});case Ee:return Ve(e,{action:"timing.PagePreviewsApiResponse",data:t.timestamp-e.fetchStartedAt});case Te:return Ve(e,{action:"counter.PagePreviewsApiFailure",data:1});case he:return Ve(e,{linkDwellStartedAt:t.timestamp});case Se:return Ve(e,{action:"timing.PagePreviewsPreviewShow",data:t.timestamp-e.linkDwellStartedAt});case Ie:return Ve(e,{action:null,data:null});default:return e}}};var Ke=[".extiw",".mw-selflink",".image",".new",".internal",".external",".mw-cite-backlink a",".oo-ui-buttonedElement-button",".ve-ce-surface a",".cancelLink a",".mw-selflink-fragment",'[href^="#"]'];function ze(e){return function(t){if(t.target!==document){var n,r,o=(n=t.target,r=h.join(", "),n.closest(r));if(null!==o){var i=M(o,mw.config);i&&e(o,i,t)}}}}!function(){var e,t,n;t=mw.config,n=parseInt(t.get("wgPopupsFlags"),10),t.set("wgPopupsConflictsWithNavPopupGadget",!!(1&n)),t.set("wgPopupsConflictsWithRefTooltipsGadget",!!(2&n)),t.set("wgPopupsReferencePreviews",!!(4&n)),t.set("wgPopupsReferencePreviewsBetaFeature",!!(8&n));var o,s,c=a.compose,p=mw.user.generateRandomSessionId,d=O(mw.config),f=I(),w=(s=mw.storage,{isPagePreviewsEnabled:function(){return"0"!==s.get("mwe-popups-enabled")},storePagePreviewsEnabled:function(e){e?s.remove("mwe-popups-enabled"):s.set("mwe-popups-enabled","0")},isReferencePreviewsEnabled:function(){return"0"!==s.get("mwe-popups-referencePreviews-enabled")},storeReferencePreviewsEnabled:function(e){e?s.remove("mwe-popups-referencePreviews-enabled"):s.set("mwe-popups-referencePreviews-enabled","0"),mw.track("event.ReferencePreviewsPopups",{action:e?"anonymousEnabled":"anonymousDisabled"})}}),v=function(e,t,n){return n.get("wgPopupsReferencePreviews")?n.get("wgPopupsConflictsWithRefTooltipsGadget")||"minerva"===n.get("skin")?null:e.isAnon()?t.isReferencePreviewsEnabled():!!n.get("wgPopupsReferencePreviews")||("1"===mw.user.options.get("popups-reference-previews")||null):null}(mw.user,w,mw.config),b=Y(null!==v),x=(o=mw.experiments,{weightedBoolean:function(e,t,n){return"true"===o.getBucket({enabled:!0,name:e,buckets:{true:t,false:1-t}},n)}}),T=function(e,t,n){return function(e,t,n){var r=t.get("wgPopupsStatsvSamplingRate",0);return n.weightedBoolean("ext.Popups.statsv",r,e.sessionId())}(e,t,n)?mw.track:function(){}}(mw.user,mw.config,x),P=function(e){return e.get("wgPopupsVirtualPageViews")?mw.track:function(){}}(mw.config),k=(e={},i()(e,l.TYPE_PAGE,function(e,t,n){return n.get("wgPopupsConflictsWithNavPopupGadget")?null:e.isAnon()?t.isPagePreviewsEnabled():"1"===mw.user.options.get("popups")||null}(mw.user,w,mw.config)),i()(e,l.TYPE_REFERENCE,v),e);mw.config.get("debug")&&(c=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||c);var _,S,A,R=a.createStore(a.combineReducers(qe),c(a.applyMiddleware(u.a))),C=a.bindActionCreators(r,R.dispatch),j=function(e,t){var n,r=function(){};if(e.isAnon())r=function(e){e.preventDefault(),t.showSettings()};else{n=mw.Title.newFromText("Special:Preferences#mw-prefsection-rendering").getUrl()}return{settingsUrl:n,showSettings:r,previewDwell:t.previewDwell,previewAbandon:t.abandon,previewShow:t.previewShow,click:t.linkClick}}(mw.user,C);if(function(e,t,n,r,o,i,a){H(e,de.footerLink(t)),H(e,de.linkTitle()),H(e,de.render(o)),H(e,de.statsv(t,i)),H(e,de.syncUserSettings(n)),H(e,de.settings(t,r)),H(e,de.pageviews(t,a))}(R,C,w,b,j,T,P),C.boot(k,mw.user,w,mw.config,window.location.href),mw.popups=function(e,t,n,r){return{isEnabled:function(){return e.getState().preview.enabled[l.TYPE_PAGE]},register:function(e){var o=e.type,i=e.selector,a=e.gateway,s=e.renderFn,u=e.subTypes,c=e.init;if(!o||!i||!a)throw new Error('Registration of Popups custom preview type "'.concat(o,'" failed: You must specify a type, a selector, and a gateway.'));t(o,i),r(o,a),n(o,s),u&&u.forEach((function(e){n(e.type,e.renderFn)})),"function"==typeof c&&c()}}}(R,g,re,E),null!==k[l.TYPE_PAGE]){var N=Ke.join(", ");mw.popups.register({type:l.TYPE_PAGE,selector:"#mw-content-text a[href][title]:not(".concat(N,")"),gateway:d,renderFn:ie,subTypes:[{type:l.TYPE_DISAMBIGUATION,renderFn:se}]})}(null!==k[l.TYPE_REFERENCE]&&mw.popups.register({type:l.TYPE_REFERENCE,selector:'#mw-content-text .reference a[ href*="#" ]',gateway:f,renderFn:ue,init:function(){mw.config.get("wgPopupsReferencePreviews")&&navigator.sendBeacon&&mw.config.get("wgIsArticle")&&!K&&(K=!0,mw.track(z,{action:"pageview"}))}}),h.length)?(ee(),_=ze((function(e,t,n){var r=m(e),o=function(e){return y[e]}(r);if(o){var i=window.scrollY,a=e.getBoundingClientRect(),s={top:i+a.y,left:window.scrollX+a.x},u={pageX:n.pageX,pageY:n.pageY,clientY:n.clientY,width:e.offsetWidth,height:e.offsetHeight,offset:s,clientRects:e.getClientRects(),windowWidth:window.innerWidth,windowHeight:window.innerHeight,scrollTop:i};C.linkDwell(t,e,u,o,p,r)}})),S=ze((function(){C.abandon()})),A=ze((function(e){l.TYPE_PAGE===m(e)&&C.linkClick(e)})),document.addEventListener("mouseover",_),document.addEventListener("keyup",_),document.addEventListener("mouseout",S),document.addEventListener("blur",S),document.addEventListener("click",A)):mw.log.warn("ext.popups was loaded but everything is disabled")}(),window.Redux=a,window.ReduxThunk=s},"./src/ui/pointer-mask.svg":function(e,t){e.exports=''}}); //# sourceMappingURL=index.js.map.json