{"version":3,"sources":["webpack://mfModules.[name]/./src/mobile.startup/Toggler.js","webpack://mfModules.[name]/./src/mobile.startup/mobile.startup.js","webpack://mfModules.[name]/./src/mobile.startup/references/ReferencesDrawer.js","webpack://mfModules.[name]/./src/mobile.startup/search/MobileWebSearchLogger.js","webpack://mfModules.[name]/./src/mobile.startup/search/SearchOverlay.js","webpack://mfModules.[name]/./src/mobile.startup/search/schemaMobileWebSearch.js","webpack://mfModules.[name]/./src/mobile.startup/toc/TableOfContents.js"],"names":["browser","require","getSingleton","util","escapeHash","arrowOptions","name","additionalClassNames","Icon","Toggler","options","this","eventBus","_enable","$container","prefix","page","isClosed","getExpandedSections","expandedSections","JSON","parse","mw","storage","get","title","saveExpandedSections","set","stringify","expandStoredSections","toggler","$sectionHeading","$headline","find","each","parents","attr","hasClass","toggle","cleanObsoleteStoredSections","now","Date","getTime","Object","keys","forEach","sections","section","timestamp","Math","floor","prototype","$heading","indicator","wasExpanded","is","data","$content","next","toggleClass","remove","rotation","prependTo","aria-pressed","aria-expanded","emit","expanded","isReferenceSection","Boolean","isWideScreen","headline","isSectionOpen","storeSectionToggleState","reveal","selector","$target","length","prev","window","scrollTo","offset","top","e","tagName","expandSections","$link","self","collapseSectionsByDefault","config","checkHash","hash","location","indexOf","eq","prop","undefined","children","i","$indicator","id","addClass","tabindex","aria-haspopup","aria-controls","on","ev","target","href","preventDefault","replaceWith","$el","which","stopPropagation","enableKeyboardActions","internalRedirect","internalRedirectHash","split","checkInternalRedirectAndHash","getWindow","_getExpandedSections","_expandStoredSections","_cleanObsoleteStoredSections","module","exports","moduleLoader","schemaMobileWebSearch","mfExtend","context","time","View","PageGateway","Browser","Button","ReferencesDrawer","ReferencesGateway","ReferencesHtmlScraperGateway","ReferencesMobileViewGateway","icons","Page","Anchor","Skin","OverlayManager","Overlay","loadingOverlay","CtaDrawer","toast","Watchstar","rlModuleLoader","eventBusSingleton","toc","TableOfContents","notifications","overlay","search","SearchOverlay","MobileWebSearchLogger","SearchGateway","lazyImages","lazyImageLoader","talk","languageOverlay","mobileFrontend","define","subscribeMobileWebSearchSchema","Drawer","props","call","extend","className","events","click sup a","defaults","spinner","toHtmlString","cancelButton","cancel","citation","isSmall","hasText","label","msg","errorClassName","getClassName","show","apply","arguments","template","closeOnScroll","postRender","windowHeight","height","css","onShow","bind","onHide","getDocument","removeClass","showReference","refNumber","drawer","gateway","getReference","then","reference","render","text","err","ERROR_NOT_EXIST","hide","error","showNestedReference","$dest","userSessionToken","searchSessionToken","_newUserSession","user","generateRandomSessionId","_newSearchSession","searchSessionCreatedAt","onSearchShow","onSearchStart","track","action","timeOffsetSinceStart","onSearchResults","event","resultSetType","numberOfResults","results","timeToDisplayResults","onSearchResultClick","clickIndex","resultIndex","register","searchOverlay","logger","WatchstarPageList","feedbackLink","params","isBorderBox","input input","click .clear","click .search-content","click .overlay-content","click .overlay-content > div","touchstart .results","mousedown .results","click .results a","api","gatewayClass","router","templatePartials","header","content","icon","headerChrome","clearIcon","searchContentIcon","searchTerm","placeholderMsg","noResultsMsg","searchContentNoResultsMsg","message","feedback","prompt","onInputInput","performSearch","$clear","$input","val","onClickClear","trigger","onClickSearchContent","$form","parseHTML","type","value","appendTo","setTimeout","onClickOverlayContent","onClickOverlayContentDiv","hideKeyboardOnScroll","onClickResult","currentTarget","$result","closest","result","$results","index","originalEvent","back","timer","clearSearch","$spinner","clearTimeout","$searchContent","$searchFeedback","$resultContainer","searchData","delay","showKeyboard","len","setSelectionRange","query","isCached","lastQuery","_pendingQuery","abort","xhr","filter","funnel","pages","el","promise","resetSearch","empty","loader","using","Schema","eventLog","platform","platformVersion","getMode","trackSubscribe","topic","log","contentsMsg","tocHeading"],"mappings":"8KAAA,IAAIA,EAAUC,EAAS,mCAAcC,eACpCC,EAAOF,EAAS,gCAChBG,EAAaD,EAAKC,WAClBC,GACCC,KAAM,QACNC,qBAAsB,aAEvBC,EAAOP,EAAS,gCAsBjB,SAASQ,EAASC,GACjBC,KAAKC,SAAWF,EAAQE,S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nH,KAAM,WACT,IAMC7E,EAAwB,IAAIiM,EALnBxS,GAAGyS,SAASD,QAMpB,kBAEAxS,GAAGkE,OAAOhE,IAAK,6BAA8B,OAQ5CwS,SAAU,YACVC,gBAAiBlM,EAAQmM,YAI5B5S,GAAG6S,eAAgB,2BAA4B,SAAWC,EAAO5Q,GAChEqE,EAAsBwM,IAAK7Q,wEC7B9B,IAAIyE,EAAOhI,EAAS,gCACnB6H,EAAW7H,EAAS,oCACpBE,EAAOF,EAAS,gCAChBO,EAAOP,EAAS,gCAUjB,SAASqJ,EAAiBe,GACzBpC,EAAKqC,KAAM3J,KAAMR,EAAKoK,QACrBC,UAAW,aACX8J,YAAahT,GAAG8J,IAAK,QACnBf,IAGJvC,EAAUwB,EAAiBrB,GAK1B0H,kBACC4E,WAAYjT,GAAGoK,SAASlK,IAAK,iBAAkB,iCAMhDkK,SAAUpK,GAAGoK,SAASlK,IAAK,iBAAkB,yBAE7CoK,WAAY,WACX,IAAIpL,GACHF,KAAM,MACNC,qBAAsB,eACnBuG,IAAIhD,UAAWnD,KAAKmG,IAAI7E,KAAM,UAIpCyF,EAAOC,QAAU2B","file":"mobile.startup.js","sourcesContent":["var browser = require( './Browser' ).getSingleton(),\n\tutil = require( './util' ),\n\tescapeHash = util.escapeHash,\n\tarrowOptions = {\n\t\tname: 'arrow',\n\t\tadditionalClassNames: 'indicator'\n\t},\n\tIcon = require( './Icon' );\n\n/**\n *\n * @typedef {Object} ToggledEvent\n * @prop {boolean} expanded True if section is opened, false if closed.\n * @prop {Page} page\n * @prop {boolean} isReferenceSection\n * @prop {JQuery.Object} $heading\n */\n\n/**\n * A class for enabling toggling\n *\n * @class Toggler\n * @param {Object} options\n * @param {OO.EventEmitter} options.eventBus Object used to emit section-toggled events.\n * @param {jQuery.Object} options.$container to apply toggling to\n * @param {string} options.prefix a prefix to use for the id.\n * @param {Page} options.page to allow storage of session for future visits\n * @param {Page} [options.isClosed]\n */\nfunction Toggler( options ) {\n\tthis.eventBus = options.eventBus;\n\tthis._enable( options.$container, options.prefix, options.page, options.isClosed );\n}\n\n/**\n * Using the settings module looks at what sections were previously expanded on\n * existing page.\n *\n * @param {Page} page\n * @return {Object} representing open sections\n */\nfunction getExpandedSections( page ) {\n\tvar expandedSections = JSON.parse( mw.storage.get( 'expandedSections' ) || '{}' );\n\texpandedSections[page.title] = expandedSections[page.title] || {};\n\treturn expandedSections;\n}\n\n/**\n* @param {Object} expandedSections\n* Save expandedSections to localStorage\n*/\nfunction saveExpandedSections( expandedSections ) {\n\tmw.storage.set(\n\t\t'expandedSections', JSON.stringify( expandedSections )\n\t);\n}\n\n/**\n * Given an expanded heading, store it to localStorage.\n * If the heading is collapsed, remove it from localStorage.\n *\n * @param {jQuery.Object} $heading - A heading belonging to a section\n * @param {Page} page\n */\nfunction storeSectionToggleState( $heading, page ) {\n\tvar headline = $heading.find( 'span' ).attr( 'id' ),\n\t\tisSectionOpen = $heading.hasClass( 'open-block' ),\n\t\texpandedSections = getExpandedSections( page );\n\n\tif ( headline ) {\n\t\tif ( isSectionOpen ) {\n\t\t\texpandedSections[page.title][headline] = ( new Date() ).getTime();\n\t\t} else {\n\t\t\tdelete expandedSections[page.title][headline];\n\t\t}\n\n\t\tsaveExpandedSections( expandedSections );\n\t}\n}\n\n/**\n * Expand sections that were previously expanded before leaving this page.\n * @param {Toggler} toggler\n * @param {jQuery.Object} $container\n * @param {Page} page\n */\nfunction expandStoredSections( toggler, $container, page ) {\n\tvar $sectionHeading, $headline,\n\t\texpandedSections = getExpandedSections( page ),\n\t\t$headlines = $container.find( '.section-heading span' );\n\n\t$headlines.each( function () {\n\t\t$headline = $container.find( this );\n\t\t$sectionHeading = $headline.parents( '.section-heading' );\n\t\t// toggle only if the section is not already expanded\n\t\tif (\n\t\t\texpandedSections[page.title][$headline.attr( 'id' )] &&\n\t\t!$sectionHeading.hasClass( 'open-block' )\n\t\t) {\n\t\t\ttoggler.toggle( $sectionHeading, page );\n\t\t}\n\t} );\n}\n\n/**\n * Clean obsolete (saved more than a day ago) expanded sections from\n * localStorage.\n * @param {Page} page\n */\nfunction cleanObsoleteStoredSections( page ) {\n\tvar now = ( new Date() ).getTime(),\n\t\texpandedSections = getExpandedSections( page ),\n\t\t// the number of days between now and the time a setting was saved\n\t\tdaysDifference;\n\tObject.keys( expandedSections ).forEach( function ( page ) {\n\t\tvar sections = expandedSections[ page ];\n\t\t// clean the setting if it is more than a day old\n\t\tObject.keys( sections ).forEach( function ( section ) {\n\t\t\tvar timestamp = sections[ section ];\n\t\t\tdaysDifference = Math.floor( ( now - timestamp ) / 1000 / 60 / 60 / 24 );\n\t\t\tif ( daysDifference >= 1 ) {\n\t\t\t\tdelete expandedSections[page][section];\n\t\t\t}\n\t\t} );\n\t} );\n\tsaveExpandedSections( expandedSections );\n}\n\n/**\n * Given a heading, toggle it and any of its children\n *\n * @memberof Toggler\n * @instance\n * @param {jQuery.Object} $heading A heading belonging to a section\n */\nToggler.prototype.toggle = function ( $heading ) {\n\tvar indicator,\n\t\twasExpanded = $heading.is( '.open-block' ),\n\t\tpage = $heading.data( 'page' ),\n\t\t$content = $heading.next();\n\n\t$heading.toggleClass( 'open-block' );\n\t$heading.data( 'indicator' ).remove();\n\n\tarrowOptions.rotation = wasExpanded ? 0 : 180;\n\tindicator = new Icon( arrowOptions ).prependTo( $heading );\n\t$heading.data( 'indicator', indicator );\n\n\t$content\n\t\t.toggleClass( 'open-block' )\n\t\t.attr( {\n\t\t\t'aria-pressed': !wasExpanded,\n\t\t\t'aria-expanded': !wasExpanded\n\t\t} );\n\n\t/**\n\t * Global event emitted after a section has been toggled\n\t * @event section-toggled\n\t * @type {ToggledEvent}\n\t */\n\tthis.eventBus.emit( 'section-toggled', {\n\t\texpanded: wasExpanded,\n\t\tpage: page,\n\t\tisReferenceSection: Boolean( $content.attr( 'data-is-reference-section' ) ),\n\t\t$heading: $heading\n\t} );\n\n\tif ( !browser.isWideScreen() ) {\n\t\tstoreSectionToggleState( $heading, page );\n\t}\n};\n\n/**\n * Enables toggling via enter and space keys\n *\n * @param {Toggler} toggler instance.\n * @param {jQuery.Object} $heading\n */\nfunction enableKeyboardActions( toggler, $heading ) {\n\t$heading.on( 'keypress', function ( ev ) {\n\t\tif ( ev.which === 13 || ev.which === 32 ) {\n\t\t\t// Only handle keypresses on the \"Enter\" or \"Space\" keys\n\t\t\ttoggler.toggle( $heading );\n\t\t}\n\t} ).find( 'a' ).on( 'keypress mouseup', function ( ev ) {\n\t\tev.stopPropagation();\n\t} );\n}\n\n/**\n * Reveals an element and its parent section as identified by it's id\n *\n * @memberof Toggler\n * @instance\n * @param {string} selector A css selector that identifies a single element\n * @param {Object} $container jQuery element to search in\n */\nToggler.prototype.reveal = function ( selector, $container ) {\n\tvar $target, $heading;\n\n\t// jQuery will throw for hashes containing certain characters which can break toggling\n\ttry {\n\t\t$target = $container.find( escapeHash( selector ) );\n\t\t$heading = $target.parents( '.collapsible-heading' );\n\t\t// The heading is not a section heading, check if in a content block!\n\t\tif ( !$heading.length ) {\n\t\t\t$heading = $target.parents( '.collapsible-block' ).prev( '.collapsible-heading' );\n\t\t}\n\t\tif ( $heading.length && !$heading.hasClass( 'open-block' ) ) {\n\t\t\tthis.toggle( $heading );\n\t\t}\n\t\tif ( $heading.length ) {\n\t\t\t// scroll again after opening section (opening section makes the page longer)\n\t\t\twindow.scrollTo( 0, $target.offset().top );\n\t\t}\n\t} catch ( e ) {}\n};\n\n/**\n * Enables section toggling in a given container when wgMFCollapseSectionsByDefault\n * is enabled.\n *\n * @memberof Toggler\n * @instance\n * @param {jQuery.Object} $container to apply toggling to\n * @param {string} prefix a prefix to use for the id.\n * @param {Page} page to allow storage of session for future visits\n * @param {Page} [isClosed] whether the element should begin closed\n * @private\n */\nToggler.prototype._enable = function ( $container, prefix, page, isClosed ) {\n\tvar tagName, expandSections, indicator, $content,\n\t\t$firstHeading,\n\t\t$link,\n\t\tself = this,\n\t\tcollapseSectionsByDefault = mw.config.get( 'wgMFCollapseSectionsByDefault' );\n\n\t// Also allow .section-heading if some extensions like Wikibase\n\t// want to toggle other headlines than direct descendants of $container.\n\t$firstHeading = $container.find( '> h1,> h2,> h3,> h4,> h5,> h6,.section-heading' ).eq( 0 );\n\ttagName = $firstHeading.prop( 'tagName' ) || 'H1';\n\n\tif ( collapseSectionsByDefault === undefined ) {\n\t\t// Old default behavior if on cached output\n\t\tcollapseSectionsByDefault = true;\n\t}\n\texpandSections = !collapseSectionsByDefault || mw.storage.get( 'expandSections' ) === 'true';\n\n\t$container.children( tagName ).each( function ( i ) {\n\t\tvar isReferenceSection,\n\t\t\t$heading = $container.find( this ),\n\t\t\t$indicator = $heading.find( '.indicator' ),\n\t\t\tid = prefix + 'collapsible-block-' + i;\n\t\t// Be sure there is a div wrapping the section content.\n\t\t// Otherwise, collapsible sections for this page is not enabled.\n\t\tif ( $heading.next().is( 'div' ) ) {\n\t\t\t$content = $heading.next( 'div' );\n\t\t\tisReferenceSection = Boolean( $content.attr( 'data-is-reference-section' ) );\n\t\t\t$heading\n\t\t\t\t.addClass( 'collapsible-heading ' )\n\t\t\t\t.data( 'section-number', i )\n\t\t\t\t.data( 'page', page )\n\t\t\t\t.attr( {\n\t\t\t\t\ttabindex: 0,\n\t\t\t\t\t'aria-haspopup': 'true',\n\t\t\t\t\t'aria-controls': id\n\t\t\t\t} )\n\t\t\t\t.on( 'click', function ( ev ) {\n\t\t\t\t\t// don't toggle, if the click target was a link\n\t\t\t\t\t// (a link in a section heading)\n\t\t\t\t\t// See T117880\n\t\t\t\t\tif ( !ev.target.href ) {\n\t\t\t\t\t\t// prevent taps/clicks on edit button after toggling (bug 56209)\n\t\t\t\t\t\tev.preventDefault();\n\t\t\t\t\t\tself.toggle( $heading );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\tarrowOptions.rotation = expandSections ? 180 : 0;\n\t\t\tindicator = new Icon( arrowOptions );\n\t\t\tif ( $indicator.length ) {\n\t\t\t\t// replace the existing indicator\n\t\t\t\t$indicator.replaceWith( indicator.$el );\n\t\t\t} else {\n\t\t\t\tindicator.prependTo( $heading );\n\t\t\t}\n\t\t\t$heading.data( 'indicator', indicator.$el );\n\t\t\t$content\n\t\t\t\t.addClass( 'collapsible-block' )\n\t\t\t\t.eq( 0 )\n\t\t\t\t.attr( {\n\t\t\t\t\t// We need to give each content block a unique id as that's\n\t\t\t\t\t// the only way we can tell screen readers what element we're\n\t\t\t\t\t// referring to (aria-controls)\n\t\t\t\t\tid: id,\n\t\t\t\t\t'aria-pressed': 'false',\n\t\t\t\t\t'aria-expanded': 'false'\n\t\t\t\t} );\n\n\t\t\tenableKeyboardActions( self, $heading );\n\t\t\tif (\n\t\t\t\t!isReferenceSection && (\n\t\t\t\t\t!isClosed && browser.isWideScreen() || expandSections\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// Expand sections by default on wide screen devices\n\t\t\t\t// or if the expand sections setting is set.\n\t\t\t\t// The wide screen logic for determining whether to collapse sections initially\n\t\t\t\t// should be kept in sync with mobileoptions#initLocalStorageElements().\n\t\t\t\tself.toggle( $heading );\n\t\t\t}\n\t\t}\n\t} );\n\n\t/* eslint-disable no-restricted-properties */\n\t/**\n\t * Checks the existing hash and toggles open any section that contains the fragment.\n\t *\n\t * @method\n\t */\n\tfunction checkHash() {\n\t\tvar hash = window.location.hash;\n\t\tif ( hash.indexOf( '#' ) === 0 ) {\n\t\t\tself.reveal( hash, $container );\n\t\t}\n\t}\n\n\t/**\n\t * Checks the value of wgInternalRedirectTargetUrl and reveals the collapsed\n\t * section that contains it if present\n\t *\n\t * @method\n\t */\n\tfunction checkInternalRedirectAndHash() {\n\t\tvar internalRedirect = mw.config.get( 'wgInternalRedirectTargetUrl' ),\n\t\t\tinternalRedirectHash = internalRedirect ? internalRedirect.split( '#' )[1] : false;\n\n\t\tif ( internalRedirectHash ) {\n\t\t\twindow.location.hash = internalRedirectHash;\n\t\t\tself.reveal( internalRedirectHash, $container );\n\t\t}\n\t}\n\t/* eslint-enable no-restricted-properties */\n\n\tcheckInternalRedirectAndHash();\n\tcheckHash();\n\t// Restricted to links created by editors and thus outside our control\n\t// T166544 - don't do this for reference links - they will be handled elsewhere\n\t$link = $container.find( 'a:not(.reference a)' );\n\t$link.on( 'click', function () {\n\t\t// the link might be an internal link with a hash.\n\t\t// if it is check if we need to reveal any sections.\n\t\tif ( $link.attr( 'href' ) !== undefined &&\n\t\t$link.attr( 'href' ).indexOf( '#' ) > -1\n\t\t) {\n\t\t\tcheckHash();\n\t\t}\n\t} );\n\tutil.getWindow().on( 'hashchange', function () {\n\t\tcheckHash();\n\t} );\n\n\tif ( !browser.isWideScreen() && page ) {\n\t\texpandStoredSections( this, $container, page );\n\t\tcleanObsoleteStoredSections( page );\n\t}\n};\n\nToggler._getExpandedSections = getExpandedSections;\nToggler._expandStoredSections = expandStoredSections;\nToggler._cleanObsoleteStoredSections = cleanObsoleteStoredSections;\n\nmodule.exports = Toggler;\n","var\n\tmoduleLoader = require( './moduleLoaderSingleton' ),\n\tschemaMobileWebSearch = require( './search/schemaMobileWebSearch' );\n\n// Expose the entry chunk through libraryTarget and library. This allows\n// arbitrary file access via ResourceLoader like\n// `mfModules['mobile.startup'].moduleLoader.require('mobile.startup/LoadingOverlay')`.\nmodule.exports = {\n\tmoduleLoader: moduleLoader,\n\tmfExtend: require( './mfExtend' ),\n\tcontext: require( './context' ),\n\ttime: require( './time' ),\n\tutil: require( './util' ),\n\tView: require( './View' ),\n\tPageGateway: require( './PageGateway' ),\n\tBrowser: require( './Browser' ),\n\tButton: require( './Button' ),\n\tIcon: require( './Icon' ),\n\tReferencesDrawer: require( './references/ReferencesDrawer' ),\n\tReferencesGateway: require( './references/ReferencesGateway' ),\n\tReferencesHtmlScraperGateway: require( './references/ReferencesHtmlScraperGateway' ),\n\tReferencesMobileViewGateway: require( './references/ReferencesMobileViewGateway' ),\n\ticons: require( './icons' ),\n\tPage: require( './Page' ),\n\tAnchor: require( './Anchor' ),\n\tSkin: require( './Skin' ),\n\tOverlayManager: require( './OverlayManager' ),\n\tOverlay: require( './Overlay' ),\n\tloadingOverlay: require( './loadingOverlay' ),\n\tCtaDrawer: require( './CtaDrawer' ),\n\ttoast: require( './toast' ),\n\tWatchstar: require( './watchstar/Watchstar' ),\n\trlModuleLoader: require( './rlModuleLoader' ),\n\teventBusSingleton: require( './eventBusSingleton' ),\n\tToggler: require( './Toggler' ),\n\ttoc: {\n\t\tTableOfContents: require( './toc/TableOfContents' )\n\t},\n\tnotifications: {\n\t\toverlay: require( './notifications/overlay' )\n\t},\n\tsearch: {\n\t\tSearchOverlay: require( './search/SearchOverlay' ),\n\t\tMobileWebSearchLogger: require( './search/MobileWebSearchLogger' ),\n\t\tSearchGateway: require( './search/SearchGateway' )\n\t},\n\tlazyImages: {\n\t\tlazyImageLoader: require( './lazyImages/lazyImageLoader' )\n\t},\n\ttalk: {\n\t\toverlay: require( './talk/overlay' )\n\t},\n\tlanguageOverlay: require( './languageOverlay/languageOverlay' )\n};\n\nmw.mobileFrontend = moduleLoader;\n\n// Setup a single export for new modules to fold all of the above lines into.\n// One export to rule them all!\nmoduleLoader.define( 'mobile.startup', module.exports );\n\nschemaMobileWebSearch.subscribeMobileWebSearchSchema();\n","var Drawer = require( './../Drawer' ),\n\tutil = require( './../util' ),\n\ticons = require( './../icons' ),\n\tmfExtend = require( './../mfExtend' ),\n\tReferencesGateway = require( './ReferencesGateway' ),\n\tIcon = require( './../Icon' );\n\n/**\n * Drawer for references\n * @class ReferencesDrawer\n * @extends Drawer\n * @uses Icon\n * @param {Object} props\n */\nfunction ReferencesDrawer( props ) {\n\tDrawer.call(\n\t\tthis,\n\t\tutil.extend(\n\t\t\t{\n\t\t\t\tclassName: 'drawer position-fixed text references',\n\t\t\t\tevents: { 'click sup a': 'showNestedReference' }\n\t\t\t},\n\t\t\tprops\n\t\t)\n\t);\n}\n\nmfExtend( ReferencesDrawer, Drawer, {\n\t/**\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t * @mixes Drawer#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {string} defaults.cancelButton HTML of the button that closes the drawer.\n\t * @property {boolean} defaults.error whether an error message is being shown\n\t */\n\tdefaults: util.extend( {}, Drawer.prototype.defaults, {\n\t\tspinner: icons.spinner().toHtmlString(),\n\t\tcancelButton: icons.cancel( 'gray' ).toHtmlString(),\n\t\tcitation: new Icon( {\n\t\t\tisSmall: true,\n\t\t\tname: 'citation',\n\t\t\tadditionalClassNames: 'text',\n\t\t\thasText: true,\n\t\t\tlabel: mw.msg( 'mobile-frontend-references-citation' )\n\t\t} ).toHtmlString(),\n\t\terrorClassName: new Icon( {\n\t\t\tname: 'error',\n\t\t\thasText: true,\n\t\t\tisSmall: true\n\t\t} ).getClassName()\n\t} ),\n\t/**\n\t * @inheritdoc\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t */\n\tshow: function () {\n\t\treturn Drawer.prototype.show.apply( this, arguments );\n\t},\n\t/**\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t */\n\ttemplate: mw.template.get( 'mobile.startup', 'ReferencesDrawer.hogan' ),\n\t/**\n\t * @inheritdoc\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t */\n\tcloseOnScroll: false,\n\t/**\n\t * @inheritdoc\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tvar windowHeight = util.getWindow().height();\n\n\t\tDrawer.prototype.postRender.apply( this );\n\n\t\t// make sure the drawer doesn't take up more than 50% of the viewport height\n\t\tif ( windowHeight / 2 < 400 ) {\n\t\t\tthis.$el.css( 'max-height', windowHeight / 2 );\n\t\t}\n\n\t\tthis.on( 'show', this.onShow.bind( this ) );\n\t\tthis.on( 'hide', this.onHide.bind( this ) );\n\t},\n\t/**\n\t * Make body not scrollable\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t */\n\tonShow: function () {\n\t\tutil.getDocument().find( 'body' ).addClass( 'drawer-enabled' );\n\t},\n\t/**\n\t * Restore body scroll\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t */\n\tonHide: function () {\n\t\tutil.getDocument().find( 'body' ).removeClass( 'drawer-enabled' );\n\t},\n\t/**\n\t * Fetch and render nested reference upon click\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t * @param {string} id of the reference to be retrieved\n\t * @param {Page} page to locate reference for\n\t * @param {string} refNumber the number it identifies as in the page\n\t * @return {jQuery.Deferred}\n\t */\n\tshowReference: function ( id, page, refNumber ) {\n\t\tvar drawer = this,\n\t\t\tgateway = this.options.gateway;\n\n\t\t// Save the page in case we have to show a nested reference.\n\t\tthis.options.page = page;\n\t\t// If API is being used we want to show the drawer with the spinner while query runs\n\t\tdrawer.show();\n\t\treturn gateway.getReference( id, page ).then( function ( reference ) {\n\t\t\tdrawer.render( {\n\t\t\t\ttitle: refNumber,\n\t\t\t\ttext: reference.text\n\t\t\t} );\n\t\t}, function ( err ) {\n\t\t\tif ( err === ReferencesGateway.ERROR_NOT_EXIST ) {\n\t\t\t\tdrawer.hide();\n\t\t\t} else {\n\t\t\t\tdrawer.render( {\n\t\t\t\t\terror: true,\n\t\t\t\t\ttitle: refNumber,\n\t\t\t\t\ttext: mw.msg( 'mobile-frontend-references-citation-error' )\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\t/**\n\t * Fetch and render nested reference upon click\n\t * @memberof ReferencesDrawer\n\t * @instance\n\t * @param {jQuery.Event} ev\n\t * @return {boolean} False to cancel the native event\n\t */\n\tshowNestedReference: function ( ev ) {\n\t\tvar $dest = this.$el.find( ev.target );\n\n\t\tthis.showReference( $dest.attr( 'href' ), this.options.page, $dest.text() );\n\t\t// Don't hide the already shown drawer via propagation\n\t\t// and stop default scroll behaviour.\n\t\treturn false;\n\t}\n} );\n\nmodule.exports = ReferencesDrawer;\n","/**\n * Coordinates the logging of MobileWebSchema events.\n * Implements schema defined at https://meta.wikimedia.org/wiki/Schema:MobileWebSearch\n *\n * @class\n */\nfunction MobileWebSearchLogger() {\n\tthis.userSessionToken = null;\n\tthis.searchSessionToken = null;\n}\n\nMobileWebSearchLogger.prototype = {\n\t/**\n\t * Sets the internal state required to deal with logging user session\n\t * data.\n\t * @memberof MobileWebSearchLogger\n\t * @instance\n\t * @private\n\t */\n\t_newUserSession: function () {\n\t\tthis.userSessionToken = mw.user.generateRandomSessionId();\n\t},\n\n\t/**\n\t * Sets the internal state required to deal with logging search session\n\t * data.\n\t * @memberof MobileWebSearchLogger\n\t * @instance\n\t * @private\n\t */\n\t_newSearchSession: function () {\n\t\tthis.searchSessionToken = mw.user.generateRandomSessionId();\n\t\tthis.searchSessionCreatedAt = new Date().getTime();\n\t},\n\n\t/**\n\t * Handles the 'search-show' event.\n\t * @memberof MobileWebSearchLogger\n\t * @instance\n\t */\n\tonSearchShow: function () {\n\t\tthis._newUserSession();\n\t},\n\n\t/**\n\t * Handles the 'search-start' event.\n\t * @memberof MobileWebSearchLogger\n\t * @instance\n\t */\n\tonSearchStart: function () {\n\t\tthis._newSearchSession();\n\t\tmw.track( 'mf.schemaMobileWebSearch', {\n\t\t\taction: 'session-start',\n\t\t\tuserSessionToken: this.userSessionToken,\n\t\t\tsearchSessionToken: this.searchSessionToken,\n\t\t\ttimeOffsetSinceStart: 0\n\t\t} );\n\t},\n\n\t/**\n\t * Handles the 'search-results' event.\n\t * @memberof MobileWebSearchLogger\n\t * @instance\n\t * @param {Object} event with property {Object[]} event.results\n\t */\n\tonSearchResults: function ( event ) {\n\t\tvar timeOffsetSinceStart =\n\t\t\tnew Date().getTime() - this.searchSessionCreatedAt;\n\n\t\tmw.track( 'mf.schemaMobileWebSearch', {\n\t\t\taction: 'impression-results',\n\t\t\tresultSetType: 'prefix',\n\t\t\tnumberOfResults: event.results.length,\n\t\t\tuserSessionToken: this.userSessionToken,\n\t\t\tsearchSessionToken: this.searchSessionToken,\n\t\t\t// FIXME: Unless I'm mistaken, the timeToDisplayResults\n\t\t\t// property isn't necessary.\n\t\t\ttimeToDisplayResults: timeOffsetSinceStart,\n\t\t\ttimeOffsetSinceStart: timeOffsetSinceStart\n\t\t} );\n\t},\n\n\t/**\n\t * Handles the 'search-result-click' event.\n\t * @memberof MobileWebSearchLogger\n\t * @instance\n\t * @param {Object} event with property {number} event.index\n\t *  The zero-based index of the result in the set of results.\n\t */\n\tonSearchResultClick: function ( event ) {\n\t\tvar timeOffsetSinceStart =\n\t\t\tnew Date().getTime() - this.searchSessionCreatedAt;\n\n\t\tmw.track( 'mf.schemaMobileWebSearch', {\n\t\t\taction: 'click-result',\n\t\t\t// NOTE: clickIndex is 1-based.\n\t\t\tclickIndex: event.resultIndex + 1,\n\t\t\tuserSessionToken: this.userSessionToken,\n\t\t\tsearchSessionToken: this.searchSessionToken,\n\t\t\ttimeOffsetSinceStart: timeOffsetSinceStart\n\t\t} );\n\t}\n};\n\n/**\n * Convenience function that wires up an instance of the\n * MobileWebSearchLogger class to the search-* events emitted by the\n * search overlay.\n * @memberof MobileWebSearchLogger\n * @param {SearchOverlay} searchOverlay\n */\nMobileWebSearchLogger.register = function ( searchOverlay ) {\n\tvar logger = new MobileWebSearchLogger();\n\n\tsearchOverlay.on( 'search-show', logger.onSearchShow.bind( logger ) );\n\tsearchOverlay.on( 'search-start', logger.onSearchStart.bind( logger ) );\n\tsearchOverlay.on( 'search-results', logger.onSearchResults.bind( logger ) );\n\tsearchOverlay.on( 'search-result-click', logger.onSearchResultClick.bind( logger ) );\n};\n\nmodule.exports = MobileWebSearchLogger;\n","var\n\tmfExtend = require( '../mfExtend' ),\n\tOverlay = require( '../Overlay' ),\n\tutil = require( '../util' ),\n\tAnchor = require( '../Anchor' ),\n\tIcon = require( '../Icon' ),\n\tWatchstarPageList = require( '../watchstar/WatchstarPageList' ),\n\tSEARCH_DELAY = 300,\n\tSEARCH_SPINNER_DELAY = 2000,\n\tfeedbackLink = mw.config.get( 'wgCirrusSearchFeedbackLink' );\n\n/**\n * Overlay displaying search results\n * @class SearchOverlay\n * @extends Overlay\n * @uses SearchGateway\n * @uses Icon\n *\n * @param {Object} params Configuration options\n * @fires SearchOverlay#search-show\n * @fires SearchOverlay#search-start\n * @fires SearchOverlay#search-results\n * @fires SearchOverlay#search-result-click\n */\nfunction SearchOverlay( params ) {\n\tvar options = util.extend(\n\t\ttrue,\n\t\t{\n\t\t\tisBorderBox: false,\n\t\t\tclassName: 'overlay search-overlay',\n\t\t\tevents: {\n\t\t\t\t'input input': 'onInputInput',\n\t\t\t\t'click .clear': 'onClickClear',\n\t\t\t\t'click .search-content': 'onClickSearchContent',\n\t\t\t\t'click .overlay-content': 'onClickOverlayContent',\n\t\t\t\t'click .overlay-content > div': 'onClickOverlayContentDiv',\n\t\t\t\t'touchstart .results': 'hideKeyboardOnScroll',\n\t\t\t\t'mousedown .results': 'hideKeyboardOnScroll',\n\t\t\t\t'click .results a': 'onClickResult'\n\t\t\t}\n\t\t},\n\t\tparams\n\t);\n\n\tOverlay.call( this, options );\n\n\tthis.api = options.api;\n\t// eslint-disable-next-line new-cap\n\tthis.gateway = new options.gatewayClass( this.api );\n\n\tthis.router = options.router;\n}\n\nmfExtend( SearchOverlay, Overlay, {\n\t/**\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\ttemplatePartials: util.extend( {}, Overlay.prototype.templatePartials, {\n\t\theader: mw.template.get( 'mobile.startup', 'search/SearchHeader.hogan' ),\n\t\tcontent: mw.template.get( 'mobile.startup', 'search/SearchContent.hogan' ),\n\t\ticon: Icon.prototype.template\n\t} ),\n\t/**\n\t * @memberof SearchOverlay\n\t * @instance\n\t * @mixes Overlay#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {SearchGateway} defaults.gatewayClass The class to use to setup an API gateway.\n\t *  FIXME: Should be removed when wikidata descriptions in stable (T101719)\n\t * @property {Router} defaults.router instance\n\t * @property {Object} defaults.clearIcon options for the button that clears the search text.\n\t * @property {Object} defaults.searchContentIcon options for the button that allows you to\n\t *  search within content\n\t * @property {string} defaults.searchTerm Search text.\n\t * @property {string} defaults.placeholderMsg Search input placeholder text.\n\t * @property {string} defaults.clearMsg Tooltip for clear button that appears when you type\n\t * into search box.\n\t * @property {string} defaults.searchContentMsg Caption for a button performing full text\n\t * search of a given search query.\n\t * @property {string} defaults.noResultsMsg Message informing user that no pages were found\n\t * for a given query.\n\t * @property {string} defaults.searchContentNoResultsMsg Used when no pages with matching\n\t * titles were found.\n\t * @property {string} defaults.action The value of wgScript\n\t * @property {Object} defaults.feedback options for the feedback link\n\t *  below the search results\n\t */\n\tdefaults: util.extend( {}, Overlay.prototype.defaults, {\n\t\theaderChrome: true,\n\t\tclearIcon: new Icon( {\n\t\t\ttagName: 'button',\n\t\t\tname: 'search-clear',\n\t\t\tisSmall: true,\n\t\t\tlabel: mw.msg( 'mobile-frontend-clear-search' ),\n\t\t\tadditionalClassNames: 'clear'\n\t\t} ).options,\n\t\tsearchContentIcon: new Icon( {\n\t\t\ttagName: 'a',\n\t\t\t// When this icon is clicked we want to reset the hash for subsequent views\n\t\t\thref: '#',\n\t\t\tname: 'search-content',\n\t\t\tlabel: mw.msg( 'mobile-frontend-search-content' )\n\t\t} ).options,\n\t\tsearchTerm: '',\n\t\tplaceholderMsg: '',\n\t\tnoResultsMsg: mw.msg( 'mobile-frontend-search-no-results' ),\n\t\tsearchContentNoResultsMsg: mw.message( 'mobile-frontend-search-content-no-results' ).parse(),\n\t\taction: mw.config.get( 'wgScript' ),\n\t\tfeedback: !feedbackLink ? false : {\n\t\t\tfeedback: new Anchor( {\n\t\t\t\tlabel: mw.msg( 'mobile-frontend-search-feedback-link-text' ),\n\t\t\t\thref: feedbackLink\n\t\t\t} ).options,\n\t\t\tprompt: mw.msg( 'mobile-frontend-search-feedback-prompt' )\n\t\t}\n\t} ),\n\n\t/**\n\t * Make sure search header is docked to the top of the screen when the\n\t * user begins typing so that there is adequate space for search results\n\t * above the keyboard. (This is only a potential issue when sitenotices\n\t * are displayed.)\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tonInputInput: function () {\n\t\tthis.performSearch();\n\t\tthis.$clear.toggle( this.$input.val() !== '' );\n\t},\n\n\t/**\n\t * Initialize the button that clears the search field\n\t * @memberof SearchOverlay\n\t * @instance\n\t * @return {boolean} False to cancel the native event\n\t */\n\tonClickClear: function () {\n\t\tthis.$input.val( '' ).trigger( 'focus' );\n\t\tthis.performSearch();\n\t\tthis.$clear.hide();\n\t\t// In beta the clear button is on top of the search input.\n\t\t// Stop propagation so that the input doesn't receive the click.\n\t\treturn false;\n\t},\n\n\t/**\n\t * Initialize 'search within pages' functionality\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tonClickSearchContent: function () {\n\t\tvar $el = util.getDocument().find( 'body' ),\n\t\t\t$form = this.$el.find( 'form' );\n\n\t\t// Add fulltext input to force fulltext search\n\t\tthis.parseHTML( '<input>' )\n\t\t\t.attr( {\n\t\t\t\ttype: 'hidden',\n\t\t\t\tname: 'fulltext',\n\t\t\t\tvalue: 'search'\n\t\t\t} )\n\t\t\t.appendTo( $form );\n\t\t// history.back queues a task so might run after this call. Thus we use setTimeout\n\t\t// http://www.w3.org/TR/2011/WD-html5-20110113/webappapis.html#queue-a-task\n\t\tsetTimeout( function () {\n\t\t\t// Firefox doesn't allow submission of a form not in the DOM\n\t\t\t// so temporarily re-add it\n\t\t\t$form.appendTo( $el );\n\t\t\t$form.trigger( 'submit' );\n\t\t}, 0 );\n\t},\n\n\t/**\n\t * Tapping on background only should hide the overlay\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tonClickOverlayContent: function () {\n\t\tthis.$el.find( '.cancel' ).trigger( 'click' );\n\t},\n\n\t/**\n\t * Stop propagation\n\t * @memberof SearchOverlay\n\t * @instance\n\t * @param {jQuery.Event} ev\n\t */\n\tonClickOverlayContentDiv: function ( ev ) {\n\t\tev.stopPropagation();\n\t},\n\n\t/**\n\t * Hide the keyboard when scrolling starts (avoid weird situation when\n\t * user taps on an item, the keyboard hides and wrong item is clicked).\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\thideKeyboardOnScroll: function () {\n\t\tthis.$input.trigger( 'blur' );\n\t},\n\n\t/**\n\t * Handle the user clicking a result.\n\t *\n\t * @memberof SearchOverlay\n\t * @instance\n\t * @param {jQuery.Event} ev\n\t */\n\tonClickResult: function ( ev ) {\n\t\tvar $link = this.$el.find( ev.currentTarget ),\n\t\t\t$result = $link.closest( 'li' );\n\t\t/**\n\t\t * Fired when the user clicks a search result\n\t\t * @event SearchOverlay#search-result-click\n\t\t * @type {Object}\n\t\t * @property {jQuery.Object} result The jQuery-wrapped DOM element that\n\t\t *  the user clicked\n\t\t * @property {number} resultIndex The zero-based index of the\n\t\t *  result in the set of results\n\t\t * @property {jQuery.Event} originalEvent The original event\n\t\t */\n\t\tthis.emit( 'search-result-click', {\n\t\t\tresult: $result,\n\t\t\tresultIndex: this.$results.index( $result ),\n\t\t\toriginalEvent: ev\n\t\t} );\n\n\t\t// FIXME: ugly hack that removes search from browser history\n\t\t// when navigating to search results\n\t\tev.preventDefault();\n\t\tthis.router.back().then( function () {\n\t\t\t// Router.navigate does not support changing href.\n\t\t\t// FIXME: Needs upstream change T189173\n\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\twindow.location.href = $link.attr( 'href' );\n\t\t} );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tvar self = this,\n\t\t\ttimer;\n\n\t\tOverlay.prototype.postRender.call( this );\n\n\t\tthis.$input = this.$el.find( 'input' );\n\t\tthis.$clear = this.$el.find( '.clear' );\n\t\tthis.$searchContent = this.$el.find( '.search-content' ).hide();\n\t\tthis.$searchFeedback = this.$el.find( '.search-feedback' ).hide();\n\t\tthis.$resultContainer = this.$el.find( '.results-list-container' );\n\n\t\t/**\n\t\t * Hide the spinner and abort timed spinner shows.\n\t\t */\n\t\tfunction clearSearch() {\n\t\t\tself.$spinner.hide();\n\t\t\tclearTimeout( timer );\n\t\t}\n\n\t\t// Show a spinner on top of search results\n\t\tthis.$spinner = this.$el.find( '.spinner-container' );\n\t\tthis.on( 'search-start', function ( searchData ) {\n\t\t\tif ( timer ) {\n\t\t\t\tclearSearch();\n\t\t\t}\n\t\t\ttimer = setTimeout( function () {\n\t\t\t\tself.$spinner.show();\n\t\t\t}, SEARCH_SPINNER_DELAY - searchData.delay );\n\t\t} );\n\t\tthis.on( 'search-results', clearSearch );\n\n\t\t// Hide the clear button if the search input is empty\n\t\tif ( self.$input.val() === '' ) {\n\t\t\tthis.$clear.hide();\n\t\t}\n\t},\n\n\t/**\n\t * Trigger a focus() event on search input in order to\n\t * bring up the virtual keyboard.\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tshowKeyboard: function () {\n\t\tvar len = this.$input.val().length;\n\t\tthis.$input.trigger( 'focus' );\n\t\t// Cursor to the end of the input\n\t\tif ( this.$input[0].setSelectionRange ) {\n\t\t\tthis.$input[0].setSelectionRange( len, len );\n\t\t}\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tshow: function () {\n\t\t// Overlay#show defines the actual overlay visibility.\n\t\tOverlay.prototype.show.apply( this, arguments );\n\n\t\tthis.showKeyboard();\n\t\t/**\n\t\t * Fired after the search overlay is shown\n\t\t * @event SearchOverlay#search-show\n\t\t */\n\t\tthis.emit( 'search-show' );\n\t},\n\n\t/**\n\t * Perform search and render results inside current view.\n\t * FIXME: Much of the logic for caching and pending queries inside this function should\n\t * actually live in SearchGateway, please move out.\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tperformSearch: function () {\n\t\tvar\n\t\t\tself = this,\n\t\t\tapi = this.api,\n\t\t\tquery = this.$input.val(),\n\t\t\tdelay = this.gateway.isCached( query ) ? 0 : SEARCH_DELAY;\n\n\t\t// it seems the input event can be fired when virtual keyboard is closed\n\t\t// (Chrome for Android)\n\t\tif ( query !== this.lastQuery ) {\n\t\t\tif ( self._pendingQuery ) {\n\t\t\t\tself._pendingQuery.abort();\n\t\t\t}\n\t\t\tclearTimeout( this.timer );\n\n\t\t\tif ( query.length ) {\n\t\t\t\tthis.timer = setTimeout( function () {\n\t\t\t\t\tvar xhr;\n\t\t\t\t\t/**\n\t\t\t\t\t * Fired immediately before the search API request is sent\n\t\t\t\t\t * @event SearchOverlay#search-start\n\t\t\t\t\t * @property {Object} data related to the current search\n\t\t\t\t\t */\n\t\t\t\t\tself.emit( 'search-start', {\n\t\t\t\t\t\tquery: query,\n\t\t\t\t\t\tdelay: delay\n\t\t\t\t\t} );\n\n\t\t\t\t\txhr = self.gateway.search( query );\n\t\t\t\t\tself._pendingQuery = xhr.then( function ( data ) {\n\t\t\t\t\t\t// check if we're getting the rights response in case of out of\n\t\t\t\t\t\t// order responses (need to get the current value of the input)\n\t\t\t\t\t\tif ( data && data.query === self.$input.val() ) {\n\t\t\t\t\t\t\tself.$el.toggleClass( 'no-results', data.results.length === 0 );\n\t\t\t\t\t\t\tself.$searchContent\n\t\t\t\t\t\t\t\t.show()\n\t\t\t\t\t\t\t\t.find( 'p' )\n\t\t\t\t\t\t\t\t.hide()\n\t\t\t\t\t\t\t\t.filter( data.results.length ? '.with-results' : '.without-results' )\n\t\t\t\t\t\t\t\t.show();\n\n\t\t\t\t\t\t\t// eslint-disable-next-line no-new\n\t\t\t\t\t\t\tnew WatchstarPageList( {\n\t\t\t\t\t\t\t\tapi: api,\n\t\t\t\t\t\t\t\tfunnel: 'search',\n\t\t\t\t\t\t\t\tpages: data.results,\n\t\t\t\t\t\t\t\tel: self.$resultContainer\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tself.$results = self.$resultContainer.find( 'li' );\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Fired when search API returns results\n\t\t\t\t\t\t\t * @event SearchOverlay#search-results\n\t\t\t\t\t\t\t * @type {Object}\n\t\t\t\t\t\t\t * @property {Object[]} results The results returned by the search\n\t\t\t\t\t\t\t *  API\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tself.emit( 'search-results', {\n\t\t\t\t\t\t\t\tresults: data.results\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ).promise( { abort: function () { xhr.abort(); } } );\n\t\t\t\t}, delay );\n\t\t\t} else {\n\t\t\t\tself.resetSearch();\n\t\t\t}\n\n\t\t\tthis.lastQuery = query;\n\t\t}\n\t},\n\t/**\n\t * Clear results\n\t *\n\t * @private\n\t */\n\tresetSearch: function () {\n\t\tthis.$spinner.hide();\n\t\tthis.$searchContent.hide();\n\t\tthis.$searchFeedback.hide();\n\t\tthis.$resultContainer.empty();\n\t}\n} );\n\nmodule.exports = SearchOverlay;\n","var context = require( '../context' );\n\nfunction subscribeMobileWebSearchSchema() {\n\tmw.loader.using( [\n\t\t'ext.eventLogging.subscriber'\n\t] ).then( function () {\n\t\tvar // Schema provided by ext.eventLogging.subscriber class\n\t\t\tSchema = mw.eventLog.Schema, // resource-modules-disable-line\n\t\t\t/**\n\t\t * MobileWebSearch schema\n\t\t * https://meta.wikimedia.org/wiki/Schema:MobileWebSearch\n\t\t */\n\t\t\tschemaMobileWebSearch = new Schema(\n\t\t\t\t'MobileWebSearch',\n\t\t\t\t// todo: use a default value of 0 once config lands in production.\n\t\t\t\tmw.config.get( 'wgMFSchemaSearchSampleRate', 1 / 1000 ),\n\t\t\t\t/**\n\t\t\t * @property {Object} defaults Default options hash.\n\t\t\t * @property {string} defaults.platform Always \"mobileweb\"\n\t\t\t * @property {string} defaults.platformVersion The version of MobileFrontend\n\t\t\t *  that the user is using. One of \"stable\" or \"beta\"\n\t\t\t */\n\t\t\t\t{\n\t\t\t\t\tplatform: 'mobileweb',\n\t\t\t\t\tplatformVersion: context.getMode()\n\t\t\t\t}\n\t\t\t);\n\n\t\tmw.trackSubscribe( 'mf.schemaMobileWebSearch', function ( topic, data ) {\n\t\t\tschemaMobileWebSearch.log( data );\n\t\t} );\n\t} );\n}\n\nmodule.exports = {\n\tsubscribeMobileWebSearchSchema: subscribeMobileWebSearchSchema\n};\n","var View = require( '../View' ),\n\tmfExtend = require( '../mfExtend' ),\n\tutil = require( '../util' ),\n\tIcon = require( '../Icon' );\n\n/**\n * View for table of contents\n * @class TableOfContents\n * @extends View\n * @uses Icon\n * @param {Object} props\n * @param {Section[]} props.sections\n */\nfunction TableOfContents( props ) {\n\tView.call( this, util.extend( {\n\t\tclassName: 'toc-mobile',\n\t\tcontentsMsg: mw.msg( 'toc' )\n\t}, props ) );\n}\n\nmfExtend( TableOfContents, View, {\n\t/**\n\t * @memberof TableOfContents\n\t * @instance\n\t */\n\ttemplatePartials: {\n\t\ttocHeading: mw.template.get( 'mobile.startup', 'TableOfContentsHeading.hogan' )\n\t},\n\t/**\n\t * @memberof TableOfContents\n\t * @instance\n\t */\n\ttemplate: mw.template.get( 'mobile.startup', 'TableOfContents.hogan' ),\n\t/** @inheritdoc */\n\tpostRender: function () {\n\t\tnew Icon( {\n\t\t\tname: 'toc',\n\t\t\tadditionalClassNames: 'toc-button'\n\t\t} ).$el.prependTo( this.$el.find( 'h2' ) );\n\t}\n} );\n\nmodule.exports = TableOfContents;\n"],"sourceRoot":""}