silverstripe-webpack/app/client/dist/js/app.js.map
2018-06-23 17:27:06 +07:00

1 line
2.0 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["webpack:///js/app.js","webpack:///webpack/bootstrap bf4e87ea9ffc4b0f0978","webpack:///external \"jQuery\"","webpack:///./node_modules/bootstrap/js/dist/util.js?2617","webpack:///./app/client/src/js/_events.js","webpack:///./node_modules/popper.js/dist/esm/popper.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/hammerjs/hammer.js","webpack:///./app/client/src/js/app.js","webpack:///./app/client/src/js/_components/_ui.spinner.js","webpack:///./app/client/src/js/_components/_ui.carousel.js","webpack:///./app/client/src/js/_components/_ui.menu.js","webpack:///./app/client/src/js/_components/_ui.form.storage.js","webpack:///./app/client/src/js/_components/_ui.ajax.js","webpack:///./app/client/src/js/main.js","webpack:///./node_modules/bootstrap/js/dist/util.js","webpack:///./node_modules/bootstrap/js/dist/alert.js","webpack:///./node_modules/bootstrap/js/dist/button.js","webpack:///./node_modules/bootstrap/js/dist/carousel.js","webpack:///./node_modules/bootstrap/js/dist/collapse.js","webpack:///./node_modules/bootstrap/js/dist/dropdown.js","webpack:///./node_modules/bootstrap/js/dist/modal.js","webpack:///./node_modules/bootstrap/js/dist/tooltip.js","webpack:///./node_modules/bootstrap/js/dist/popover.js","webpack:///./node_modules/bootstrap/js/dist/tooltip.js?6cae","webpack:///./node_modules/bootstrap/js/dist/scrollspy.js","webpack:///./node_modules/bootstrap/js/dist/tab.js","webpack:///./node_modules/offcanvas-bootstrap/dist/js/bootstrap.offcanvas.js","webpack:///./node_modules/jquery-hammerjs/jquery.hammer.js","webpack:///./node_modules/pouchdb/dist/pouchdb.js","webpack:///./app/client/src/js/_components/routes/index.js","webpack:///./node_modules/routie/index.js","webpack:///./node_modules/path-browserify/index.js","webpack:///(webpack)/node_modules/process/browser.js","webpack:///./node_modules/smooth-scroll/dist/smooth-scroll.min.js","webpack:///./app/client/src/img nonrecursive \\.(png|jpe","webpack:///./app/client/src/img/icon-cfpb.png","webpack:///./app/client/src/img/icon-lender.png","webpack:///./app/client/src/img/logo.png","webpack:///./node_modules/font-awesome nonrecursive \\.(otf|eot|svg|ttf|woff|woff2)$"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","default","object","property","prototype","hasOwnProperty","p","s","jQuery","$","Util","toType","obj","toString","match","toLowerCase","getSpecialTransitionEndEvent","bindType","TRANSITION_END","delegateType","handle","event","target","is","this","handleObj","handler","apply","arguments","transitionEndEmulator","duration","_this","called","one","setTimeout","triggerTransitionEnd","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","find","length","err","getTransitionDurationFromElement","transitionDuration","css","parseFloat","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","nodeType","typeCheckConfig","componentName","config","configTypes","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","fn","emulateTransitionEnd","special","AJAX","LOADED","__webpack_exports__","global","microtaskDebounce","window","Promise","resolve","then","taskDebounce","scheduled","timeoutDuration","isFunction","functionToCheck","getType","getStyleComputedProperty","getComputedStyle","getParentNode","nodeName","parentNode","host","getScrollParent","body","ownerDocument","_getStyleComputedProp","overflow","overflowX","overflowY","isIE","version","isIE11","isIE10","getOffsetParent","documentElement","noOffsetParent","offsetParent","nextElementSibling","indexOf","isOffsetContainer","firstElementChild","getRoot","node","findCommonOffsetParent","element1","element2","order","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","start","end","range","createRange","setStart","setEnd","commonAncestorContainer","contains","element1root","getScroll","side","upperSide","html","scrollingElement","includeScroll","rect","subtract","scrollTop","scrollLeft","modifier","top","bottom","left","right","getBordersSize","styles","axis","sideA","sideB","getSize","computedStyle","max","getWindowSizes","height","width","getClientRect","offsets","_extends","getBoundingClientRect","e","result","sizes","clientWidth","clientHeight","horizScrollbar","offsetWidth","vertScrollbar","getOffsetRectRelativeToArbitraryNode","children","parent","fixedPosition","isHTML","childrenRect","parentRect","scrollParent","borderTopWidth","borderLeftWidth","marginTop","marginLeft","getViewportOffsetRectRelativeToArtbitraryNode","excludeScroll","relativeOffset","innerWidth","innerHeight","isFixed","getFixedPositionOffsetParent","parentElement","el","getBoundaries","popper","reference","padding","boundariesElement","boundaries","boundariesNode","_getWindowSizes","getArea","_ref","computeAutoPlacement","placement","refRect","rects","sortedAreas","keys","map","key","area","sort","a","b","filteredAreas","filter","_ref2","computedPlacement","variation","getReferenceOffsets","state","getOuterSizes","x","marginBottom","y","marginRight","getOppositePlacement","hash","replace","matched","getPopperOffsets","referenceOffsets","popperRect","popperOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","arr","check","Array","findIndex","prop","cur","runModifiers","modifiers","data","ends","slice","forEach","function","console","warn","enabled","update","isDestroyed","instance","arrowStyles","attributes","flipped","options","positionFixed","flip","originalPlacement","position","isCreated","onUpdate","onCreate","isModifierEnabled","modifierName","some","getSupportedPropertyName","prefixes","upperProp","charAt","toCheck","style","destroy","removeAttribute","willChange","disableEventListeners","removeOnDestroy","removeChild","getWindow","defaultView","attachToScrollParents","callback","scrollParents","isBody","addEventListener","passive","push","setupEventListeners","updateBound","scrollElement","eventsEnabled","enableEventListeners","scheduleUpdate","removeEventListeners","removeEventListener","cancelAnimationFrame","isNumeric","isNaN","isFinite","setStyles","unit","setAttributes","setAttribute","applyStyle","arrowElement","applyStyleOnLoad","modifierOptions","computeStyle","legacyGpuAccelerationOption","gpuAcceleration","offsetParentRect","floor","round","prefixedProperty","invertTop","invertLeft","x-placement","arrow","isModifierRequired","requestingName","requestedName","requesting","isRequired","_requesting","requested","_data$offsets$arrow","querySelector","_data$offsets","isVertical","len","sideCapitalized","altSide","opSide","arrowElementSize","center","popperMarginSide","popperBorderSide","sideValue","min","getOppositeVariation","clockwise","counter","index","validPlacements","concat","reverse","placementOpposite","flipOrder","behavior","BEHAVIORS","FLIP","CLOCKWISE","COUNTERCLOCKWISE","step","refOffsets","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariation","flipVariations","keepTogether","toValue","str","parseOffset","offset","basePlacement","useHeight","fragments","frag","trim","divider","search","splitRegex","ops","op","mergeWithPrevious","reduce","index2","preventOverflow","transformProp","popperStyles","transform","priority","primary","escapeWithReference","secondary","shift","shiftvariation","shiftOffsets","hide","bound","inner","subtractLength","isBrowser","longerTimeoutBrowsers","navigator","userAgent","supportsMicroTasks","debounce","MSInputMethodContext","documentMode","classCallCheck","Constructor","TypeError","createClass","defineProperties","props","descriptor","writable","protoProps","staticProps","assign","source","placements","onLoad","Defaults","Popper","requestAnimationFrame","bind","jquery","Utils","PopperUtils","Ot","g","Function","eval","__WEBPACK_AMD_DEFINE_RESULT__","exportName","undefined","setTimeoutContext","timeout","context","bindFn","invokeArrayArg","arg","isArray","each","iterator","deprecate","method","message","deprecationMessage","stack","log","inherit","child","base","properties","childP","baseP","create","constructor","_super","boolOrFn","val","args","TYPE_FUNCTION","ifUndefined","val1","val2","addEventListeners","types","splitStr","type","hasParent","inStr","inArray","src","findByKey","toArray","uniqueArray","results","values","prefixed","camelProp","VENDOR_PREFIXES","uniqueId","_uniqueId","getWindowForElement","doc","parentWindow","Input","manager","self","inputTarget","domHandler","ev","enable","init","createInputInstance","inputClass","SUPPORT_POINTER_EVENTS","PointerEventInput","SUPPORT_ONLY_TOUCH","TouchInput","SUPPORT_TOUCH","TouchMouseInput","MouseInput","inputHandler","eventType","input","pointersLen","pointers","changedPointersLen","changedPointers","isFirst","INPUT_START","isFinal","INPUT_END","INPUT_CANCEL","session","computeInputData","emit","recognize","prevInput","pointersLength","firstInput","simpleCloneInputData","firstMultiple","offsetCenter","getCenter","timeStamp","now","deltaTime","angle","getAngle","distance","getDistance","computeDeltaXY","offsetDirection","getDirection","deltaX","deltaY","overallVelocity","getVelocity","overallVelocityX","overallVelocityY","abs","scale","getScale","rotation","getRotation","maxPointers","computeIntervalInputData","srcEvent","offsetDelta","prevDelta","velocity","velocityX","velocityY","direction","last","lastInterval","COMPUTE_INTERVAL","v","clientX","clientY","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","p1","p2","PROPS_XY","sqrt","atan2","PI","PROPS_CLIENT_XY","evEl","MOUSE_ELEMENT_EVENTS","evWin","MOUSE_WINDOW_EVENTS","pressed","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","store","pointerEvents","SingleTouchInput","evTarget","SINGLE_TOUCH_TARGET_EVENTS","SINGLE_TOUCH_WINDOW_EVENTS","started","normalizeSingleTouches","all","touches","changed","changedTouches","TOUCH_TARGET_EVENTS","targetIds","getTouches","allTouches","INPUT_MOVE","identifier","targetTouches","changedTargetTouches","touch","mouse","primaryTouch","lastTouches","recordTouches","eventData","setLastTouch","lastTouch","lts","removeLastTouch","splice","DEDUP_TIMEOUT","isSyntheticEvent","t","dx","dy","DEDUP_DISTANCE","TouchAction","set","cleanTouchActions","actions","TOUCH_ACTION_NONE","hasPanX","TOUCH_ACTION_PAN_X","hasPanY","TOUCH_ACTION_PAN_Y","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_AUTO","Recognizer","defaults","id","STATE_POSSIBLE","simultaneous","requireFail","stateStr","STATE_CANCELLED","STATE_ENDED","STATE_CHANGED","STATE_BEGAN","directionStr","getRecognizerByNameIfManager","otherRecognizer","recognizer","AttrRecognizer","PanRecognizer","pX","pY","PinchRecognizer","PressRecognizer","_timer","_input","RotateRecognizer","SwipeRecognizer","TapRecognizer","pTime","pCenter","count","Hammer","recognizers","preset","Manager","handlers","oldCssProps","touchAction","toggleCssProps","item","add","recognizeWith","requireFailure","cssProps","triggerDomEvent","gestureEvent","createEvent","initEvent","gesture","dispatchEvent","TEST_ELEMENT","createElement","Date","output","nextKey","extend","dest","merge","MOBILE_REGEX","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","DIRECTION_ALL","MOUSE_INPUT_MAP","mousedown","mousemove","mouseup","button","which","pointerType","POINTER_INPUT_MAP","pointerdown","pointermove","pointerup","pointercancel","pointerout","IE10_POINTER_TYPE_ENUM","2","3","4","5","MSPointerEvent","PointerEvent","removePointer","eventTypeNormalized","isTouch","storeIndex","pointerId","SINGLE_TOUCH_INPUT_MAP","touchstart","touchmove","touchend","touchcancel","TOUCH_INPUT_MAP","inputEvent","inputData","isMouse","sourceCapabilities","firesTouchEvents","PREFIXED_TOUCH_ACTION","NATIVE_TOUCH_ACTION","TOUCH_ACTION_MAP","touchMap","cssSupports","CSS","supports","compute","getTouchAction","join","preventDefaults","prevented","preventDefault","hasNone","isTapPointer","isTapMovement","isTapTouchTime","preventSrc","STATE_RECOGNIZED","dropRecognizeWith","dropRequireFailure","hasRequireFailures","canRecognizeWith","additionalEvent","tryEmit","canEmit","inputDataClone","reset","process","attrTest","optionPointers","isRecognized","isValid","threshold","directionTest","hasMoved","inOut","time","validPointers","validMovement","validTime","clearTimeout","taps","interval","posThreshold","validTouchTime","failTimeout","validInterval","validMultiTap","tapCount","VERSION","domEvents","userSelect","touchSelect","touchCallout","contentZooming","userDrag","tapHighlightColor","stop","force","stopped","curRecognizer","existing","remove","on","events","off","STATE_FAILED","Tap","Pan","Swipe","Pinch","Rotate","Press","_classCallCheck","_ui_carousel__classCallCheck","_ui_menu__classCallCheck","_ui_form_storage__classCallCheck","_ui_ajax__classCallCheck","main__classCallCheck","importAll","r","external__jQuery_","external__jQuery__default","_events","_events_default","_createClass","SpinnerUI","show","_ui_spinner","_ui_carousel__createClass","_ui_menu__createClass","CarouselUI","dispose","$e","attr","$items","$indicators","append","prepend","carousel","hammer","_ui_form_storage__createClass","NAME","DATA_KEY","SlidingMenu","_element","$element","addClass","click","removeClass","removeData","_jQueryInterface","noConflict","JQUERY_NO_CONFLICT","ready","jsSlidingMenu","_typeof","STORAGE","localStorage","FormStorage","$elements","getItem","change","setItem","submit","clear","jsFormStorage","Symbol","_ui_ajax__createClass","_ui_ajax_AjaxUI","G","D","$Html","$Body","AjaxUI","$this","parents","load","url","MainUI","updateLocation","absoluteLocation","URLDetails","relative","substring","location","href","history","pushState","ajax","page","title","sync","async","dataType","cache","error","jqXHR","statusText","ga","success","status","getResponseHeader","js","regions","replaceRegion","preload","$head","eventName","items","Deferred","promise","dfds","dfd","always","when","$region","empty","jsAjaxUI","Title","ClassName","onpopstate","$existingLink","hasClass","_ui_ajax","w","smooth_scroll_min","smooth_scroll_min_default","main__createClass","smoothScroll","W","$AlertNotify","$SiteWideMessage","visibilityState","updateOnlineStatus","onLine","ScrollTo","animateScroll","speed","setInterval","complete","datastatus","reload","loadImages","getScript","fonts","WebFont","google","families","print","substr","msg","cls","fadeOut","alert","fadeIn","play","$imgs","$imgUrls","$imgLazyUrls","lazySrc","_defineProperties","Selector","DISMISS","Event","CLOSE","CLOSED","CLICK_DATA_API","ALERT","FADE","SHOW","Alert","_proto","close","rootElement","_getRootElement","_triggerCloseEvent","isDefaultPrevented","_removeElement","closest","closeEvent","_destroyElement","detach","_handleDismiss","alertInstance","ACTIVE","BUTTON","FOCUS","DATA_TOGGLE_CARROT","DATA_TOGGLE","INPUT","FOCUS_BLUR_DATA_API","Button","toggle","triggerChangeEvent","addAriaPressed","checked","activeElement","hasAttribute","classList","focus","toggleClass","_objectSpread","ownKeys","getOwnPropertySymbols","sym","getOwnPropertyDescriptor","_defineProperty","EVENT_KEY","Default","keyboard","slide","pause","wrap","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHEND","LOAD_DATA_API","CAROUSEL","ITEM","ACTIVE_ITEM","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","Carousel","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","_config","_getConfig","_indicatorsElement","_addEventListeners","next","_slide","nextWhenVisible","hidden","prev","cycle","clearInterval","to","activeIndex","_getItemIndex","_this2","_keydown","tagName","makeArray","_getItemByDirection","isNextDirection","isPrevDirection","lastItemIndex","delta","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","_setActiveIndicatorElement","nextIndicator","directionalClassName","orderClassName","_this3","activeElementIndex","nextElement","nextElementIndex","isCycling","slidEvent","action","_dataApiClickHandler","slideIndex","$carousel","SHOWN","HIDE","HIDDEN","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","ACTIVES","Collapse","_isTransitioning","_triggerArray","tabToggles","elem","_selector","_parent","_getParent","_addAriaAndCollapsedClass","actives","activesData","not","startEvent","dimension","_getDimension","setTransitioning","capitalizedDimension","scrollSize","$elem","isTransitioning","_getTargetFromElement","triggerArray","isOpen","currentTarget","$trigger","$target","REGEXP_KEYDOWN","ARROW_UP_KEYCODE","CLICK","KEYDOWN_DATA_API","KEYUP_DATA_API","DISABLED","DROPUP","DROPRIGHT","DROPLEFT","MENURIGHT","MENULEFT","POSITION_STATIC","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","AttachmentMap","TOP","TOPEND","BOTTOM","BOTTOMEND","RIGHTEND","LEFTEND","boundary","display","Dropdown","_popper","_menu","_getMenuElement","_inNavbar","_detectNavbar","disabled","_getParentFromElement","isActive","_clearMenus","showEvent","referenceElement","_getPopperConfig","noop","stopPropagation","_getPlacement","$parentDropdown","offsetConf","popperConfig","toggles","dropdownMenu","hideEvent","_dataApiKeydownHandler","backdrop","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","SCROLLBAR_MEASURER","BACKDROP","OPEN","DIALOG","DATA_DISMISS","FIXED_CONTENT","STICKY_CONTENT","NAVBAR_TOGGLER","Modal","_dialog","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_scrollbarWidth","_checkScrollbar","_setScrollbar","_adjustDialog","_setEscapeEvent","_setResizeEvent","_showBackdrop","_showElement","transition","_hideModal","handleUpdate","ELEMENT_NODE","appendChild","_enforceFocus","shownEvent","transitionComplete","_this4","has","_this5","_this6","_this7","_resetAdjustments","_resetScrollbar","_removeBackdrop","_this8","animate","className","appendTo","backdropTransitionDuration","callbackRemove","_backdropTransitionDuration","isModalOverflowing","scrollHeight","paddingLeft","paddingRight","_getScrollbarWidth","_this9","actualPadding","calculatedPadding","actualMargin","calculatedMargin","margin","scrollDiv","scrollbarWidth","_this10","BSCLS_PREFIX_REGEX","animation","template","delay","container","fallbackPlacement","AUTO","HoverState","OUT","INSERTED","FOCUSOUT","TOOLTIP","TOOLTIP_INNER","ARROW","Trigger","HOVER","MANUAL","Tooltip","_isEnabled","_timeout","_hoverState","_activeTrigger","tip","_setListeners","disable","toggleEnabled","dataKey","_getDelegateConfig","_isWithActiveTrigger","_enter","_leave","getTipElement","isWithContent","isInTheDom","tipId","setContent","attachment","_getAttachment","addAttachmentClass","_handlePopperPlacementChange","_fixTransition","prevHoverState","_cleanTipClass","getTitle","CLASS_PREFIX","$tip","setElementContent","content","text","eventIn","eventOut","_fixTitle","titleType","tabClass","initConfigAnimation","_inheritsLoose","subClass","superClass","__proto__","TITLE","CONTENT","Popover","_Tooltip","_getContent","ACTIVATE","SCROLL","DROPDOWN_ITEM","DROPDOWN_MENU","DATA_SPY","NAV_LIST_GROUP","NAV_LINKS","NAV_ITEMS","LIST_ITEMS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","ScrollSpy","_scrollElement","_offsets","_targets","_activeTarget","_scrollHeight","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targetSelector","targetBCR","pageYOffset","_getOffsetHeight","maxScroll","_activate","_clear","queries","$link","scrollSpys","$spy","tab","ACTIVE_UL","DROPDOWN_ACTIVE_CHILD","Tab","previous","listElement","itemSelector","hiddenEvent","activeElements","active","_transitionComplete","dropdownChild","dropdownElement","__webpack_provided_window_dot_jQuery","__bind","me","Offcanvas","OffcanvasDropdown","OffcanvasTouch","_clickEvent","nav","dropdown","offcanvas","_getFade","_getCss","_touchEnd","_touchMove","_touchStart","endThreshold","startThreshold","outerWidth","maxStartThreshold","currentX","fade","startX","originalEvent","pageX","outerHeight","sendEvents","_clearCss","bodyOverflow","-webkit-transform","-webkit-transition-duration","-moz-transform","-moz-transition","-o-transform","-o-transition","opacity","_sendEventsAfter","_sendEventsBefore","_documentClicked","_close","_open","_clicked","_navbarHeight","_transformSupported","clickedEl","asSupport","regex","translate3D","cssText","bsOffcanvas","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","factory","hammerify","$el","originalEmit","require","f","define","u","code","1","_dereq_","argsArray","fun","useColors","WebkitAppearance","firebug","exception","table","parseInt","$1","formatArgs","namespace","humanize","diff","color","lastC","save","namespaces","storage","removeItem","debug","env","DEBUG","chrome","local","colors","formatters","j","JSON","stringify","9","selectColor","charCodeAt","createDebug","curr","ms","prevTime","coerce","unshift","format","formatter","instances","names","skips","8","EventEmitter","_maxListeners","isNumber","isObject","isUndefined","defaultMaxListeners","setMaxListeners","er","listeners","addListener","listener","newListener","warned","trace","once","removeListener","fired","list","removeAllListeners","listenerCount","evlistener","emitter","nextTick","draining","oldQueue","queue","immediate","task","scheduleDrain","Mutation","MutationObserver","WebKitMutationObserver","observer","createTextNode","observe","characterData","setImmediate","MessageChannel","scriptEl","onreadystatechange","channel","port1","onmessage","port2","postMessage","6","ctor","superCtor","super_","TempCtor","7","INTERNAL","resolver","PENDING","outcome","safelyResolveThenable","QueueItem","onFulfilled","onRejected","callFulfilled","otherCallFulfilled","callRejected","otherCallRejected","unwrap","func","returnValue","reject","getThen","thenable","onError","onSuccess","tryToUnwrap","tryCatch","out","reason","iterable","resolved","resolveFromAll","outValue","race","response","REJECTED","FULFILLED","catch","parse","String","exec","h","fmtShort","fmtLong","plural","ceil","long","defaultSetTimout","defaultClearTimeout","runTimeout","cachedSetTimeout","runClearTimeout","marker","cachedClearTimeout","cleanUpNextTick","currentQueue","queueIndex","drainQueue","run","Item","array","browser","argv","versions","prependListener","prependOnceListener","binding","cwd","chdir","dir","umask","10","amd","glob","SparkMD5","md5cycle","k","md5blk","md5blks","md5blk_array","md51","tail","tmp","lo","hi","md51_array","subarray","Uint8Array","rhex","hex_chr","hex","toUtf8","unescape","encodeURIComponent","utf8Str2ArrayBuffer","returnUInt8Array","buff","ArrayBuffer","arrayBuffer2Utf8Str","fromCharCode","concatenateArrayBuffers","first","second","byteLength","buffer","hexToBinaryString","bytes","clamp","num","targetArray","sourceArray","begin","appendBinary","contents","_buff","_length","_hash","raw","ret","_finish","getState","setState","hashBinary","11","v1","v4","uuid","14","15","12","bytesToUuid","buf","bth","byteToHex","13","getRandomValues","crypto","msCrypto","rnds8","rnds","_nodeId","clockseq","_clockseq","seedBytes","rng","msecs","getTime","nsecs","_lastNSecs","dt","_lastMSecs","tl","tmh","ii","16","pop","metaStack","lastMetaElement","lastElementIndex","arrayPrefix","objPrefix","res","collationIndex","parsedNum","numChar","parsedString","lastCh","numConsecutiveSlashes","ch","arrayElement","objElement","17","_interopDefault","ex","isBinaryObject","Blob","cloneArrayBuffer","cloneBinaryObject","size","webkitSlice","isPlainObject","proto","getPrototypeOf","Ctor","funcToString","objectCtorString","clone","newObject","toISOString","getArguments","toPromise","usedCB","PouchPromise","fulfill","resp","mesg","logApiCall","logArgs","origCallback","responseArgs","adapterFun","_closed","_destroyed","taskqueue","isReady","addTask","failed","mangle","unmangle","Map$1","_store","Set$1","pick","identityFunction","formatResultForOpenRevsGet","ok","bulkGet","db","opts","collapseResultsAndFinish","perDocResults","docs","info","checkDone","numDone","numDocs","gotResult","docIndex","nextBatch","allRequests","upTo","MAX_NUM_CONCURRENT_REQUESTS","batch","processBatch","docId","docIdx","docRequests","requestsById","docOpts","open_revs","request","rev","formatResult","param","requests","ExportedMap","isChromeApp","hasLocalStorage","hasLocal","attachBrowserEvents","onChanged","db_name","dbName","newValue","attachEvent","Changes","_listeners","guardedConsole","randomNumber","maxTimeout","defaultBackOff","explainError","PouchError","createError","CustomPouchError","generateErrorFromResponse","UNKNOWN_ERROR","tryFilter","req","BAD_REQUEST","filterChange","hasFilter","query","query_params","filterReturn","include_docs","attachments","att","_attachments","stub","flatten","arrs","invalidIdError","INVALID_ID","RESERVED_ID","MISSING_ID","isRemote","_remote","ee","parseDesignDocFunctionName","parts","normalizeDesignDocFunctionName","normalized","parseUri","parser","uri","encoded","decodeURIComponent","qName","qParser","$0","$2","scopeEval","scope","upsert","diffFun","docRev","_rev","newDoc","updated","_id","tryAndPut","put","uuidV4","winningRev","metadata","winningId","winningPos","winningDeleted","toVisit","rev_tree","tree","ids","branches","pos","deleted","traverseRevTree","revs","newCtx","ctx","sortByPos","collectLeaves","leaves","isLeaf","acc","collectConflicts","win","conflicts","leaf","compactTree","revHash","rootToLeaf","paths","sortByPos$1","binarySearch","comparator","mid","low","high","insertSorted","idx","pathToTree","path","numStemmed","root","currentLeaf","compareTree","mergeTree","in_tree1","in_tree2","tree1","tree2","merged","doMerge","dontExpand","restree","branch","t1","t2","candidateParents","trees","parentIdx","elements","elementsLen","stem","depth","stemmedRevs","stemmed","newTree","revExists","splitRev","targetPos","targetId","getTrees","isDeleted","isLocalId","latest","historyNode","historyRev","tryCatchInChangeListener","pending","lastSeq","Changes$2","onDestroy","cancel","onChange","isCancelled","validateChanges","processChange","changeList","changes","_conflicts","compare","yankError","cleanDocs","_deleted","atts","compareByIdThenRev","idCompare","_revisions","computeHeight","edges","prnt","rev$$1","edge","allDocsKeysParse","skip","limit","descending","doNextCompaction","_compactionQueue","last_seq","_compact","attachmentNameError","AbstractPouchDB","TaskQueue$1","parseAdapter","adapter","adapters","PouchDB","preferredAdapters","adapterName","use_prefix","prepareForDestruction","onDestroyed","from_constructor","onClosed","__opts","auto_compaction","prefixedName","backend","_adapter","valid","fail","debugPouch","logs","logId","getFieldFromDoc","parsedField","compare$1","parseField","fieldName","fields","current","isCombinationalField","field","combinationFields","getKey","getValue","mergeAndedSelectors","selectors","matcher","$eq","fieldMatchers","operator","mergeGtGte","mergeLtLte","mergeNe","mergeEq","$gte","$gt","$lte","$lt","$ne","massageSelector","wasAnded","$and","orOrNor","subSelector","$not","pad","padWith","upToLength","targetLength","padLeft","collate","normalizeKey","ai","bi","stringCollate","arrayCollate","objectCollate","Infinity","origKey","toJSON","indexify","numToIndexableString","toIndexableString","objKey","SEP","parseNumber","originalIdx","neg","numAsString","magAsString","MAGNITUDE_DIGITS","magnitude","MIN_MAGNITUDE","parseIndexableString","parsedStr","ak","bk","expFormat","toExponential","magForComparison","magString","factor","factorStr","toFixed","createFieldSorter","getFieldValuesAsArray","sorting","aRow","bRow","aFieldValues","bFieldValues","collation","filterInMemoryFields","rows","requestDef","inMemoryFields","row","rowFilter","fieldSorter","every","docFieldValue","matchCominationalSelector","matchSelector","userOperator","userValue","orMatchers","matchers","fieldExists","fieldIsNotUndefined","modField","divisor","mod","arrayContainsValue","arrayContainsAllValues","arraySize","regexMatch","typeMatch","matchesSelector","rowsMatched","evalFilter","evalView","validate","filterName","normalize","view","shouldFilter","changesHandler","doc_ids","viewName","ddoc","mapFun","views","MISSING_DOC","doChanges","filterFun","filters","applyChangesFilterPlugin","_changesFilterPlugin","toObject","parseRevisionInfo","INVALID_REV","makeRevTreeFromRevisions","revisions","revisionIds","parseDoc","newEdits","nRevNum","newRevId","revInfo","_rev_tree","specialKey","reservedWords","DOC_VALIDATION","dataWords","createBlob","Builder","BlobBuilder","MSBlobBuilder","MozBlobBuilder","WebKitBlobBuilder","builder","getBlob","binaryStringToArrayBuffer","bin","binStringToBluffer","binString","b64ToBluffer","b64","thisAtob","arrayBufferToBinaryString","binary","readAsBinaryString","blob","FileReader","FileReaderSync","readAsArrayBuffer","reader","hasBinaryString","onloadend","blobToBinaryString","blobOrBuffer","blobToBase64","base64","thisBtoa","rawToBase64","sliceBlob","appendBlob","arrayBuffer","appendString","string","binaryMd5","setImmediateShim","loadNextChunk","done","currentChunk","chunkSize","chunks","inputIsString","MD5_CHUNK_SIZE","Md5","stringMd5","parseBase64","BAD_ARG","preprocessString","blobType","asBinary","content_type","digest","preprocessBlob","md5","preprocessAttachment","preprocessAttachments","docInfos","docv","overallErr","docInfo","processedAttachment","recv","updateDoc","revLimit","cb","writeDoc","previousWinningRev","previouslyDeleted","isRoot","REV_CONFLICT","newRev","rev_map","newRevIsDeleted","winningRev$$1","winningRevIsDeleted","rootIsMissing","processDocs","api","fetchedDocs","tx","overallCallback","insertDoc","resultsIdx","checkAllDocsDone","docsDone","docsToDo","new_edits","idsToDocs","currentDoc","docWritten","nextDoc","safeJsonParse","vuvuzela","safeJsonStringify","json","idbError","evt","IDB_ERROR","encodeMetadata","deletedOrLocal","seq","decodeMetadata","storedObject","decodeDoc","_doc_id_rev","lastIndexOf","readBlobData","asBlob","fetchAttachmentsIfNecessary","txn","fetchAttachment","attObj","objectStore","ATTACH_STORE","onsuccess","postProcessAttachments","attNames","$inject_Object_assign","compactRevs","deleteOrphanedAttachments","possiblyOrphanedDigests","attAndSeqStore","IDBKeyRange","attStore","delete","seqStore","BY_SEQ_STORE","ATTACH_AND_SEQ_STORE","openCursor","only","cursor","digestSeq","primaryKey","continue","openTransactionSafely","idb","stores","mode","transaction","idbBulkDocs","dbOpts","startTransaction","DOC_STORE","LOCAL_STORE","META_STORE","txnResult","onabort","ontimeout","oncomplete","docStore","bySeqStore","attachStore","attachAndSeqStore","metaStore","metaDoc","updateDocCountIfReady","verifyAttachments","preconditionErrored","fetchExistingDocs","onAllDocsProcessed","allDocsProcessed","idbProcessDocs","revs_limit","docCount","docCountDelta","numFetched","readMetadata","changesHandler$$1","notify","_meta","verifyAttachment","MISSING_STUB","finish","digests","filename","attErr","isUpdate","writeAttachments","finishDoc","afterPutDoc","revsToDelete","metadataToStore","afterPutMetadata","afterPutDocError","insertAttachmentMappings","putReq","onerror","collectResults","attachmentSaved","revpos","saveAttachment","attsAdded","attsToAdd","newAtt","docInfoError","blobSupport","runBatchedCursor","keyRange","batchSize","onBatch","onGetAll","valuesBatch","keysBatch","pseudoCursor","onGetAllKeys","continuePseudoCursor","newKeyRange","lastKey","upper","upperOpen","lowerBound","getAll","getAllKeys","onCursor","allDocsKeys","createKeyRange","inclusiveEnd","upperBound","idbAllDocs","fetchDocAsynchronously","docIdRevIndex","allDocsInner","batchValues","batchValue","batchKeys","onResultsReady","returnVal","total_rows","update_seq","updateSeq","onTxnComplete","keyRangeError","startkey","endkey","inclusive_end","maxKey","checkBlobSupport","blob$$1","DETECT_BLOB_SUPPORT_STORE","matchedChrome","matchedEdge","countDocs","tryCode","applyNext","running","enqueueTask","processMetadataAndWinningDoc","winningDoc","filtered","numResults","returnDocs","onBatchDone","winningDocs","metadatas","fetchWinningDocAndMetadata","onGetMetadata","docIdRev","docIds","docIdsToMetadata","continuous","ExportedSet","since","return_docs","objectStores","IdbPouch","thisCallback","createSchema","createObjectStore","keyPath","autoIncrement","createIndex","unique","addDeletedOrLocalIndex","createLocalStoreSchema","migrateLocalStore","localStore","seqCursor","addAttachAndSeqStore","migrateAttsAndSeqs","digestMap","migrateMetadata","decodeMetadataCompat","onGetMetadataSeq","metadataSeq","instanceId","_bulkDocs","reqOpts","_get","attachId","blobData","_info","doc_count","idb_attachment_format","_allDocs","_changes","cachedDBs","_getRevisionTree","_doCompaction","_getLocal","_putLocal","oldRev","oStore","oldDoc","_removeLocal","_destroy","openReq","openReqList","indexedDB","deleteDatabase","cached","tryStorageOption","open","ADAPTER_VERSION","onupgradeneeded","migration","migrations","oldVersion","completeSetup","storedMetaDoc","storeMetaDocIfReady","instanceKey","onversionchange","blobSupportPromise","IDBPouch","decodeUtf8","escape","hexToInt","charCode","parseHexUtf8","parseHexUtf16","parseHexString","encoding","quote","escapeBlob","unescapeBlob","stringifyDoc","unstringifyDoc","qMarks","select","joiner","where","orderBy","compactRevs$1","deleteOrphans","seqs","sql","ATTACH_AND_SEQ_STORE$1","executeSql","digestsToCheck","nonOrphanedDigests","ATTACH_STORE$1","BY_SEQ_STORE$1","websqlError","errorNameMatch","errorName","errorReason","WSQ_ERROR","websqlBulkDocs","websqlChanges","_name","cnt","sqlArgs","deletedInt","insertId","dataWritten","fetchSql","attachmentErr","revsToCompact","DOC_STORE$1","metadataStr","params","websqlProcessDocs","userDocs","docInfoErrors","openDatabaseWithOpts","websql","description","openDBSafely","openDB","cachedResult","cachedDatabases","fetchAttachmentsIfNecessary$1","attOpts","_","WebSqlPouch","dbCreated","runMigration2","DOC_STORE_WINNINGSEQ_INDEX_SQL","BY_SEQ_STORE_DELETED_INDEX_SQL","runMigration3","LOCAL_STORE$1","doNext","runMigration4","updateRows","doc_id_rev","doc_id","BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL","runMigration5","nextPage","SELECT_DOCS","DOC_STORE_AND_BY_SEQ_JOINER","pageSize","digestSeqs","digestSeqPairs","pair","attachAndRev","ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL","ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL","runMigration6","runMigration7","checkEncoding","onGetInstanceId","idRequests","onGetVersion","dbVersion","meta","META_STORE$1","attach","initSeq","initSeqArgs","ADAPTER_VERSION$1","setupDone","dbid","tasks","nextMigration","fetchVersion","db_version","getMaxSeq","latest$$1","websqlOpts","POUCH_VERSION","openDBResult","readTransaction","theSeq","theDocCount","websql_encoding","latestRev","totalRows","criteria","destinctKeys","bindingStr","selectStmt","reportChange","maxSeq","escaped","putLocal","rowsAffected","removeLocal","canOpenTestDB","openDatabase","isValidWebSQL","hasLS","localStorageKey","openedTestDB","openDB$2","WebSQLPouch","_opts","WebSqlPouch$1","wrappedFetch","wrappedPromise","fetch","fetchRequest","timer","headers","Headers","fetchOptions","credentials","processData","fetchResponse","statusCode","abort","xhRequest","xhr","timedout","abortReq","cleanUp","timeoutReq","onprogress","upload","XMLHttpRequest","withCredentials","Accept","responseType","setRequestHeader","readyState","responseText","send","hasXhr","defaultBody","ajaxCore","missing","ajax$1","ua","isSafari","isTrident","isEdge","shouldCacheBust","hasArgs","pool","promiseFactories","runNext","runNextBatch","thisErr","readAttachmentsAsBlobOrBuffer","encodeDocId","preprocessAttachments$2","hasUrlPrefix","protocol","getHost","user","password","auth","username","genDBUrl","genUrl","pathDel","port","paramsToStr","HttpPouch","userOpts","reqAjax","ajaxOpts","defaultHeaders","_ajax","ajaxPromise","adapterFun$$1","setup","skipSetup","skip_setup","setupPromise","dbUrl","encodeAttachmentId","attachmentId","nAuth","token","Authorization","uuid$$1","compact","ping","compact_running","doBulkGet","doBulkGetShim","MAX_SIMULTANEOUS_REVS","numBatches","subOpts","batchNum","supportsBulkGet","supportsBulkGetMap","fetchAttachments","filenames","fetchAllAttachments","docOrDocs","revs_info","docOrId","optsOrRev","getAttachment","removeAttachment","putAttachment","Content-Type","_put","allDocs","start_key","end_key","paramStr","batch_size","CHANGES_BATCH_SIZE","heartbeat","DEFAULT_HEARTBEAT","requestTimeout","CHANGES_TIMEOUT_BUFFER","leftToFetch","feed","seq_interval","param_name","lastFetchedSeq","aborted","xhrOpts","fetched","raw_results_length","finished","revsDiff","HttpPouch$1","QueryParseError","captureStackTrace","NotFoundError","BuiltInError","promisedCallback","callbackify","fin","finalPromiseFactory","sequentialize","promiseFactory","that","uniq","theSet","mapToKeysArray","createBuiltInError","sum","jLen","jNum","evalFunctionWithEval","TaskQueue$2","createViewSignature","reduceFun","createView","sourceDB","temporary","localDocName","cachedViews","viewSignature","_cachedViews","promiseForView","diffFunction","fullViewName","depDbs","depDbName","registerDependentDatabase","lastSeqDoc","parseViewName","isGenOne","emitError","getBuiltIn","reduceFunString","builtInReduce","_sum","_count","_stats","mapper","origMap","reducer","ddocValidator","abstract","viewCleanup","isGenOne$1","fileHasChanged","localDoc","remoteDoc","getDocAttachments","getDocAttachmentsFromTargetOrSource","doCheckForLocalAttachments","createBulkGetOpts","diffs","missingRev","getDocs","getAllDocs","bulkGetOpts","bulkGetResponse","cancelled","bulkGetInfo","resultDocs","hasAttachments","hasConflicts","fetchRevisionOneDocs","getRevisionOneDocs","returnResult","updateCheckpoint","checkpoint","session_id","replicator","REPLICATOR","CHECKPOINT_VERSION","CHECKPOINT_HISTORY_SIZE","Checkpointer","compareReplicationLogs","srcDoc","tgtDoc","compareReplicationHistory","sourceHistory","targetHistory","S","sourceRest","T","targetRest","hasSessionId","LOWEST_SEQ","sessionId","rest","isForbiddenError","backOff","retry","back_off_function","backOffSet","current_back_off","STARTING_BACK_OFF","removeBackOffSetter","sortObjectPropertiesByKey","queryParams","generateReplicationId","filterViewName","queryData","md5sum","replicate","initCheckpointer","checkpointer","repId","checkpointOpts","writeSourceCheckpoint","writeTargetCheckpoint","writeDocs","changedDocs","currentBatch","bulkOpts","bulkDocs","completeReplication","errorsById","errorsNo","doc_write_failures","docs_written","errors","finishBatch","outResult","writingCheckpoint","writeCheckpoint","getChanges","onCheckpointError","getDiffs","getBatchDocs","got","docs_read","startNextBatch","batches","processPendingBatch","abortReplication","pendingBatch","changesOpts","live","changesCompleted","replicationCompleted","fatalError","end_time","onChangesComplete","changesPending","onChangesError","abortChanges","batches_limit","_abortChanges","startChanges","getCheckpoint","start_time","_addedListeners","Replication","toPouch","PouchConstructor","replicateWrapper","replicateRet","sync$1","Sync","pullChange","pushChange","pushDenied","pullDenied","pushPaused","pullPaused","pushActive","pullActive","removeAll","isChange","isDenied","isPaused","removed","addOneListener","canceled","optsPush","optsPull","pull","replication","replicateMethods","other","lie","inherits","mangled","Map","Set","species","eventFunction","inprogress","notifyLocalWindows","nextSource","MISSING_BULK_DOCS","QUERY_PARSE_ERROR","NOT_AN_OBJECT","newPromise","post","putDoc","oldRevId","oldRevNum","newRevNum","createAttachment","prevrevpos","was_delete","addToMissing","revId","processDoc","missingForId","missingObj","compactDocument","maxHeight","revTree","candidates","promises","onComplete","finishOpenRevs","splittedRev","revNo","currentPath","hashIndex","indexOfRev","howMany","_revs_info","incompatibleOpt","_type","attachmentError","dependentDb","dependentDbs","depDB","destroyDb","usePrefix","deletedMap","trueName","execute","eventEmitter","Pouch","destructListeners","_destructionListeners","dbList","addToPreferredAdapters","plugin","__defaults","defaultOpts","PouchAlt","$elemMatch","$allMatch","$exists","$mod","neValue","$in","$nin","$size","$all","$regex","$type","atob","btoa","platform","hasFetch","persistentQueues","tempViewQueue","CHANGES_BATCH_SIZE$1","sumsqr","_sumsqr","tryMap","tryReduce","rereduce","sortByKeyThenValue","keyCompare","sliceResults","rowToDocId","postprocessAttachments","addHttpParam","paramName","asJson","coerceInteger","integerCandidate","asNumber","Number","coerceOptions","group_level","checkPositiveInteger","number","checkQueryParseError","startkeyName","endkeyName","group","optionName","httpQuery","keysAsString","customQuery","_query","customViewCleanup","_viewCleanup","defaultsTo","getDocsToPersist","docIdsToChangesAndEmits","getKeyValueDocs","processKeyValueDocs","kvDocsRes","kvDocs","oldKeys","indexableKeysToKeyValues","keyValue","newKeys","kvDoc","metaDocId","defaultMetaDoc","docData","saveKeyValues","listOfDocsToPersist","docsToPersist","getQueue","updateView","updateViewInQueue","mapResults","processNextBatch","currentSeq","createDocIdsToChangesAndEmits","createIndexableKeysToKeyValues","emittedKeyValue","complexKey","reduceView","shouldGroup","groups","lvl","POSITIVE_INFINITY","groupKey","reduceTry","queryView","queryViewInQueue","fetchFromView","viewOpts","expectedKeys","parsedKeyAndDocId","onMapResultsReady","finalResults","shouldReduce","allDocsRes","docIdsToDocs","fetchPromises","keyStart","keyEnd","httpViewCleanup","localViewCleanup","docsToViews","designDocName","viewsToStatus","ddocName","viewDBNames","statusIsGood","viewDBName","dbsToDelete","destroyPromises","queryPromised","stale","abstractQuery","mapreduce","updateTarget","updateSource","comparisons","targetDoc","sourceDoc","cleanup","_readyCalled","__WEBPACK_IMPORTED_MODULE_0__events__","__WEBPACK_IMPORTED_MODULE_0__events___default","__WEBPACK_IMPORTED_MODULE_1_routie__","__WEBPACK_IMPORTED_MODULE_1_routie___default","navigation","carousel:id:num","methods","__slice","_map","subpath","normalizeArray","allowAboveRoot","up","xs","splitPathRe","splitPath","resolvedPath","resolvedAbsolute","isAbsolute","trailingSlash","fromParts","toParts","samePartsLength","outputParts","sep","delimiter","dirname","basename","ext","extname","ignore","header","topOnEmptyHash","clip","easing","customEasing","updateURL","popstate","emitEvents","Element","matchMedia","matches","InvalidCharacterError","offsetTop","anchor","outline","scrollTo","CustomEvent","bubbles","detail","E","O","I","cancelScroll","C","L","A","H","q","Q","metaKey","ctrlKey","hostname","pathname","webpackContext","webpackContextResolve","./icon-cfpb.png","./icon-lender.png","./logo.png","webpackEmptyContext"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,KACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,KAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,gBACAC,cACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAAiB,SAC3B,WAAiC,MAAAjB,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAS,EAAAC,GAAsD,MAAAT,QAAAU,UAAAC,eAAAlB,KAAAe,EAAAC,IAGtDvB,EAAA0B,EAAA,mBAGA1B,IAAA2B,EAAA,KDMM,SAAUvB,EAAQD,GEnExBC,EAAAD,QAAAyB,QFyEM,SAAUxB,EAAQD,EAASH,aGzEjC6B,GAMA,GAAAC,GAAA,SAAAD,GAUA,QAAAE,GAAAC,GACA,SAAaC,SAAA1B,KAAAyB,GAA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,EAAA/hF,KAAA3e,GAAA0gG,OlC810BzhK7hG,KAAKJ,EAASH,EAAoB,KAIzD,SAAUI,EAAQD,EAASH,GmC910BjC,QAAAgjG,GAAA1zC,GACA,MAAAtvD,GAAAijG,EAAA3zC,IAEA,QAAA2zC,GAAA3zC,GACA,GAAAvmC,GAAA3a,EAAAkhD,EACA,MAAAvmC,EAAA,GACA,SAAArjB,OAAA,uBAAA4pD,EAAA,KACA,OAAAvmC,GAZA,GAAA3a,IACA80F,kBAAA,GACAC,oBAAA,GACAC,aAAA,GAWAJ,GAAA70F,KAAA,WACA,MAAArN,QAAAqN,KAAAC,IAEA40F,EAAA18F,QAAA28F,EACA7iG,EAAAD,QAAA6iG,EACAA,EAAAj6E,GAAA,InCy20BM,SAAU3oB,EAAQD,GoC530BxBC,EAAAD,QAAA,wBpCk40BM,SAAUC,EAAQD,GqCl40BxBC,EAAAD,QAAA,0BrCw40BM,SAAUC,EAAQD,GsCx40BxBC,EAAAD,QAAA,mBtC840BM,SAAUC,EAAQD,GuC940BxB,QAAAkjG,GAAA/zC,GACA,SAAA5pD,OAAA,uBAAA4pD,EAAA,MAEA+zC,EAAAl1F,KAAA,WAAuC,UACvCk1F,EAAA/8F,QAAA+8F,EACAjjG,EAAAD,QAAAkjG,EACAA,EAAAt6E,GAAA","file":"js/app.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"app/client/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 6);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = jQuery;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($) {/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Util = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined; // eslint-disable-line no-undefined\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $(this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator;\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || '';\n }\n\n try {\n var $selector = $(document).find(selector);\n return $selector.length > 0 ? selector : null;\n } catch (err) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $(element).css('transition-duration');\n var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END);\n },\n // TODO: Remove in v5\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n }\n };\n setTransitionEndSupport();\n return Util;\n}($);\n//# sourceMappingURL=util.js.map\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = Util;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n/**\n * Add your global events here\n */\n\nmodule.exports = {\n AJAX: 'ajax-load',\n LOADED: 'load'\n};\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* WEBPACK VAR INJECTION */(function(global) {/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.14.3\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nvar longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\nvar timeoutDuration = 0;\nfor (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n timeoutDuration = 1;\n break;\n }\n}\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var css = getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\nvar isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nvar isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nfunction isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);\n}\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);\n}\n\nfunction getWindowSizes() {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};\n var width = sizes.width || element.clientWidth || result.right - result.left;\n var height = sizes.height || element.clientHeight || result.bottom - result.top;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth, 10);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && parent.nodeName === 'HTML') {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop, 10);\n var marginLeft = parseFloat(styles.marginLeft, 10);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return isFixed(getParentNode(element));\n}\n\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nfunction getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n var el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n // NOTE: 1 DOM access here\n\n var boundaries = { top: 0, left: 0 };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n boundaries.left += padding;\n boundaries.top += padding;\n boundaries.right -= padding;\n boundaries.bottom -= padding;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var styles = getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger onUpdate callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n // Avoid blurry text by using full pixel integers.\n // For pixel-perfect positioning, top/bottom prefers rounded\n // values, while left/right prefers floored values.\n var offsets = {\n left: Math.floor(popper.left),\n top: Math.round(popper.top),\n bottom: Math.round(popper.bottom),\n right: Math.floor(popper.right)\n };\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n top = -offsetParentRect.height + offsets.bottom;\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n left = -offsetParentRect.width + offsets.right;\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n var _data$offsets$arrow;\n\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-right` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.<br />\n * It will read the variation of the `placement` property.<br />\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unitless, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.<br />\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the height.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.<br />\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.<br />\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * An scenario exists where the reference itself is not within the boundaries.<br />\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper this makes sure the popper has always a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier, can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near eachothers\n * without leaving any gap between the two. Expecially useful when the arrow is\n * enabled and you want to assure it to point to its reference element.\n * It cares only about the first axis, you can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjuction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations).\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position,\n * the popper will never be placed outside of the defined boundaries\n * (except if keepTogether is enabled)\n */\n boundariesElement: 'viewport'\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define you own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the informations used by Popper.js\n * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements.\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overriden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass as 3rd argument an object with the same\n * structure of this object, example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.<br />\n * By default, is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated, this callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.<br />\n * By default, is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Create a new Popper.js instance\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedule an update, it will run on the next UI update available\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.<br />\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Popper);\n//# sourceMappingURL=popper.js.map\n\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4)))\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nvar g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.7 - 2016-04-22\n * http://hammerjs.github.io/\n *\n * Copyright (c) 2016 Jorik Tangelder;\n * Licensed under the MIT license */\n(function(window, document, exportName, undefined) {\n 'use strict';\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = document.createElement('div');\n\nvar TYPE_FUNCTION = 'function';\n\nvar round = Math.round;\nvar abs = Math.abs;\nvar now = Date.now;\n\n/**\n * set a timeout with a given scope\n * @param {Function} fn\n * @param {Number} timeout\n * @param {Object} context\n * @returns {number}\n */\nfunction setTimeoutContext(fn, timeout, context) {\n return setTimeout(bindFn(fn, context), timeout);\n}\n\n/**\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\nfunction invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n return false;\n}\n\n/**\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n}\n\n/**\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\\n' + message + ' AT \\n';\n return function() {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '')\n .replace(/^\\s+at\\s+/gm, '')\n .replace(/^Object.<anonymous>\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n\n var log = window.console && (window.console.warn || window.console.log);\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n return method.apply(this, arguments);\n };\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\nif (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n };\n} else {\n assign = Object.assign;\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\nvar extend = deprecate(function extend(dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n while (i < keys.length) {\n if (!merge || (merge && dest[keys[i]] === undefined)) {\n dest[keys[i]] = src[keys[i]];\n }\n i++;\n }\n return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\nvar merge = deprecate(function merge(dest, src) {\n return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\nfunction inherit(child, base, properties) {\n var baseP = base.prototype,\n childP;\n\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign(childP, properties);\n }\n}\n\n/**\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n}\n\n/**\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\nfunction boolOrFn(val, args) {\n if (typeof val == TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n return val;\n}\n\n/**\n * use the val2 when val1 is undefined\n * @param {*} val1\n * @param {*} val2\n * @returns {*}\n */\nfunction ifUndefined(val1, val2) {\n return (val1 === undefined) ? val2 : val1;\n}\n\n/**\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction addEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.addEventListener(type, handler, false);\n });\n}\n\n/**\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction removeEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.removeEventListener(type, handler, false);\n });\n}\n\n/**\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n while (node) {\n if (node == parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}\n\n/**\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n return str.indexOf(find) > -1;\n}\n\n/**\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n\n/**\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n while (i < src.length) {\n if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\n return i;\n }\n i++;\n }\n return -1;\n }\n}\n\n/**\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\nfunction uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function sortUniqueArray(a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n}\n\n/**\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\nfunction prefixed(obj, property) {\n var prefix, prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n\n var i = 0;\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = (prefix) ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n i++;\n }\n return undefined;\n}\n\n/**\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n return _uniqueId++;\n}\n\n/**\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return (doc.defaultView || doc.parentWindow || window);\n}\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\n\nvar COMPUTE_INTERVAL = 25;\n\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\n\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\n\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\n\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\nfunction Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget;\n\n // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n this.domHandler = function(ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n\n}\n\nInput.prototype = {\n /**\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n handler: function() { },\n\n /**\n * bind the events\n */\n init: function() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n },\n\n /**\n * unbind the events\n */\n destroy: function() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n};\n\n/**\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\nfunction createInputInstance(manager) {\n var Type;\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n return new (Type)(manager, inputHandler);\n}\n\n/**\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\nfunction inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\n var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\n\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n }\n\n // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n input.eventType = eventType;\n\n // compute scale, rotation etc\n computeInputData(manager, input);\n\n // emit secret event\n manager.emit('hammer.input', input);\n\n manager.recognize(input);\n manager.session.prevInput = input;\n}\n\n/**\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\nfunction computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length;\n\n // store the first input to calculate the distance and direction\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n }\n\n // to compute scale and rotation we need to store the multiple touches\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput;\n var firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;\n\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n\n input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >\n session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);\n\n computeIntervalInputData(session, input);\n\n // find the correct target\n var target = manager.element;\n if (hasParent(input.srcEvent.target, target)) {\n target = input.srcEvent.target;\n }\n input.target = target;\n}\n\nfunction computeDeltaXY(session, input) {\n var center = input.center;\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\nfunction computeIntervalInputData(session, input) {\n var last = session.lastInterval || input,\n deltaTime = input.timeStamp - last.timeStamp,\n velocity, velocityX, velocityY, direction;\n\n if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n\n/**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\nfunction simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n\n/**\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\nfunction getCenter(pointers) {\n var pointersLength = pointers.length;\n\n // no need to loop when only one touch\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0, y = 0, i = 0;\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n}\n\n/**\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n\n/**\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\nfunction getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\n/**\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\nfunction getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n\n return Math.sqrt((x * x) + (y * y));\n}\n\n/**\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\nfunction getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\nfunction getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\nfunction getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\nvar MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\n\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n\n/**\n * Mouse events input\n * @constructor\n * @extends Input\n */\nfunction MouseInput() {\n this.evEl = MOUSE_ELEMENT_EVENTS;\n this.evWin = MOUSE_WINDOW_EVENTS;\n\n this.pressed = false; // mousedown state\n\n Input.apply(this, arguments);\n}\n\ninherit(MouseInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function MEhandler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type];\n\n // on start we want to have the left mouse button down\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n }\n\n // mouse must be down\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n }\n});\n\nvar POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n};\n\n// in IE10 the pointer types is defined as an enum\nvar IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n};\n\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\n\n// IE10 has prefixed support, and case-sensitive\nif (window.MSPointerEvent && !window.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n\n/**\n * Pointer events input\n * @constructor\n * @extends Input\n */\nfunction PointerEventInput() {\n this.evEl = POINTER_ELEMENT_EVENTS;\n this.evWin = POINTER_WINDOW_EVENTS;\n\n Input.apply(this, arguments);\n\n this.store = (this.manager.session.pointerEvents = []);\n}\n\ninherit(PointerEventInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function PEhandler(ev) {\n var store = this.store;\n var removePointer = false;\n\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n\n var isTouch = (pointerType == INPUT_TYPE_TOUCH);\n\n // get index of the event in the store\n var storeIndex = inArray(store, ev.pointerId, 'pointerId');\n\n // start and mouse must be down\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n }\n\n // it not found, so the pointer hasn't been down (so it's probably a hover)\n if (storeIndex < 0) {\n return;\n }\n\n // update the event in the store\n store[storeIndex] = ev;\n\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n }\n});\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Touch events input\n * @constructor\n * @extends Input\n */\nfunction SingleTouchInput() {\n this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n this.started = false;\n\n Input.apply(this, arguments);\n}\n\ninherit(SingleTouchInput, Input, {\n handler: function TEhandler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\n\n // should we handle the touch events?\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type);\n\n // when done, reset the started state\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n}\n\nvar TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\nfunction TouchInput() {\n this.evTarget = TOUCH_TARGET_EVENTS;\n this.targetIds = {};\n\n Input.apply(this, arguments);\n}\n\ninherit(TouchInput, Input, {\n handler: function MTEhandler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds;\n\n // when there is only one touch, the process can be simplified\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i,\n targetTouches,\n changedTouches = toArray(ev.changedTouches),\n changedTargetTouches = [],\n target = this.target;\n\n // get target touches from touches\n targetTouches = allTouches.filter(function(touch) {\n return hasParent(touch.target, target);\n });\n\n // collect touches\n if (type === INPUT_START) {\n i = 0;\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n }\n\n // filter changed touches to only contain touches that exist in the collected target ids\n i = 0;\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n }\n\n // cleanup removed touches\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [\n // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\n changedTargetTouches\n ];\n}\n\n/**\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction TouchMouseInput() {\n Input.apply(this, arguments);\n\n var handler = bindFn(this.handler, this);\n this.touch = new TouchInput(this.manager, handler);\n this.mouse = new MouseInput(this.manager, handler);\n\n this.primaryTouch = null;\n this.lastTouches = [];\n}\n\ninherit(TouchMouseInput, Input, {\n /**\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n handler: function TMEhandler(manager, inputEvent, inputData) {\n var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\n isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n }\n\n // when we're in a touch event, record touches to de-dupe synthetic mouse event\n if (isTouch) {\n recordTouches.call(this, inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(this, inputData)) {\n return;\n }\n\n this.callback(manager, inputEvent, inputData);\n },\n\n /**\n * remove the event listeners\n */\n destroy: function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n }\n});\n\nfunction recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n}\n\nfunction setLastTouch(eventData) {\n var touch = eventData.changedPointers[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {x: touch.clientX, y: touch.clientY};\n this.lastTouches.push(lastTouch);\n var lts = this.lastTouches;\n var removeLastTouch = function() {\n var i = lts.indexOf(lastTouch);\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n}\n\nfunction isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n return false;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\n\n// magical touchAction value\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\n/**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\nfunction TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n}\n\nTouchAction.prototype = {\n /**\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n set: function(value) {\n // find out the touch-action by the event handlers\n if (value == TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n this.actions = value.toLowerCase().trim();\n },\n\n /**\n * just re-set the touchAction value\n */\n update: function() {\n this.set(this.manager.options.touchAction);\n },\n\n /**\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n compute: function() {\n var actions = [];\n each(this.manager.recognizers, function(recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n },\n\n /**\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n preventDefaults: function(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection;\n\n // if the touch action did prevented once this session\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n //do not prevent defaults if this is a tap gesture\n\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone ||\n (hasPanY && direction & DIRECTION_HORIZONTAL) ||\n (hasPanX && direction & DIRECTION_VERTICAL)) {\n return this.preventSrc(srcEvent);\n }\n },\n\n /**\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n preventSrc: function(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n }\n};\n\n/**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\nfunction cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\n\n // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n }\n\n // pan-x OR pan-y\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n }\n\n // manipulation\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n}\n\nfunction getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n var touchMap = {};\n var cssSupports = window.CSS && window.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {\n\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n}\n\n/**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\nfunction Recognizer(options) {\n this.options = assign({}, this.defaults, options || {});\n\n this.id = uniqueId();\n\n this.manager = null;\n\n // default is enable true\n this.options.enable = ifUndefined(this.options.enable, true);\n\n this.state = STATE_POSSIBLE;\n\n this.simultaneous = {};\n this.requireFail = [];\n}\n\nRecognizer.prototype = {\n /**\n * @virtual\n * @type {Object}\n */\n defaults: {},\n\n /**\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n set: function(options) {\n assign(this.options, options);\n\n // also update the touchAction, in case something changed about the directions/enabled state\n this.manager && this.manager.touchAction.update();\n return this;\n },\n\n /**\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n recognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n return this;\n },\n\n /**\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRecognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n },\n\n /**\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n requireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n return this;\n },\n\n /**\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRequireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n return this;\n },\n\n /**\n * has require failures boolean\n * @returns {boolean}\n */\n hasRequireFailures: function() {\n return this.requireFail.length > 0;\n },\n\n /**\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n canRecognizeWith: function(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n },\n\n /**\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n emit: function(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n }\n\n // 'panstart' and 'panmove'\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n }\n\n // panend and pancancel\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n },\n\n /**\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n tryEmit: function(input) {\n if (this.canEmit()) {\n return this.emit(input);\n }\n // it's failing anyway\n this.state = STATE_FAILED;\n },\n\n /**\n * can we emit?\n * @returns {boolean}\n */\n canEmit: function() {\n var i = 0;\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n i++;\n }\n return true;\n },\n\n /**\n * update the recognizer\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign({}, inputData);\n\n // is is enabled and allow recognizing?\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n }\n\n // reset when we've reached the end\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone);\n\n // the recognizer has recognized a gesture\n // so trigger an event\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n },\n\n /**\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {Const} STATE\n */\n process: function(inputData) { }, // jshint ignore:line\n\n /**\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n getTouchAction: function() { },\n\n /**\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n reset: function() { }\n};\n\n/**\n * get a usable string, used as event postfix\n * @param {Const} state\n * @returns {String} state\n */\nfunction stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n return '';\n}\n\n/**\n * direction cons to string\n * @param {Const} direction\n * @returns {String}\n */\nfunction directionStr(direction) {\n if (direction == DIRECTION_DOWN) {\n return 'down';\n } else if (direction == DIRECTION_UP) {\n return 'up';\n } else if (direction == DIRECTION_LEFT) {\n return 'left';\n } else if (direction == DIRECTION_RIGHT) {\n return 'right';\n }\n return '';\n}\n\n/**\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n if (manager) {\n return manager.get(otherRecognizer);\n }\n return otherRecognizer;\n}\n\n/**\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\nfunction AttrRecognizer() {\n Recognizer.apply(this, arguments);\n}\n\ninherit(AttrRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof AttrRecognizer\n */\n defaults: {\n /**\n * @type {Number}\n * @default 1\n */\n pointers: 1\n },\n\n /**\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n attrTest: function(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n },\n\n /**\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n process: function(input) {\n var state = this.state;\n var eventType = input.eventType;\n\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input);\n\n // on cancel input and we've recognized before, return STATE_CANCELLED\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n return state | STATE_CHANGED;\n }\n return STATE_FAILED;\n }\n});\n\n/**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}\n\ninherit(PanRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PanRecognizer\n */\n defaults: {\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n },\n\n getTouchAction: function() {\n var direction = this.options.direction;\n var actions = [];\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n return actions;\n },\n\n directionTest: function(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY;\n\n // lock to axis?\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x != this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y != this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n },\n\n attrTest: function(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) &&\n (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\n },\n\n emit: function(input) {\n\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PinchRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(PinchRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'pinch',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n },\n\n emit: function(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\nfunction PressRecognizer() {\n Recognizer.apply(this, arguments);\n\n this._timer = null;\n this._input = null;\n}\n\ninherit(PressRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PressRecognizer\n */\n defaults: {\n event: 'press',\n pointers: 1,\n time: 251, // minimal time of the pointer to be pressed\n threshold: 9 // a minimal movement is ok, but keep it low\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_AUTO];\n },\n\n process: function(input) {\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n\n this._input = input;\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.time, this);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && (input.eventType & INPUT_END)) {\n this.manager.emit(this.options.event + 'up', input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction RotateRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(RotateRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof RotateRecognizer\n */\n defaults: {\n event: 'rotate',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n }\n});\n\n/**\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction SwipeRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(SwipeRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof SwipeRecognizer\n */\n defaults: {\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n },\n\n getTouchAction: function() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n },\n\n attrTest: function(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return this._super.attrTest.call(this, input) &&\n direction & input.offsetDirection &&\n input.distance > this.options.threshold &&\n input.maxPointers == this.options.pointers &&\n abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n },\n\n emit: function(input) {\n var direction = directionStr(input.offsetDirection);\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n }\n});\n\n/**\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\nfunction TapRecognizer() {\n Recognizer.apply(this, arguments);\n\n // previous time and center,\n // used for tap counting\n this.pTime = false;\n this.pCenter = false;\n\n this._timer = null;\n this._input = null;\n this.count = 0;\n}\n\ninherit(TapRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300, // max time between the multi-tap taps\n time: 250, // max time of the pointer to be down (like finger on the screen)\n threshold: 9, // a minimal movement is ok, but keep it low\n posThreshold: 10 // a multi-tap can be a bit off the initial position\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_MANIPULATION];\n },\n\n process: function(input) {\n var options = this.options;\n\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n\n this.reset();\n\n if ((input.eventType & INPUT_START) && (this.count === 0)) {\n return this.failTimeout();\n }\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType != INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input;\n\n // if tap count matches we have recognized it,\n // else it has began recognizing...\n var tapCount = this.count % options.taps;\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.interval, this);\n return STATE_BEGAN;\n }\n }\n }\n return STATE_FAILED;\n },\n\n failTimeout: function() {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_FAILED;\n }, this.options.interval, this);\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function() {\n if (this.state == STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Hammer(element, options) {\n options = options || {};\n options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\n return new Manager(element, options);\n}\n\n/**\n * @const {string}\n */\nHammer.VERSION = '2.0.7';\n\n/**\n * default settings\n * @namespace\n */\nHammer.defaults = {\n /**\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * @type {Array}\n */\n preset: [\n // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\n [RotateRecognizer, {enable: false}],\n [PinchRecognizer, {enable: false}, ['rotate']],\n [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],\n [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],\n [TapRecognizer],\n [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],\n [PressRecognizer]\n ],\n\n /**\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: 'none',\n\n /**\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: 'none',\n\n /**\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: 'none',\n\n /**\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: 'none',\n\n /**\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: 'none',\n\n /**\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: 'rgba(0,0,0,0)'\n }\n};\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n\n/**\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Manager(element, options) {\n this.options = assign({}, Hammer.defaults, options || {});\n\n this.options.inputTarget = this.options.inputTarget || element;\n\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n\n toggleCssProps(this, true);\n\n each(this.options.recognizers, function(item) {\n var recognizer = this.add(new (item[0])(item[1]));\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n}\n\nManager.prototype = {\n /**\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n set: function(options) {\n assign(this.options, options);\n\n // Options that need a little more setup\n if (options.touchAction) {\n this.touchAction.update();\n }\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n return this;\n },\n\n /**\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n stop: function(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n },\n\n /**\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n var session = this.session;\n if (session.stopped) {\n return;\n }\n\n // run the touch-action polyfill\n this.touchAction.preventDefaults(inputData);\n\n var recognizer;\n var recognizers = this.recognizers;\n\n // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n var curRecognizer = session.curRecognizer;\n\n // reset when the last recognizer is recognized\n // or when we're in a new session\n if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\n curRecognizer = session.curRecognizer = null;\n }\n\n var i = 0;\n while (i < recognizers.length) {\n recognizer = recognizers[i];\n\n // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer == curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) { // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n }\n\n // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n curRecognizer = session.curRecognizer = recognizer;\n }\n i++;\n }\n },\n\n /**\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n get: function(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event == recognizer) {\n return recognizers[i];\n }\n }\n return null;\n },\n\n /**\n * add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n add: function(recognizer) {\n if (invokeArrayArg(recognizer, 'add', this)) {\n return this;\n }\n\n // remove existing\n var existing = this.get(recognizer.options.event);\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n\n this.touchAction.update();\n return recognizer;\n },\n\n /**\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n remove: function(recognizer) {\n if (invokeArrayArg(recognizer, 'remove', this)) {\n return this;\n }\n\n recognizer = this.get(recognizer);\n\n // let's make sure this recognizer exists\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, recognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n },\n\n /**\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n on: function(events, handler) {\n if (events === undefined) {\n return;\n }\n if (handler === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n },\n\n /**\n * unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n off: function(events, handler) {\n if (events === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n },\n\n /**\n * emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n emit: function(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n }\n\n // no handlers, so skip it all\n var handlers = this.handlers[event] && this.handlers[event].slice();\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n data.preventDefault = function() {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n },\n\n /**\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n destroy: function() {\n this.element && toggleCssProps(this, false);\n\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n }\n};\n\n/**\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\nfunction toggleCssProps(manager, add) {\n var element = manager.element;\n if (!element.style) {\n return;\n }\n var prop;\n each(manager.options.cssProps, function(value, name) {\n prop = prefixed(element.style, name);\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || '';\n }\n });\n if (!add) {\n manager.oldCssProps = {};\n }\n}\n\n/**\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\nfunction triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent('Event');\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n}\n\nassign(Hammer, {\n INPUT_START: INPUT_START,\n INPUT_MOVE: INPUT_MOVE,\n INPUT_END: INPUT_END,\n INPUT_CANCEL: INPUT_CANCEL,\n\n STATE_POSSIBLE: STATE_POSSIBLE,\n STATE_BEGAN: STATE_BEGAN,\n STATE_CHANGED: STATE_CHANGED,\n STATE_ENDED: STATE_ENDED,\n STATE_RECOGNIZED: STATE_RECOGNIZED,\n STATE_CANCELLED: STATE_CANCELLED,\n STATE_FAILED: STATE_FAILED,\n\n DIRECTION_NONE: DIRECTION_NONE,\n DIRECTION_LEFT: DIRECTION_LEFT,\n DIRECTION_RIGHT: DIRECTION_RIGHT,\n DIRECTION_UP: DIRECTION_UP,\n DIRECTION_DOWN: DIRECTION_DOWN,\n DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\n DIRECTION_VERTICAL: DIRECTION_VERTICAL,\n DIRECTION_ALL: DIRECTION_ALL,\n\n Manager: Manager,\n Input: Input,\n TouchAction: TouchAction,\n\n TouchInput: TouchInput,\n MouseInput: MouseInput,\n PointerEventInput: PointerEventInput,\n TouchMouseInput: TouchMouseInput,\n SingleTouchInput: SingleTouchInput,\n\n Recognizer: Recognizer,\n AttrRecognizer: AttrRecognizer,\n Tap: TapRecognizer,\n Pan: PanRecognizer,\n Swipe: SwipeRecognizer,\n Pinch: PinchRecognizer,\n Rotate: RotateRecognizer,\n Press: PressRecognizer,\n\n on: addEventListeners,\n off: removeEventListeners,\n each: each,\n merge: merge,\n extend: extend,\n assign: assign,\n inherit: inherit,\n bindFn: bindFn,\n prefixed: prefixed\n});\n\n// this prevents errors when Hammer is loaded in the presence of an AMD\n// style loader but by script tag, not by the loader.\nvar freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line\nfreeGlobal.Hammer = Hammer;\n\nif (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n return Hammer;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else if (typeof module != 'undefined' && module.exports) {\n module.exports = Hammer;\n} else {\n window[exportName] = Hammer;\n}\n\n})(window, document, 'Hammer');\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n\n// EXTERNAL MODULE: ./app/client/src/scss/app.scss\nvar app = __webpack_require__(7);\nvar app_default = /*#__PURE__*/__webpack_require__.n(app);\n\n// EXTERNAL MODULE: ./node_modules/popper.js/dist/esm/popper.js\nvar popper = __webpack_require__(3);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/util.js\nvar util = __webpack_require__(8);\nvar util_default = /*#__PURE__*/__webpack_require__.n(util);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/alert.js\nvar dist_alert = __webpack_require__(9);\nvar alert_default = /*#__PURE__*/__webpack_require__.n(dist_alert);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/button.js\nvar dist_button = __webpack_require__(10);\nvar button_default = /*#__PURE__*/__webpack_require__.n(dist_button);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/carousel.js\nvar carousel = __webpack_require__(11);\nvar carousel_default = /*#__PURE__*/__webpack_require__.n(carousel);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/collapse.js\nvar collapse = __webpack_require__(12);\nvar collapse_default = /*#__PURE__*/__webpack_require__.n(collapse);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/dropdown.js\nvar dropdown = __webpack_require__(13);\nvar dropdown_default = /*#__PURE__*/__webpack_require__.n(dropdown);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/modal.js\nvar modal = __webpack_require__(14);\nvar modal_default = /*#__PURE__*/__webpack_require__.n(modal);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/tooltip.js\nvar tooltip = __webpack_require__(15);\nvar tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/popover.js\nvar popover = __webpack_require__(16);\nvar popover_default = /*#__PURE__*/__webpack_require__.n(popover);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/scrollspy.js\nvar scrollspy = __webpack_require__(18);\nvar scrollspy_default = /*#__PURE__*/__webpack_require__.n(scrollspy);\n\n// EXTERNAL MODULE: ./node_modules/bootstrap/js/dist/tab.js\nvar tab = __webpack_require__(19);\nvar tab_default = /*#__PURE__*/__webpack_require__.n(tab);\n\n// EXTERNAL MODULE: ./node_modules/offcanvas-bootstrap/dist/js/bootstrap.offcanvas.js\nvar bootstrap_offcanvas = __webpack_require__(20);\nvar bootstrap_offcanvas_default = /*#__PURE__*/__webpack_require__.n(bootstrap_offcanvas);\n\n// EXTERNAL MODULE: external \"jQuery\"\nvar external__jQuery_ = __webpack_require__(0);\nvar external__jQuery__default = /*#__PURE__*/__webpack_require__.n(external__jQuery_);\n\n// EXTERNAL MODULE: ./node_modules/hammerjs/hammer.js\nvar hammer = __webpack_require__(5);\nvar hammer_default = /*#__PURE__*/__webpack_require__.n(hammer);\n\n// EXTERNAL MODULE: ./node_modules/jquery-hammerjs/jquery.hammer.js\nvar jquery_hammer = __webpack_require__(21);\nvar jquery_hammer_default = /*#__PURE__*/__webpack_require__.n(jquery_hammer);\n\n// EXTERNAL MODULE: ./node_modules/pouchdb/dist/pouchdb.js\nvar pouchdb = __webpack_require__(22);\nvar pouchdb_default = /*#__PURE__*/__webpack_require__.n(pouchdb);\n\n// EXTERNAL MODULE: ./app/client/src/js/_components/routes/index.js\nvar routes = __webpack_require__(23);\n\n// EXTERNAL MODULE: ./app/client/src/js/_events.js\nvar _events = __webpack_require__(2);\nvar _events_default = /*#__PURE__*/__webpack_require__.n(_events);\n\n// CONCATENATED MODULE: ./app/client/src/js/_components/_ui.spinner.js\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\nvar SpinnerUI = function ($) {\n var SpinnerUI = function () {\n function SpinnerUI() {\n _classCallCheck(this, SpinnerUI);\n }\n\n _createClass(SpinnerUI, null, [{\n key: 'show',\n value: function show(callback) {\n $('#PageLoading').show(0, callback);\n }\n }, {\n key: 'hide',\n value: function hide(callback) {\n $('#PageLoading').hide('slow', callback);\n }\n }]);\n\n return SpinnerUI;\n }();\n\n return SpinnerUI;\n}(external__jQuery__default.a);\n\n/* harmony default export */ var _ui_spinner = (SpinnerUI);\n// CONCATENATED MODULE: ./app/client/src/js/_components/_ui.carousel.js\nvar _ui_carousel__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _ui_carousel__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\n\nvar _ui_carousel_CarouselUI = function ($) {\n // Constants\n var NAME = 'CarouselUI';\n\n var CarouselUI = function () {\n function CarouselUI() {\n _ui_carousel__classCallCheck(this, CarouselUI);\n }\n\n _ui_carousel__createClass(CarouselUI, null, [{\n key: 'each',\n\n // Static methods\n\n value: function each(callback) {\n $('.js-carousel').each(function (i, e) {\n callback(i, $(e));\n });\n }\n }, {\n key: 'init',\n value: function init() {\n this.dispose();\n\n this.each(function (i, e) {\n var $e = $(e),\n id = 'Carousel' + i;\n\n $e.attr('id', id);\n $e.data('id', i);\n\n var $items = $(e).find('.carousel-item'),\n count = $items.length;\n if (!count) {\n return;\n }\n\n // create carousel-controls\n if ($e.data('indicators')) {\n var $indicators = $('<ol class=\"carousel-indicators\"></ol>');\n $indicators.append('<li data-target=\"#' + id + '\" data-slide-to=\"0\" class=\"active\"></li>');\n for (var _i = 1; _i < count; _i++) {\n $indicators.append('<li data-target=\"#' + id + '\" data-slide-to=\"' + _i + '\"></li>');\n }\n $e.prepend($indicators);\n }\n\n // create arrows\n if ($e.data('arrows')) {\n $e.prepend('<i class=\"carousel-control-prev\" data-target=\"#' + id + '\" role=\"button\" data-slide=\"prev\"><i class=\"fas fa-chevron-left\" aria-hidden=\"true\"></i><i class=\"sr-only\">Previous</i></i>');\n $e.prepend('<i class=\"carousel-control-next\" data-target=\"#' + id + '\" role=\"button\" data-slide=\"next\"><i class=\"fas fa-chevron-right\" aria-hidden=\"true\"></i><i class=\"sr-only\">Next</i></i>');\n }\n\n // init carousel\n $e.carousel();\n\n // init touch swipes\n $e.hammer().bind('swipeleft', function (event) {\n $(event.target).carousel('next');\n });\n\n $e.hammer().bind('swiperight', function (event) {\n $(event.target).carousel('prev');\n });\n\n $e.hammer().bind('panleft', function (event) {\n $(event.target).carousel('next');\n });\n\n $e.hammer().bind('panright', function (event) {\n $(event.target).carousel('prev');\n });\n\n $e.hammer().bind('tap', function (event) {\n $(event.target).carousel('next');\n });\n });\n }\n }, {\n key: 'dispose',\n value: function dispose() {\n this.each(function (i, e) {\n $(e).carousel('dispose');\n });\n }\n }]);\n\n return CarouselUI;\n }();\n\n $(window).on(_events_default.a.AJAX + ' ' + _events_default.a.LOADED, function () {\n CarouselUI.init();\n });\n\n return CarouselUI;\n}(external__jQuery__default.a);\n\n/* harmony default export */ var _ui_carousel = (_ui_carousel_CarouselUI);\n// CONCATENATED MODULE: ./app/client/src/js/_components/_ui.menu.js\nvar _ui_menu__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _ui_menu__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\nvar SlidingMenu = function ($) {\n // Constants\n var NAME = 'jsSlidingMenu';\n var DATA_KEY = NAME;\n\n var SlidingMenu = function () {\n // Constructor\n function SlidingMenu(element) {\n _ui_menu__classCallCheck(this, SlidingMenu);\n\n this._element = element;\n var $element = $(this._element);\n $element.addClass(NAME + '-active');\n\n // esc button\n $(window).on('keyup', function (e) {\n if (e.which === 27) {\n $element.find('.is-open[data-toggle=\"offcanvas\"]').click();\n }\n });\n }\n\n // Public methods\n\n\n _ui_menu__createClass(SlidingMenu, [{\n key: 'dispose',\n value: function dispose() {\n console.log('Disposing: ' + NAME + ' elements');\n\n $(this._element).removeClass(NAME + '-active');\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }\n }], [{\n key: '_jQueryInterface',\n value: function _jQueryInterface() {\n return this.each(function () {\n // attach functionality to element\n var $element = $(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new SlidingMenu(this);\n $element.data(DATA_KEY, data);\n }\n });\n }\n }]);\n\n return SlidingMenu;\n }();\n\n // jQuery interface\n\n\n $.fn[NAME] = SlidingMenu._jQueryInterface;\n $.fn[NAME].Constructor = SlidingMenu;\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return SlidingMenu._jQueryInterface;\n };\n\n // auto-apply\n $('.ui.' + NAME).ready(function () {\n $('.ui.' + NAME).jsSlidingMenu();\n });\n\n return SlidingMenu;\n}(external__jQuery__default.a);\n\n/* harmony default export */ var _ui_menu = (SlidingMenu);\n// CONCATENATED MODULE: ./app/client/src/js/_components/_ui.form.storage.js\nvar _ui_form_storage__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _ui_form_storage__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\nvar _ui_form_storage_FormStorage = function ($) {\n // Constants\n var NAME = 'jsFormStorage';\n var DATA_KEY = NAME;\n var STORAGE = window.localStorage;\n\n var FormStorage = function () {\n // Constructor\n function FormStorage(element) {\n _ui_form_storage__classCallCheck(this, FormStorage);\n\n this._element = element;\n var $element = $(this._element);\n var $elements = $element.find('input,textarea');\n\n $element.addClass(NAME + '-active');\n\n // restore form data from localStorage\n $elements.each(function () {\n var id = $(this).attr('id');\n var type = $(this).attr('type');\n var val = STORAGE.getItem(NAME + id);\n\n if (id && val && type) {\n if (type && (type === 'checkbox' || type === 'radio')) {\n $(this).prop('checked', val);\n } else {\n $(this).val(val);\n }\n }\n });\n\n // store form data into localStorage\n $elements.change(function () {\n var id = $(this).attr('id');\n var type = $(this).attr('type');\n var val = $(this).val();\n\n if (type && (type === 'checkbox' || type === 'radio')) {\n val = !!$(this).is(':checked');\n }\n\n if (id && type && type !== 'password') {\n STORAGE.setItem(NAME + id, val);\n }\n });\n\n $element.submit(function () {\n $element.data(DATA_KEY).clear();\n });\n\n $element.find('button,[type=\"submit\"],[type=\"clear\"]').click(function () {\n $element.data(DATA_KEY).clear();\n });\n }\n\n // Public methods\n\n\n _ui_form_storage__createClass(FormStorage, [{\n key: 'dispose',\n value: function dispose() {\n var $element = $(this._element);\n\n $element.removeClass(NAME + '-active');\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }\n }, {\n key: 'clear',\n value: function clear() {\n STORAGE.clear();\n }\n }], [{\n key: '_jQueryInterface',\n value: function _jQueryInterface() {\n if (typeof window.localStorage !== 'undefined') {\n return this.each(function () {\n // attach functionality to element\n var $element = $(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new FormStorage(this);\n $element.data(DATA_KEY, data);\n }\n });\n }\n }\n }]);\n\n return FormStorage;\n }();\n\n // jQuery interface\n\n\n $.fn[NAME] = FormStorage._jQueryInterface;\n $.fn[NAME].Constructor = FormStorage;\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return FormStorage._jQueryInterface;\n };\n\n // auto-apply\n $(window).on(_events_default.a.AJAX + ' ' + _events_default.a.LOADED, function () {\n $('form').jsFormStorage();\n });\n\n return FormStorage;\n}(external__jQuery__default.a);\n\n/* harmony default export */ var _ui_form_storage = (_ui_form_storage_FormStorage);\n// CONCATENATED MODULE: ./app/client/src/js/_components/_ui.ajax.js\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _ui_ajax__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _ui_ajax__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\n\nvar _ui_ajax_AjaxUI = function ($) {\n // Constants\n var G = window;\n var D = document;\n var $Html = $('html');\n var $Body = $('body');\n\n var NAME = 'jsAjaxUI';\n var DATA_KEY = NAME;\n\n var AjaxUI = function () {\n // Constructor\n function AjaxUI(element) {\n _ui_ajax__classCallCheck(this, AjaxUI);\n\n this._element = element;\n var $element = $(this._element);\n $element.addClass(NAME + '-active');\n\n $element.bind('click', function (e) {\n e.preventDefault();\n\n var $this = $(this);\n\n $('.ajax').each(function () {\n var $this = $(this);\n $this.removeClass('active');\n $this.parents('.nav-item').removeClass('active');\n });\n\n $this.addClass('loading');\n\n AjaxUI.load($this.attr('href'), function () {\n $this.removeClass('loading');\n $this.parents('.nav-item').addClass('active');\n $this.addClass('active');\n });\n });\n }\n\n // Public methods\n\n\n _ui_ajax__createClass(AjaxUI, [{\n key: 'dispose',\n value: function dispose() {\n var $element = $(this._element);\n\n $element.removeClass(NAME + '-active');\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }\n }], [{\n key: 'load',\n value: function load(url, callback) {\n // show spinner\n _ui_spinner.show(function () {\n $Body.removeClass('loaded');\n });\n\n // update document location\n G.MainUI.updateLocation(url);\n\n var absoluteLocation = G.URLDetails['base'] + G.URLDetails['relative'].substring(1);\n if (absoluteLocation !== G.location.href) {\n G.history.pushState({\n ajax: true,\n page: absoluteLocation\n }, document.title, absoluteLocation);\n }\n\n $.ajax({\n sync: false,\n async: true,\n url: url,\n dataType: 'json',\n method: 'GET',\n cache: false,\n error: function error(jqXHR) {\n console.warn('AJAX request failure: ' + jqXHR.statusText);\n G.location.href = url;\n\n // google analytics\n if (typeof G.ga === 'function') {\n G.ga('send', 'event', 'error', 'AJAX ERROR', jqXHR.statusText);\n }\n },\n success: function success(data, status, jqXHR) {\n AjaxUI.process(data, jqXHR, callback);\n\n // google analytics\n if (typeof G.ga === 'function') {\n G.ga('set', {\n page: G.URLDetails['relative'] + G.URLDetails['hash'],\n title: jqXHR.getResponseHeader('X-Title')\n });\n G.ga('send', 'pageview');\n }\n }\n });\n }\n }, {\n key: 'process',\n value: function process(data, jqXHR, callback) {\n var _this = this;\n\n var css = jqXHR.getResponseHeader('X-Include-CSS').split(',') || [];\n var js = jqXHR.getResponseHeader('X-Include-JS').split(',') || [];\n\n // Replace HTML regions\n if (_typeof(data.regions) === 'object') {\n for (var key in data.regions) {\n if (typeof data.regions[key] === 'string') {\n AjaxUI.replaceRegion(data.regions[key], key);\n }\n }\n }\n\n // remove already loaded scripts\n $('link[type=\"text/css\"]').each(function () {\n var i = css.indexOf($(this).attr('href'));\n if (i > -1) {\n css.splice(i, 1);\n } else if (!$Body.data('unload-blocked')) {\n console.log('Unloading: ' + $(this).attr('href'));\n $(this).remove();\n }\n });\n\n $('script[type=\"text/javascript\"]').each(function () {\n var i = js.indexOf($(this).attr('src'));\n if (i > -1) {\n js.splice(i, 1);\n } else if (!$Body.data('unload-blocked')) {\n console.log('Unloading: ' + $(this).attr('src'));\n $(this).remove();\n }\n });\n\n // preload CSS\n this.preload(css).then(function () {\n var $head = $('head');\n css.forEach(function (el) {\n $head.append('<link rel=\"stylesheet\" type=\"text/css\" href=\"' + el + '\" />');\n });\n\n // preload JS\n _this.preload(js, 'script').then(function () {\n\n js.forEach(function (el) {\n $Body.append('<script type=\"text/javascript\" charset=\"UTF-8\" src=\"' + el + '\"></script>');\n });\n\n console.log('New page is loaded!');\n\n // trigger events\n if (_typeof(data.events) === 'object') {\n for (var eventName in data.events) {\n $(D).trigger(eventName, [data.events[eventName]]);\n }\n }\n\n if (typeof callback !== 'undefined') {\n callback();\n }\n\n $(G).trigger(_events_default.a.AJAX);\n });\n });\n }\n }, {\n key: 'preload',\n value: function preload(items) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text';\n var cache = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n if (!items.length) {\n return $.Deferred().resolve().promise();\n }\n\n var dfds = [];\n items.forEach(function (url) {\n var dfd = $.Deferred();\n\n $.ajax({\n dataType: type,\n cache: cache,\n url: url\n }).always(function () {\n dfd.resolve();\n });\n\n dfds.push(dfd);\n });\n\n // return a master promise object which will resolve when all the deferred objects have resolved\n return $.when.apply($, dfds);\n }\n }, {\n key: 'replaceRegion',\n value: function replaceRegion(html, key) {\n var $region = $('[data-ajax-region=\"' + key + '\"]');\n\n if ($region.length) {\n $region.empty().append(html);\n } else {\n console.warn('Region returned without class or id!');\n }\n }\n }, {\n key: '_jQueryInterface',\n value: function _jQueryInterface() {\n return this.each(function () {\n // attach functionality to element\n var $element = $(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new AjaxUI(this);\n $element.data(DATA_KEY, data);\n }\n });\n }\n }]);\n\n return AjaxUI;\n }();\n\n // jQuery interface\n\n\n $.fn[NAME] = AjaxUI._jQueryInterface;\n $.fn[NAME].Constructor = AjaxUI;\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return AjaxUI._jQueryInterface;\n };\n\n // auto-apply\n $('.ajax').ready(function () {\n $('.ajax').jsAjaxUI();\n });\n\n // AJAX update browser title\n $(D).on('layoutRefresh', function (e, data) {\n D.title = data.Title;\n\n $Html.attr('class', '');\n if (data.ClassName) {\n $Html.addClass(data.ClassName);\n }\n //data.Link = (data.Link === '/home/') ? '/' : data.Link;\n });\n\n // Back/Forward functionality\n G.onpopstate = function (event) {\n var $existingLink = $('a[href^=\"' + D.location + '\"]');\n\n if (event.state !== null && event.state.ajax) {\n console.log('GOBACK (AJAX state)');\n AjaxUI.load(event.state.page);\n } else if ($existingLink.length && $existingLink.hasClass('ajax')) {\n console.log('GOBACK (AJAX link)');\n $existingLink.trigger('click');\n } else {\n console.log('GOBACK (HTTP)');\n G.location.href = D.location;\n }\n };\n\n return AjaxUI;\n}(external__jQuery__default.a);\n\n/* harmony default export */ var _ui_ajax = (_ui_ajax_AjaxUI);\n// EXTERNAL MODULE: ./node_modules/smooth-scroll/dist/smooth-scroll.min.js\nvar smooth_scroll_min = __webpack_require__(27);\nvar smooth_scroll_min_default = /*#__PURE__*/__webpack_require__.n(smooth_scroll_min);\n\n// CONCATENATED MODULE: ./app/client/src/js/main.js\n\n\nvar main__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction main__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\n\n\n// Routie\n\n\n\n\n\n\n\n\n\n\n\n\nvar smoothScroll = smooth_scroll_min_default()();\n\nvar main_MainUI = function ($) {\n // Constants\n var W = window;\n var D = document;\n var $Body = $('body');\n\n var NAME = 'MainUI';\n\n // get browser locale\n //const Locale = $('html').attr('lang').substring(0, 2);\n\n var $AlertNotify = $('#AlertNotify');\n var $SiteWideMessage = $('#SiteWideMessage');\n\n // get browser window visibility preferences\n // Opera 12.10, Firefox >=18, Chrome >=31, IE11\n var HiddenName = 'hidden';\n var VisibilityChangeEvent = 'visibilitychange';\n\n // update visibility state\n D.addEventListener(VisibilityChangeEvent, function () {\n if (D.visibilityState === HiddenName) {\n console.log('Tab: hidden');\n $Body.addClass('is-hidden');\n $Body.trigger('tabHidden');\n } else {\n console.log('Tab: focused');\n $Body.removeClass('is-hidden');\n $Body.trigger('tabFocused');\n }\n });\n\n // update online/offline state\n var updateOnlineStatus = function updateOnlineStatus() {\n if (!navigator.onLine) {\n console.log('Tab: offline');\n $Body.addClass('is-offline');\n $Body.trigger('offline');\n } else {\n console.log('Tab: online');\n $Body.removeClass('is-offline');\n $Body.trigger('online');\n }\n };\n\n if (typeof navigator.onLine !== 'undefined') {\n W.addEventListener('offline', function () {\n updateOnlineStatus();\n }, false);\n\n W.addEventListener('online', function () {\n updateOnlineStatus();\n }, false);\n\n W.addEventListener('load', function () {\n updateOnlineStatus();\n });\n }\n\n // scrollTo\n var ScrollTo = function ScrollTo(trigger, selector) {\n smoothScroll.animateScroll(D.querySelector(selector), trigger, {\n speed: 500,\n offset: -20\n //easing: 'easeInOutCubic',\n // Callback API\n //before: function (anchor, toggle) {}, // Callback to run before scroll\n //`after: function (anchor, toggle) {} // Callback to run after scroll\n });\n };\n\n // session ping\n setInterval(function () {\n if ($Body.hasClass('is-offline')) {\n return;\n }\n\n $.ajax({\n sync: false,\n async: true,\n cache: false,\n url: '/Security/ping',\n global: false,\n type: 'POST',\n complete: function complete(data, datastatus) {\n if (datastatus !== 'success') {\n W.location.reload(false);\n }\n }\n });\n }, 300000); // 5 min in ms\n\n W.URLDetails = {\n 'base': $('base').attr('href'),\n 'relative': '/',\n 'hash': ''\n };\n\n var MainUI = function () {\n function MainUI() {\n main__classCallCheck(this, MainUI);\n }\n\n main__createClass(MainUI, null, [{\n key: 'init',\n\n // Static methods\n\n value: function init() {\n this.dispose();\n\n console.log('Initializing: ' + NAME);\n\n // update location details\n this.updateLocation();\n\n // mark available offline areas\n if ('caches' in W) {\n $('a.offline').addClass('offline-available');\n }\n\n this.loadImages();\n\n // mark external links\n $('a.external,a[rel=\"external\"]').attr('target', '_blank');\n\n // show encoded emails\n /*$(D).find('.obm').each(function () {\n if ($(this).attr('data-val') !== undefined) {\n const email = $(this).attr('data-val').split('')\n .reverse()\n .join('')\n .slice(0, -8)\n .replace(/[a-zA-Z]/g, (c) => String.fromCharCode((c <= 'Z' ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26))\n .replace('#AT#', '@');\n const attr = $(this).attr('data-val-append');\n if (attr !== undefined && attr !== false) {\n $(this).append(email);\n }\n if ($(this).find('.sr-only').length > 0) {\n $(this).find('.sr-only').append(email);\n }\n if ($(this).attr('href') !== undefined) {\n $(this).attr('href', `mailto:${email}`);\n }\n }\n });*/\n //\n\n // scroll links\n $(D).on('click', '.js-scrollTo', function (e) {\n e.preventDefault();\n ScrollTo(this, $(this).attr('data-target'));\n });\n\n // load external fonts\n if ($('[data-extfont]').length) {\n $.getScript('//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js', function () {\n var fonts = [];\n $('[data-extfont]').each(function (i) {\n fonts[i] = $(this).attr('data-extfont');\n });\n W.WebFont.load({\n google: {\n families: fonts\n }\n });\n });\n }\n\n // hide spinner\n _ui_spinner.hide(function () {\n $Body.addClass('loaded');\n });\n\n // fire page printing\n if (W.URLDetails['hash'].indexOf('printpage') > -1) {\n W.print();\n }\n }\n }, {\n key: 'updateLocation',\n value: function updateLocation(url) {\n var location = url || W.location.href;\n location = location.replace(W.URLDetails['base'], '/');\n var hash = location.indexOf('#');\n\n W.URLDetails.relative = location.split('#')[0];\n W.URLDetails.hash = hash >= 0 ? location.substr(location.indexOf('#')) : '';\n }\n\n // show site-wide alert\n\n }, {\n key: 'alert',\n value: function alert(msg, cls) {\n $SiteWideMessage.fadeOut('fast');\n\n $SiteWideMessage.html('<div class=\"page-alert\"><div class=\"alert alert-' + cls + '\"><i class=\"close\" data-dismiss=\"alert\">&times;</i>' + msg + '</div></div>');\n $SiteWideMessage.find('.page-alert').alert();\n\n $SiteWideMessage.find('.close[data-dismiss=\"alert\"]').click(function () {\n $SiteWideMessage.fadeOut('slow', function () {\n $SiteWideMessage.find('.page-alert').alert('close');\n });\n });\n\n $SiteWideMessage.fadeIn('slow');\n\n if ($AlertNotify.length) {\n $AlertNotify[0].play();\n }\n\n $(W).trigger('alert-appeared');\n }\n\n // hide site-wide alert\n\n }, {\n key: 'alertHide',\n value: function alertHide() {\n if ($SiteWideMessage.length !== 0) {\n $SiteWideMessage.fadeOut('slow', function () {\n $SiteWideMessage.find('.alert').alert('close');\n });\n }\n\n if ($AlertNotify.length && typeof $AlertNotify[0].stop !== 'undefined') {\n $AlertNotify[0].stop();\n }\n\n $(W).trigger('alert-removed');\n }\n\n // load all images\n\n }, {\n key: 'loadImages',\n value: function loadImages() {\n var $imgs = $Body.find('img');\n var $imgUrls = [];\n var $imgLazyUrls = [];\n\n // collect image details\n $imgs.each(function () {\n var src = $(this).attr('src');\n var lazySrc = $(this).data('lazy-src');\n if (src.length) {\n $imgUrls.push(src);\n }\n if (lazySrc) {\n $imgLazyUrls.push(lazySrc);\n }\n });\n\n // load defined images\n _ui_ajax.preload($imgUrls).then(function () {\n $(W).trigger('images-loaded');\n\n // load lazy images\n _ui_ajax.preload($imgLazyUrls).then(function () {\n // update lazy img src\n $('img[data-lazy-src]').each(function () {\n if (!$(this).attr('src')) {\n return;\n }\n $(this).attr('src', $(this).data('lazy-src'));\n });\n\n console.log('All images are loaded!');\n\n $(W).trigger('images-lazy-loaded');\n });\n });\n }\n }, {\n key: 'dispose',\n value: function dispose() {\n console.log('Destroying: ' + NAME);\n }\n }]);\n\n return MainUI;\n }();\n\n $(W).on(_events_default.a.AJAX + ' ' + _events_default.a.LOADED, function () {\n MainUI.init();\n });\n\n W.MainUI = MainUI;\n\n return MainUI;\n}(external__jQuery__default.a);\n\n/* harmony default export */ var main = (main_MainUI);\n// CONCATENATED MODULE: ./app/client/src/js/app.js\n\n\n// import Bootstrap\n\n\n\n\n\n\n\n\n\n\n\n\n//\n\n//import Vue from 'vue/dist/vue.esm.js';\n\n// import Bootstrap-Vue\n/*import { Carousel } from 'bootstrap-vue/es/components';\nVue.use(Carousel);*/\n\n\n\n// import your custom UI components\n\n\nfunction importAll(r) {\n return r.keys().map(r);\n}\n\nvar app_images = importAll(__webpack_require__(28));\nvar fontAwesome = importAll(__webpack_require__(32));\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($) {/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Util = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined; // eslint-disable-line no-undefined\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $(this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator;\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || '';\n }\n\n try {\n var $selector = $(document).find(selector);\n return $selector.length > 0 ? selector : null;\n } catch (err) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $(element).css('transition-duration');\n var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END);\n },\n // TODO: Remove in v5\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n }\n };\n setTransitionEndSupport();\n return Util;\n}($);\n//# sourceMappingURL=util.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Util) {function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Alert = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'alert';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.alert';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Selector = {\n DISMISS: '[data-dismiss=\"alert\"]'\n };\n var Event = {\n CLOSE: \"close\" + EVENT_KEY,\n CLOSED: \"closed\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n ALERT: 'alert',\n FADE: 'fade',\n SHOW: 'show'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Alert =\n /*#__PURE__*/\n function () {\n function Alert(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Alert.prototype;\n\n // Public\n _proto.close = function close(element) {\n var rootElement = this._element;\n\n if (element) {\n rootElement = this._getRootElement(element);\n }\n\n var customEvent = this._triggerCloseEvent(rootElement);\n\n if (customEvent.isDefaultPrevented()) {\n return;\n }\n\n this._removeElement(rootElement);\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Private\n\n\n _proto._getRootElement = function _getRootElement(element) {\n var selector = Util.getSelectorFromElement(element);\n var parent = false;\n\n if (selector) {\n parent = $(selector)[0];\n }\n\n if (!parent) {\n parent = $(element).closest(\".\" + ClassName.ALERT)[0];\n }\n\n return parent;\n };\n\n _proto._triggerCloseEvent = function _triggerCloseEvent(element) {\n var closeEvent = $.Event(Event.CLOSE);\n $(element).trigger(closeEvent);\n return closeEvent;\n };\n\n _proto._removeElement = function _removeElement(element) {\n var _this = this;\n\n $(element).removeClass(ClassName.SHOW);\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element);\n\n return;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(element);\n $(element).one(Util.TRANSITION_END, function (event) {\n return _this._destroyElement(element, event);\n }).emulateTransitionEnd(transitionDuration);\n };\n\n _proto._destroyElement = function _destroyElement(element) {\n $(element).detach().trigger(Event.CLOSED).remove();\n }; // Static\n\n\n Alert._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new Alert(this);\n $element.data(DATA_KEY, data);\n }\n\n if (config === 'close') {\n data[config](this);\n }\n });\n };\n\n Alert._handleDismiss = function _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault();\n }\n\n alertInstance.close(this);\n };\n };\n\n _createClass(Alert, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Alert;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Alert._jQueryInterface;\n $.fn[NAME].Constructor = Alert;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Alert._jQueryInterface;\n };\n\n return Alert;\n}($);\n//# sourceMappingURL=alert.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($) {function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Button = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'button';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.button';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ClassName = {\n ACTIVE: 'active',\n BUTTON: 'btn',\n FOCUS: 'focus'\n };\n var Selector = {\n DATA_TOGGLE_CARROT: '[data-toggle^=\"button\"]',\n DATA_TOGGLE: '[data-toggle=\"buttons\"]',\n INPUT: 'input',\n ACTIVE: '.active',\n BUTTON: '.btn'\n };\n var Event = {\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY,\n FOCUS_BLUR_DATA_API: \"focus\" + EVENT_KEY + DATA_API_KEY + \" \" + (\"blur\" + EVENT_KEY + DATA_API_KEY)\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Button =\n /*#__PURE__*/\n function () {\n function Button(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Button.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n var triggerChangeEvent = true;\n var addAriaPressed = true;\n var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];\n\n if (rootElement) {\n var input = $(this._element).find(Selector.INPUT)[0];\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {\n triggerChangeEvent = false;\n } else {\n var activeElement = $(rootElement).find(Selector.ACTIVE)[0];\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE);\n }\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {\n return;\n }\n\n input.checked = !$(this._element).hasClass(ClassName.ACTIVE);\n $(input).trigger('change');\n }\n\n input.focus();\n addAriaPressed = false;\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE);\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Static\n\n\n Button._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n if (!data) {\n data = new Button(this);\n $(this).data(DATA_KEY, data);\n }\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n };\n\n _createClass(Button, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Button;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {\n event.preventDefault();\n var button = event.target;\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON);\n }\n\n Button._jQueryInterface.call($(button), 'toggle');\n }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {\n var button = $(event.target).closest(Selector.BUTTON)[0];\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Button._jQueryInterface;\n $.fn[NAME].Constructor = Button;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Button._jQueryInterface;\n };\n\n return Button;\n}($);\n//# sourceMappingURL=button.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Util) {function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Carousel = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'carousel';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.carousel';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n\n var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n var Default = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true\n };\n var DefaultType = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean'\n };\n var Direction = {\n NEXT: 'next',\n PREV: 'prev',\n LEFT: 'left',\n RIGHT: 'right'\n };\n var Event = {\n SLIDE: \"slide\" + EVENT_KEY,\n SLID: \"slid\" + EVENT_KEY,\n KEYDOWN: \"keydown\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY,\n TOUCHEND: \"touchend\" + EVENT_KEY,\n LOAD_DATA_API: \"load\" + EVENT_KEY + DATA_API_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n CAROUSEL: 'carousel',\n ACTIVE: 'active',\n SLIDE: 'slide',\n RIGHT: 'carousel-item-right',\n LEFT: 'carousel-item-left',\n NEXT: 'carousel-item-next',\n PREV: 'carousel-item-prev',\n ITEM: 'carousel-item'\n };\n var Selector = {\n ACTIVE: '.active',\n ACTIVE_ITEM: '.active.carousel-item',\n ITEM: '.carousel-item',\n NEXT_PREV: '.carousel-item-next, .carousel-item-prev',\n INDICATORS: '.carousel-indicators',\n DATA_SLIDE: '[data-slide], [data-slide-to]',\n DATA_RIDE: '[data-ride=\"carousel\"]'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Carousel =\n /*#__PURE__*/\n function () {\n function Carousel(element, config) {\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this._config = this._getConfig(config);\n this._element = $(element)[0];\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Carousel.prototype;\n\n // Public\n _proto.next = function next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT);\n }\n };\n\n _proto.nextWhenVisible = function nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {\n this.next();\n }\n };\n\n _proto.prev = function prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV);\n }\n };\n\n _proto.pause = function pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if ($(this._element).find(Selector.NEXT_PREV)[0]) {\n Util.triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n };\n\n _proto.cycle = function cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n };\n\n _proto.to = function to(index) {\n var _this = this;\n\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];\n\n var activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, function () {\n return _this.to(index);\n });\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;\n\n this._slide(direction, this._items[index]);\n };\n\n _proto.dispose = function dispose() {\n $(this._element).off(EVENT_KEY);\n $.removeData(this._element, DATA_KEY);\n this._items = null;\n this._config = null;\n this._element = null;\n this._interval = null;\n this._isPaused = null;\n this._isSliding = null;\n this._activeElement = null;\n this._indicatorsElement = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this2 = this;\n\n if (this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN, function (event) {\n return _this2._keydown(event);\n });\n }\n\n if (this._config.pause === 'hover') {\n $(this._element).on(Event.MOUSEENTER, function (event) {\n return _this2.pause(event);\n }).on(Event.MOUSELEAVE, function (event) {\n return _this2.cycle(event);\n });\n\n if ('ontouchstart' in document.documentElement) {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n $(this._element).on(Event.TOUCHEND, function () {\n _this2.pause();\n\n if (_this2.touchTimeout) {\n clearTimeout(_this2.touchTimeout);\n }\n\n _this2.touchTimeout = setTimeout(function (event) {\n return _this2.cycle(event);\n }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);\n });\n }\n }\n };\n\n _proto._keydown = function _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault();\n this.prev();\n break;\n\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault();\n this.next();\n break;\n\n default:\n }\n };\n\n _proto._getItemIndex = function _getItemIndex(element) {\n this._items = $.makeArray($(element).parent().find(Selector.ITEM));\n return this._items.indexOf(element);\n };\n\n _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {\n var isNextDirection = direction === Direction.NEXT;\n var isPrevDirection = direction === Direction.PREV;\n\n var activeIndex = this._getItemIndex(activeElement);\n\n var lastItemIndex = this._items.length - 1;\n var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement;\n }\n\n var delta = direction === Direction.PREV ? -1 : 1;\n var itemIndex = (activeIndex + delta) % this._items.length;\n return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];\n };\n\n _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {\n var targetIndex = this._getItemIndex(relatedTarget);\n\n var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]);\n\n var slideEvent = $.Event(Event.SLIDE, {\n relatedTarget: relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n $(this._element).trigger(slideEvent);\n return slideEvent;\n };\n\n _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);\n\n var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE);\n }\n }\n };\n\n _proto._slide = function _slide(direction, element) {\n var _this3 = this;\n\n var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];\n\n var activeElementIndex = this._getItemIndex(activeElement);\n\n var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);\n\n var nextElementIndex = this._getItemIndex(nextElement);\n\n var isCycling = Boolean(this._interval);\n var directionalClassName;\n var orderClassName;\n var eventDirectionName;\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT;\n orderClassName = ClassName.NEXT;\n eventDirectionName = Direction.LEFT;\n } else {\n directionalClassName = ClassName.RIGHT;\n orderClassName = ClassName.PREV;\n eventDirectionName = Direction.RIGHT;\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false;\n return;\n }\n\n var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n var slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n\n if ($(this._element).hasClass(ClassName.SLIDE)) {\n $(nextElement).addClass(orderClassName);\n Util.reflow(nextElement);\n $(activeElement).addClass(directionalClassName);\n $(nextElement).addClass(directionalClassName);\n var transitionDuration = Util.getTransitionDurationFromElement(activeElement);\n $(activeElement).one(Util.TRANSITION_END, function () {\n $(nextElement).removeClass(directionalClassName + \" \" + orderClassName).addClass(ClassName.ACTIVE);\n $(activeElement).removeClass(ClassName.ACTIVE + \" \" + orderClassName + \" \" + directionalClassName);\n _this3._isSliding = false;\n setTimeout(function () {\n return $(_this3._element).trigger(slidEvent);\n }, 0);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE);\n $(nextElement).addClass(ClassName.ACTIVE);\n this._isSliding = false;\n $(this._element).trigger(slidEvent);\n }\n\n if (isCycling) {\n this.cycle();\n }\n }; // Static\n\n\n Carousel._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $(this).data());\n\n if (typeof config === 'object') {\n _config = _objectSpread({}, _config, config);\n }\n\n var action = typeof config === 'string' ? config : _config.slide;\n\n if (!data) {\n data = new Carousel(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + action + \"\\\"\");\n }\n\n data[action]();\n } else if (_config.interval) {\n data.pause();\n data.cycle();\n }\n });\n };\n\n Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {\n var selector = Util.getSelectorFromElement(this);\n\n if (!selector) {\n return;\n }\n\n var target = $(selector)[0];\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return;\n }\n\n var config = _objectSpread({}, $(target).data(), $(this).data());\n\n var slideIndex = this.getAttribute('data-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel._jQueryInterface.call($(target), config);\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex);\n }\n\n event.preventDefault();\n };\n\n _createClass(Carousel, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Carousel;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);\n $(window).on(Event.LOAD_DATA_API, function () {\n $(Selector.DATA_RIDE).each(function () {\n var $carousel = $(this);\n\n Carousel._jQueryInterface.call($carousel, $carousel.data());\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Carousel._jQueryInterface;\n $.fn[NAME].Constructor = Carousel;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Carousel._jQueryInterface;\n };\n\n return Carousel;\n}($);\n//# sourceMappingURL=carousel.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Util) {function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Collapse = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'collapse';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.collapse';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Default = {\n toggle: true,\n parent: ''\n };\n var DefaultType = {\n toggle: 'boolean',\n parent: '(string|element)'\n };\n var Event = {\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n SHOW: 'show',\n COLLAPSE: 'collapse',\n COLLAPSING: 'collapsing',\n COLLAPSED: 'collapsed'\n };\n var Dimension = {\n WIDTH: 'width',\n HEIGHT: 'height'\n };\n var Selector = {\n ACTIVES: '.show, .collapsing',\n DATA_TOGGLE: '[data-toggle=\"collapse\"]'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Collapse =\n /*#__PURE__*/\n function () {\n function Collapse(element, config) {\n this._isTransitioning = false;\n this._element = element;\n this._config = this._getConfig(config);\n this._triggerArray = $.makeArray($(\"[data-toggle=\\\"collapse\\\"][href=\\\"#\" + element.id + \"\\\"],\" + (\"[data-toggle=\\\"collapse\\\"][data-target=\\\"#\" + element.id + \"\\\"]\")));\n var tabToggles = $(Selector.DATA_TOGGLE);\n\n for (var i = 0; i < tabToggles.length; i++) {\n var elem = tabToggles[i];\n var selector = Util.getSelectorFromElement(elem);\n\n if (selector !== null && $(selector).filter(element).length > 0) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null;\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray);\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n var _proto = Collapse.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) {\n return;\n }\n\n var actives;\n var activesData;\n\n if (this._parent) {\n actives = $.makeArray($(this._parent).find(Selector.ACTIVES).filter(\"[data-parent=\\\"\" + this._config.parent + \"\\\"]\"));\n\n if (actives.length === 0) {\n actives = null;\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY);\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n var startEvent = $.Event(Event.SHOW);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');\n\n if (!activesData) {\n $(actives).data(DATA_KEY, null);\n }\n }\n\n var dimension = this._getDimension();\n\n $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);\n this._element.style[dimension] = 0;\n\n if (this._triggerArray.length > 0) {\n $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);\n _this._element.style[dimension] = '';\n\n _this.setTransitioning(false);\n\n $(_this._element).trigger(Event.SHOWN);\n };\n\n var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n var scrollSize = \"scroll\" + capitalizedDimension;\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n this._element.style[dimension] = this._element[scrollSize] + \"px\";\n };\n\n _proto.hide = function hide() {\n var _this2 = this;\n\n if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) {\n return;\n }\n\n var startEvent = $.Event(Event.HIDE);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n var dimension = this._getDimension();\n\n this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + \"px\";\n Util.reflow(this._element);\n $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);\n\n if (this._triggerArray.length > 0) {\n for (var i = 0; i < this._triggerArray.length; i++) {\n var trigger = this._triggerArray[i];\n var selector = Util.getSelectorFromElement(trigger);\n\n if (selector !== null) {\n var $elem = $(selector);\n\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);\n }\n }\n }\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n _this2.setTransitioning(false);\n\n $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);\n };\n\n this._element.style[dimension] = '';\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n };\n\n _proto.setTransitioning = function setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning;\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._config = null;\n this._parent = null;\n this._element = null;\n this._triggerArray = null;\n this._isTransitioning = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._getDimension = function _getDimension() {\n var hasWidth = $(this._element).hasClass(Dimension.WIDTH);\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;\n };\n\n _proto._getParent = function _getParent() {\n var _this3 = this;\n\n var parent = null;\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent; // It's a jQuery object\n\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0];\n }\n } else {\n parent = $(this._config.parent)[0];\n }\n\n var selector = \"[data-toggle=\\\"collapse\\\"][data-parent=\\\"\" + this._config.parent + \"\\\"]\";\n $(parent).find(selector).each(function (i, element) {\n _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);\n });\n return parent;\n };\n\n _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n var isOpen = $(element).hasClass(ClassName.SHOW);\n\n if (triggerArray.length > 0) {\n $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);\n }\n }\n }; // Static\n\n\n Collapse._getTargetFromElement = function _getTargetFromElement(element) {\n var selector = Util.getSelectorFromElement(element);\n return selector ? $(selector)[0] : null;\n };\n\n Collapse._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n if (!data) {\n data = new Collapse(this, _config);\n $this.data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Collapse, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Collapse;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n var $trigger = $(this);\n var selector = Util.getSelectorFromElement(this);\n $(selector).each(function () {\n var $target = $(this);\n var data = $target.data(DATA_KEY);\n var config = data ? 'toggle' : $trigger.data();\n\n Collapse._jQueryInterface.call($target, config);\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface;\n $.fn[NAME].Constructor = Collapse;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Collapse._jQueryInterface;\n };\n\n return Collapse;\n}($);\n//# sourceMappingURL=collapse.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Popper, Util) {function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Dropdown = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'dropdown';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.dropdown';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key\n\n var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key\n\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n\n var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)\n\n var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + \"|\" + ARROW_DOWN_KEYCODE + \"|\" + ESCAPE_KEYCODE);\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY,\n KEYDOWN_DATA_API: \"keydown\" + EVENT_KEY + DATA_API_KEY,\n KEYUP_DATA_API: \"keyup\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DISABLED: 'disabled',\n SHOW: 'show',\n DROPUP: 'dropup',\n DROPRIGHT: 'dropright',\n DROPLEFT: 'dropleft',\n MENURIGHT: 'dropdown-menu-right',\n MENULEFT: 'dropdown-menu-left',\n POSITION_STATIC: 'position-static'\n };\n var Selector = {\n DATA_TOGGLE: '[data-toggle=\"dropdown\"]',\n FORM_CHILD: '.dropdown form',\n MENU: '.dropdown-menu',\n NAVBAR_NAV: '.navbar-nav',\n VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n };\n var AttachmentMap = {\n TOP: 'top-start',\n TOPEND: 'top-end',\n BOTTOM: 'bottom-start',\n BOTTOMEND: 'bottom-end',\n RIGHT: 'right-start',\n RIGHTEND: 'right-end',\n LEFT: 'left-start',\n LEFTEND: 'left-end'\n };\n var Default = {\n offset: 0,\n flip: true,\n boundary: 'scrollParent',\n reference: 'toggle',\n display: 'dynamic'\n };\n var DefaultType = {\n offset: '(number|string|function)',\n flip: 'boolean',\n boundary: '(string|element)',\n reference: '(string|element)',\n display: 'string'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Dropdown =\n /*#__PURE__*/\n function () {\n function Dropdown(element, config) {\n this._element = element;\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Dropdown.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n var isActive = $(this._menu).hasClass(ClassName.SHOW);\n\n Dropdown._clearMenus();\n\n if (isActive) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $.Event(Event.SHOW, relatedTarget);\n $(parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n } // Disable totally Popper.js for Dropdown in Navbar\n\n\n if (!this._inNavbar) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');\n }\n\n var referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference; // Check if it's jQuery element\n\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0];\n }\n } // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n\n\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName.POSITION_STATIC);\n }\n\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n $(this._menu).toggleClass(ClassName.SHOW);\n $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n $(this._element).off(EVENT_KEY);\n this._element = null;\n this._menu = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n\n this._popper = null;\n }\n };\n\n _proto.update = function update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Private\n\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this = this;\n\n $(this._element).on(Event.CLICK, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n _this.toggle();\n });\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getMenuElement = function _getMenuElement() {\n if (!this._menu) {\n var parent = Dropdown._getParentFromElement(this._element);\n\n this._menu = $(parent).find(Selector.MENU)[0];\n }\n\n return this._menu;\n };\n\n _proto._getPlacement = function _getPlacement() {\n var $parentDropdown = $(this._element).parent();\n var placement = AttachmentMap.BOTTOM; // Handle dropup\n\n if ($parentDropdown.hasClass(ClassName.DROPUP)) {\n placement = AttachmentMap.TOP;\n\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND;\n }\n } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT;\n } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {\n placement = AttachmentMap.LEFT;\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND;\n }\n\n return placement;\n };\n\n _proto._detectNavbar = function _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0;\n };\n\n _proto._getPopperConfig = function _getPopperConfig() {\n var _this2 = this;\n\n var offsetConf = {};\n\n if (typeof this._config.offset === 'function') {\n offsetConf.fn = function (data) {\n data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});\n return data;\n };\n } else {\n offsetConf.offset = this._config.offset;\n }\n\n var popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: offsetConf,\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n } // Disable Popper.js if we have a static display\n\n };\n\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n };\n }\n\n return popperConfig;\n }; // Static\n\n\n Dropdown._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data) {\n data = new Dropdown(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n Dropdown._clearMenus = function _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return;\n }\n\n var toggles = $.makeArray($(Selector.DATA_TOGGLE));\n\n for (var i = 0; i < toggles.length; i++) {\n var parent = Dropdown._getParentFromElement(toggles[i]);\n\n var context = $(toggles[i]).data(DATA_KEY);\n var relatedTarget = {\n relatedTarget: toggles[i]\n };\n\n if (!context) {\n continue;\n }\n\n var dropdownMenu = context._menu;\n\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue;\n }\n\n if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {\n continue;\n }\n\n var hideEvent = $.Event(Event.HIDE, relatedTarget);\n $(parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n continue;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n toggles[i].setAttribute('aria-expanded', 'false');\n $(dropdownMenu).removeClass(ClassName.SHOW);\n $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));\n }\n };\n\n Dropdown._getParentFromElement = function _getParentFromElement(element) {\n var parent;\n var selector = Util.getSelectorFromElement(element);\n\n if (selector) {\n parent = $(selector)[0];\n }\n\n return parent || element.parentNode;\n }; // eslint-disable-next-line complexity\n\n\n Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this);\n\n var isActive = $(parent).hasClass(ClassName.SHOW);\n\n if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];\n $(toggle).trigger('focus');\n }\n\n $(this).trigger('click');\n return;\n }\n\n var items = $(parent).find(Selector.VISIBLE_ITEMS).get();\n\n if (items.length === 0) {\n return;\n }\n\n var index = items.indexOf(event.target);\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) {\n // Up\n index--;\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {\n // Down\n index++;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n items[index].focus();\n };\n\n _createClass(Dropdown, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Dropdown;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + \" \" + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n Dropdown._jQueryInterface.call($(this), 'toggle');\n }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {\n e.stopPropagation();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Dropdown._jQueryInterface;\n $.fn[NAME].Constructor = Dropdown;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Dropdown._jQueryInterface;\n };\n\n return Dropdown;\n}($, Popper);\n//# sourceMappingURL=dropdown.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(3)[\"default\"], __webpack_require__(1)))\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Util) {function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Modal = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'modal';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.modal';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var Default = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: true\n };\n var DefaultType = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean',\n show: 'boolean'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n RESIZE: \"resize\" + EVENT_KEY,\n CLICK_DISMISS: \"click.dismiss\" + EVENT_KEY,\n KEYDOWN_DISMISS: \"keydown.dismiss\" + EVENT_KEY,\n MOUSEUP_DISMISS: \"mouseup.dismiss\" + EVENT_KEY,\n MOUSEDOWN_DISMISS: \"mousedown.dismiss\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n SCROLLBAR_MEASURER: 'modal-scrollbar-measure',\n BACKDROP: 'modal-backdrop',\n OPEN: 'modal-open',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n DIALOG: '.modal-dialog',\n DATA_TOGGLE: '[data-toggle=\"modal\"]',\n DATA_DISMISS: '[data-dismiss=\"modal\"]',\n FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT: '.sticky-top',\n NAVBAR_TOGGLER: '.navbar-toggler'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Modal =\n /*#__PURE__*/\n function () {\n function Modal(element, config) {\n this._config = this._getConfig(config);\n this._element = element;\n this._dialog = $(element).find(Selector.DIALOG)[0];\n this._backdrop = null;\n this._isShown = false;\n this._isBodyOverflowing = false;\n this._ignoreBackdropClick = false;\n this._scrollbarWidth = 0;\n } // Getters\n\n\n var _proto = Modal.prototype;\n\n // Public\n _proto.toggle = function toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n };\n\n _proto.show = function show(relatedTarget) {\n var _this = this;\n\n if (this._isTransitioning || this._isShown) {\n return;\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true;\n }\n\n var showEvent = $.Event(Event.SHOW, {\n relatedTarget: relatedTarget\n });\n $(this._element).trigger(showEvent);\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = true;\n\n this._checkScrollbar();\n\n this._setScrollbar();\n\n this._adjustDialog();\n\n $(document.body).addClass(ClassName.OPEN);\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {\n return _this.hide(event);\n });\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {\n $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {\n if ($(event.target).is(_this._element)) {\n _this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(function () {\n return _this._showElement(relatedTarget);\n });\n };\n\n _proto.hide = function hide(event) {\n var _this2 = this;\n\n if (event) {\n event.preventDefault();\n }\n\n if (this._isTransitioning || !this._isShown) {\n return;\n }\n\n var hideEvent = $.Event(Event.HIDE);\n $(this._element).trigger(hideEvent);\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = false;\n var transition = $(this._element).hasClass(ClassName.FADE);\n\n if (transition) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(document).off(Event.FOCUSIN);\n $(this._element).removeClass(ClassName.SHOW);\n $(this._element).off(Event.CLICK_DISMISS);\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS);\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, function (event) {\n return _this2._hideModal(event);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n this._hideModal();\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n $(window, document, this._element, this._backdrop).off(EVENT_KEY);\n this._config = null;\n this._element = null;\n this._dialog = null;\n this._backdrop = null;\n this._isShown = null;\n this._isBodyOverflowing = null;\n this._ignoreBackdropClick = null;\n this._scrollbarWidth = null;\n };\n\n _proto.handleUpdate = function handleUpdate() {\n this._adjustDialog();\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._showElement = function _showElement(relatedTarget) {\n var _this3 = this;\n\n var transition = $(this._element).hasClass(ClassName.FADE);\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.scrollTop = 0;\n\n if (transition) {\n Util.reflow(this._element);\n }\n\n $(this._element).addClass(ClassName.SHOW);\n\n if (this._config.focus) {\n this._enforceFocus();\n }\n\n var shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: relatedTarget\n });\n\n var transitionComplete = function transitionComplete() {\n if (_this3._config.focus) {\n _this3._element.focus();\n }\n\n _this3._isTransitioning = false;\n $(_this3._element).trigger(shownEvent);\n };\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);\n } else {\n transitionComplete();\n }\n };\n\n _proto._enforceFocus = function _enforceFocus() {\n var _this4 = this;\n\n $(document).off(Event.FOCUSIN) // Guard against infinite focus loop\n .on(Event.FOCUSIN, function (event) {\n if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {\n _this4._element.focus();\n }\n });\n };\n\n _proto._setEscapeEvent = function _setEscapeEvent() {\n var _this5 = this;\n\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, function (event) {\n if (event.which === ESCAPE_KEYCODE) {\n event.preventDefault();\n\n _this5.hide();\n }\n });\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS);\n }\n };\n\n _proto._setResizeEvent = function _setResizeEvent() {\n var _this6 = this;\n\n if (this._isShown) {\n $(window).on(Event.RESIZE, function (event) {\n return _this6.handleUpdate(event);\n });\n } else {\n $(window).off(Event.RESIZE);\n }\n };\n\n _proto._hideModal = function _hideModal() {\n var _this7 = this;\n\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._isTransitioning = false;\n\n this._showBackdrop(function () {\n $(document.body).removeClass(ClassName.OPEN);\n\n _this7._resetAdjustments();\n\n _this7._resetScrollbar();\n\n $(_this7._element).trigger(Event.HIDDEN);\n });\n };\n\n _proto._removeBackdrop = function _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove();\n this._backdrop = null;\n }\n };\n\n _proto._showBackdrop = function _showBackdrop(callback) {\n var _this8 = this;\n\n var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div');\n this._backdrop.className = ClassName.BACKDROP;\n\n if (animate) {\n $(this._backdrop).addClass(animate);\n }\n\n $(this._backdrop).appendTo(document.body);\n $(this._element).on(Event.CLICK_DISMISS, function (event) {\n if (_this8._ignoreBackdropClick) {\n _this8._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (_this8._config.backdrop === 'static') {\n _this8._element.focus();\n } else {\n _this8.hide();\n }\n });\n\n if (animate) {\n Util.reflow(this._backdrop);\n }\n\n $(this._backdrop).addClass(ClassName.SHOW);\n\n if (!callback) {\n return;\n }\n\n if (!animate) {\n callback();\n return;\n }\n\n var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW);\n\n var callbackRemove = function callbackRemove() {\n _this8._removeBackdrop();\n\n if (callback) {\n callback();\n }\n };\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n\n $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);\n } else {\n callbackRemove();\n }\n } else if (callback) {\n callback();\n }\n }; // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n\n _proto._adjustDialog = function _adjustDialog() {\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = this._scrollbarWidth + \"px\";\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = this._scrollbarWidth + \"px\";\n }\n };\n\n _proto._resetAdjustments = function _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n };\n\n _proto._checkScrollbar = function _checkScrollbar() {\n var rect = document.body.getBoundingClientRect();\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;\n this._scrollbarWidth = this._getScrollbarWidth();\n };\n\n _proto._setScrollbar = function _setScrollbar() {\n var _this9 = this;\n\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n // Adjust fixed content padding\n $(Selector.FIXED_CONTENT).each(function (index, element) {\n var actualPadding = $(element)[0].style.paddingRight;\n var calculatedPadding = $(element).css('padding-right');\n $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + \"px\");\n }); // Adjust sticky content margin\n\n $(Selector.STICKY_CONTENT).each(function (index, element) {\n var actualMargin = $(element)[0].style.marginRight;\n var calculatedMargin = $(element).css('margin-right');\n $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + \"px\");\n }); // Adjust navbar-toggler margin\n\n $(Selector.NAVBAR_TOGGLER).each(function (index, element) {\n var actualMargin = $(element)[0].style.marginRight;\n var calculatedMargin = $(element).css('margin-right');\n $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + \"px\");\n }); // Adjust body padding\n\n var actualPadding = document.body.style.paddingRight;\n var calculatedPadding = $(document.body).css('padding-right');\n $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + \"px\");\n }\n };\n\n _proto._resetScrollbar = function _resetScrollbar() {\n // Restore fixed content padding\n $(Selector.FIXED_CONTENT).each(function (index, element) {\n var padding = $(element).data('padding-right');\n\n if (typeof padding !== 'undefined') {\n $(element).css('padding-right', padding).removeData('padding-right');\n }\n }); // Restore sticky content and navbar-toggler margin\n\n $(Selector.STICKY_CONTENT + \", \" + Selector.NAVBAR_TOGGLER).each(function (index, element) {\n var margin = $(element).data('margin-right');\n\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right');\n }\n }); // Restore body padding\n\n var padding = $(document.body).data('padding-right');\n\n if (typeof padding !== 'undefined') {\n $(document.body).css('padding-right', padding).removeData('padding-right');\n }\n };\n\n _proto._getScrollbarWidth = function _getScrollbarWidth() {\n // thx d.walsh\n var scrollDiv = document.createElement('div');\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER;\n document.body.appendChild(scrollDiv);\n var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n }; // Static\n\n\n Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});\n\n if (!data) {\n data = new Modal(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config](relatedTarget);\n } else if (_config.show) {\n data.show(relatedTarget);\n }\n });\n };\n\n _createClass(Modal, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Modal;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n var _this10 = this;\n\n var target;\n var selector = Util.getSelectorFromElement(this);\n\n if (selector) {\n target = $(selector)[0];\n }\n\n var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault();\n }\n\n var $target = $(target).one(Event.SHOW, function (showEvent) {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return;\n }\n\n $target.one(Event.HIDDEN, function () {\n if ($(_this10).is(':visible')) {\n _this10.focus();\n }\n });\n });\n\n Modal._jQueryInterface.call($(target), config, this);\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Modal._jQueryInterface;\n $.fn[NAME].Constructor = Modal;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Modal._jQueryInterface;\n };\n\n return Modal;\n}($);\n//# sourceMappingURL=modal.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Popper, Util) {function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Tooltip = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tooltip';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.tooltip';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DefaultType = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)'\n };\n var AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<div class=\"tooltip-inner\"></div></div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent'\n };\n var HoverState = {\n SHOW: 'show',\n OUT: 'out'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n };\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TOOLTIP: '.tooltip',\n TOOLTIP_INNER: '.tooltip-inner',\n ARROW: '.arrow'\n };\n var Trigger = {\n HOVER: 'hover',\n FOCUS: 'focus',\n CLICK: 'click',\n MANUAL: 'manual'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tooltip =\n /*#__PURE__*/\n function () {\n function Tooltip(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $.removeData(this.element, this.constructor.DATA_KEY);\n $(this.element).off(this.constructor.EVENT_KEY);\n $(this.element).closest('.modal').off('hide.bs.modal');\n\n if (this.tip) {\n $(this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $.Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent);\n var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n var container = this.config.container === false ? document.body : $(this.config.container);\n $(tip).data(this.constructor.DATA_KEY, this);\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container);\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: {\n offset: this.config.offset\n },\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n _this._handlePopperPlacementChange(data);\n }\n });\n $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $(_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HoverState.OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $.Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $(this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n this._activeTrigger[Trigger.CLICK] = false;\n this._activeTrigger[Trigger.FOCUS] = false;\n this._activeTrigger[Trigger.HOVER] = false;\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Protected\n\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement());\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());\n $tip.removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n var html = this.config.html;\n\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($(content).text());\n }\n } else {\n $element[html ? 'html' : 'text'](content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n }; // Private\n\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this3 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {\n return _this3.toggle(event);\n });\n } else if (trigger !== Trigger.MANUAL) {\n var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;\n var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;\n $(_this3.element).on(eventIn, _this3.config.selector, function (event) {\n return _this3._enter(event);\n }).on(eventOut, _this3.config.selector, function (event) {\n return _this3._leave(event);\n });\n }\n\n $(_this3.element).closest('.modal').on('hide.bs.modal', function () {\n return _this3.hide();\n });\n });\n\n if (this.config.selector) {\n this.config = _objectSpread({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute('data-original-title');\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(data.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $(tip).removeClass(ClassName.FADE);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n }; // Static\n\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME] = Tooltip._jQueryInterface;\n $.fn[NAME].Constructor = Tooltip;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tooltip._jQueryInterface;\n };\n\n return Tooltip;\n}($, Popper);\n//# sourceMappingURL=tooltip.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(3)[\"default\"], __webpack_require__(1)))\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Tooltip) {function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Popover = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'popover';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.popover';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var CLASS_PREFIX = 'bs-popover';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n\n var Default = _objectSpread({}, Tooltip.Default, {\n placement: 'right',\n trigger: 'click',\n content: '',\n template: '<div class=\"popover\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<h3 class=\"popover-header\"></h3>' + '<div class=\"popover-body\"></div></div>'\n });\n\n var DefaultType = _objectSpread({}, Tooltip.DefaultType, {\n content: '(string|element|function)'\n });\n\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TITLE: '.popover-header',\n CONTENT: '.popover-body'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Popover =\n /*#__PURE__*/\n function (_Tooltip) {\n _inheritsLoose(Popover, _Tooltip);\n\n function Popover() {\n return _Tooltip.apply(this, arguments) || this;\n }\n\n var _proto = Popover.prototype;\n\n // Overrides\n _proto.isWithContent = function isWithContent() {\n return this.getTitle() || this._getContent();\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events\n\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle());\n\n var content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector.CONTENT), content);\n $tip.removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n }; // Private\n\n\n _proto._getContent = function _getContent() {\n return this.element.getAttribute('data-content') || this.config.content;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n }; // Static\n\n\n Popover._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data && /destroy|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Popover(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Popover, null, [{\n key: \"VERSION\",\n // Getters\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Popover;\n }(Tooltip);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME] = Popover._jQueryInterface;\n $.fn[NAME].Constructor = Popover;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Popover._jQueryInterface;\n };\n\n return Popover;\n}($);\n//# sourceMappingURL=popover.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(17)))\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Popper, Util) {function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Tooltip = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tooltip';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.tooltip';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DefaultType = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)'\n };\n var AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<div class=\"tooltip-inner\"></div></div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent'\n };\n var HoverState = {\n SHOW: 'show',\n OUT: 'out'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n };\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TOOLTIP: '.tooltip',\n TOOLTIP_INNER: '.tooltip-inner',\n ARROW: '.arrow'\n };\n var Trigger = {\n HOVER: 'hover',\n FOCUS: 'focus',\n CLICK: 'click',\n MANUAL: 'manual'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tooltip =\n /*#__PURE__*/\n function () {\n function Tooltip(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $.removeData(this.element, this.constructor.DATA_KEY);\n $(this.element).off(this.constructor.EVENT_KEY);\n $(this.element).closest('.modal').off('hide.bs.modal');\n\n if (this.tip) {\n $(this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $.Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent);\n var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n var container = this.config.container === false ? document.body : $(this.config.container);\n $(tip).data(this.constructor.DATA_KEY, this);\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container);\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: {\n offset: this.config.offset\n },\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n _this._handlePopperPlacementChange(data);\n }\n });\n $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $(_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HoverState.OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $.Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $(this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n this._activeTrigger[Trigger.CLICK] = false;\n this._activeTrigger[Trigger.FOCUS] = false;\n this._activeTrigger[Trigger.HOVER] = false;\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Protected\n\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement());\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());\n $tip.removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n var html = this.config.html;\n\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($(content).text());\n }\n } else {\n $element[html ? 'html' : 'text'](content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n }; // Private\n\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this3 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {\n return _this3.toggle(event);\n });\n } else if (trigger !== Trigger.MANUAL) {\n var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;\n var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;\n $(_this3.element).on(eventIn, _this3.config.selector, function (event) {\n return _this3._enter(event);\n }).on(eventOut, _this3.config.selector, function (event) {\n return _this3._leave(event);\n });\n }\n\n $(_this3.element).closest('.modal').on('hide.bs.modal', function () {\n return _this3.hide();\n });\n });\n\n if (this.config.selector) {\n this.config = _objectSpread({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute('data-original-title');\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(data.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $(tip).removeClass(ClassName.FADE);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n }; // Static\n\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME] = Tooltip._jQueryInterface;\n $.fn[NAME].Constructor = Tooltip;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tooltip._jQueryInterface;\n };\n\n return Tooltip;\n}($, Popper);\n//# sourceMappingURL=tooltip.js.map\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = Tooltip;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(3)[\"default\"], __webpack_require__(1)))\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Util) {function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar ScrollSpy = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'scrollspy';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.scrollspy';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Default = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n var DefaultType = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n var Event = {\n ACTIVATE: \"activate\" + EVENT_KEY,\n SCROLL: \"scroll\" + EVENT_KEY,\n LOAD_DATA_API: \"load\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DROPDOWN_ITEM: 'dropdown-item',\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active'\n };\n var Selector = {\n DATA_SPY: '[data-spy=\"scroll\"]',\n ACTIVE: '.active',\n NAV_LIST_GROUP: '.nav, .list-group',\n NAV_LINKS: '.nav-link',\n NAV_ITEMS: '.nav-item',\n LIST_ITEMS: '.list-group-item',\n DROPDOWN: '.dropdown',\n DROPDOWN_ITEMS: '.dropdown-item',\n DROPDOWN_TOGGLE: '.dropdown-toggle'\n };\n var OffsetMethod = {\n OFFSET: 'offset',\n POSITION: 'position'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var ScrollSpy =\n /*#__PURE__*/\n function () {\n function ScrollSpy(element, config) {\n var _this = this;\n\n this._element = element;\n this._scrollElement = element.tagName === 'BODY' ? window : element;\n this._config = this._getConfig(config);\n this._selector = this._config.target + \" \" + Selector.NAV_LINKS + \",\" + (this._config.target + \" \" + Selector.LIST_ITEMS + \",\") + (this._config.target + \" \" + Selector.DROPDOWN_ITEMS);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n $(this._scrollElement).on(Event.SCROLL, function (event) {\n return _this._process(event);\n });\n this.refresh();\n\n this._process();\n } // Getters\n\n\n var _proto = ScrollSpy.prototype;\n\n // Public\n _proto.refresh = function refresh() {\n var _this2 = this;\n\n var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;\n var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n var targets = $.makeArray($(this._selector));\n targets.map(function (element) {\n var target;\n var targetSelector = Util.getSelectorFromElement(element);\n\n if (targetSelector) {\n target = $(targetSelector)[0];\n }\n\n if (target) {\n var targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [$(target)[offsetMethod]().top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(function (item) {\n return item;\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).forEach(function (item) {\n _this2._offsets.push(item[0]);\n\n _this2._targets.push(item[1]);\n });\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n $(this._scrollElement).off(EVENT_KEY);\n this._element = null;\n this._scrollElement = null;\n this._config = null;\n this._selector = null;\n this._offsets = null;\n this._targets = null;\n this._activeTarget = null;\n this._scrollHeight = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});\n\n if (typeof config.target !== 'string') {\n var id = $(config.target).attr('id');\n\n if (!id) {\n id = Util.getUID(NAME);\n $(config.target).attr('id', id);\n }\n\n config.target = \"#\" + id;\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._getScrollTop = function _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n };\n\n _proto._getScrollHeight = function _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n };\n\n _proto._getOffsetHeight = function _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n };\n\n _proto._process = function _process() {\n var scrollTop = this._getScrollTop() + this._config.offset;\n\n var scrollHeight = this._getScrollHeight();\n\n var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n for (var i = this._offsets.length; i--;) {\n var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n };\n\n _proto._activate = function _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style\n\n\n queries = queries.map(function (selector) {\n return selector + \"[data-target=\\\"\" + target + \"\\\"],\" + (selector + \"[href=\\\"\" + target + \"\\\"]\");\n });\n var $link = $(queries.join(','));\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);\n $link.addClass(ClassName.ACTIVE);\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + \", \" + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item\n\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n });\n };\n\n _proto._clear = function _clear() {\n $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);\n }; // Static\n\n\n ScrollSpy._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data) {\n data = new ScrollSpy(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(ScrollSpy, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return ScrollSpy;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(window).on(Event.LOAD_DATA_API, function () {\n var scrollSpys = $.makeArray($(Selector.DATA_SPY));\n\n for (var i = scrollSpys.length; i--;) {\n var $spy = $(scrollSpys[i]);\n\n ScrollSpy._jQueryInterface.call($spy, $spy.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = ScrollSpy._jQueryInterface;\n $.fn[NAME].Constructor = ScrollSpy;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return ScrollSpy._jQueryInterface;\n };\n\n return ScrollSpy;\n}($);\n//# sourceMappingURL=scrollspy.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function($, Util) {function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Tab = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tab';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.tab';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active',\n DISABLED: 'disabled',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n DROPDOWN: '.dropdown',\n NAV_LIST_GROUP: '.nav, .list-group',\n ACTIVE: '.active',\n ACTIVE_UL: '> li > .active',\n DATA_TOGGLE: '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE: '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tab =\n /*#__PURE__*/\n function () {\n function Tab(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Tab.prototype;\n\n // Public\n _proto.show = function show() {\n var _this = this;\n\n if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var target;\n var previous;\n var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0];\n var selector = Util.getSelectorFromElement(this._element);\n\n if (listElement) {\n var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;\n previous = $.makeArray($(listElement).find(itemSelector));\n previous = previous[previous.length - 1];\n }\n\n var hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n });\n var showEvent = $.Event(Event.SHOW, {\n relatedTarget: previous\n });\n\n if (previous) {\n $(previous).trigger(hideEvent);\n }\n\n $(this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (selector) {\n target = $(selector)[0];\n }\n\n this._activate(this._element, listElement);\n\n var complete = function complete() {\n var hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: _this._element\n });\n var shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n });\n $(previous).trigger(hiddenEvent);\n $(_this._element).trigger(shownEvent);\n };\n\n if (target) {\n this._activate(target, target.parentNode, complete);\n } else {\n complete();\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Private\n\n\n _proto._activate = function _activate(element, container, callback) {\n var _this2 = this;\n\n var activeElements;\n\n if (container.nodeName === 'UL') {\n activeElements = $(container).find(Selector.ACTIVE_UL);\n } else {\n activeElements = $(container).children(Selector.ACTIVE);\n }\n\n var active = activeElements[0];\n var isTransitioning = callback && active && $(active).hasClass(ClassName.FADE);\n\n var complete = function complete() {\n return _this2._transitionComplete(element, active, callback);\n };\n\n if (active && isTransitioning) {\n var transitionDuration = Util.getTransitionDurationFromElement(active);\n $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto._transitionComplete = function _transitionComplete(element, active, callback) {\n if (active) {\n $(active).removeClass(ClassName.SHOW + \" \" + ClassName.ACTIVE);\n var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName.ACTIVE);\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false);\n }\n }\n\n $(element).addClass(ClassName.ACTIVE);\n\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true);\n }\n\n Util.reflow(element);\n $(element).addClass(ClassName.SHOW);\n\n if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];\n\n if (dropdownElement) {\n $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);\n }\n\n element.setAttribute('aria-expanded', true);\n }\n\n if (callback) {\n callback();\n }\n }; // Static\n\n\n Tab._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(DATA_KEY);\n\n if (!data) {\n data = new Tab(this);\n $this.data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tab, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Tab;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault();\n\n Tab._jQueryInterface.call($(this), 'show');\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tab._jQueryInterface;\n $.fn[NAME].Constructor = Tab;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tab._jQueryInterface;\n };\n\n return Tab;\n}($);\n//# sourceMappingURL=tab.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(__webpack_provided_window_dot_jQuery) {(function() {\n var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n (function($, window) {\n var Offcanvas, OffcanvasDropdown, OffcanvasTouch;\n OffcanvasDropdown = (function() {\n function OffcanvasDropdown(element) {\n this.element = element;\n this._clickEvent = __bind(this._clickEvent, this);\n this.element = $(this.element);\n this.nav = this.element.closest(\".nav\");\n this.dropdown = this.element.parent().find(\".dropdown-menu\");\n this.element.on('click', this._clickEvent);\n this.nav.closest('.navbar-offcanvas').on('click', (function(_this) {\n return function() {\n if (_this.dropdown.is('.shown')) {\n return _this.dropdown.removeClass('shown').closest('.open').removeClass('open');\n }\n };\n })(this));\n }\n\n OffcanvasDropdown.prototype._clickEvent = function(e) {\n if (!this.dropdown.hasClass('shown')) {\n e.preventDefault();\n }\n e.stopPropagation();\n $('.dropdown-toggle').not(this.element).closest('.open').removeClass('open').find('.dropdown-menu').removeClass('shown');\n this.dropdown.toggleClass(\"shown\");\n return this.element.parent().toggleClass('open');\n };\n\n return OffcanvasDropdown;\n\n })();\n OffcanvasTouch = (function() {\n function OffcanvasTouch(button, element, location, offcanvas) {\n this.button = button;\n this.element = element;\n this.location = location;\n this.offcanvas = offcanvas;\n this._getFade = __bind(this._getFade, this);\n this._getCss = __bind(this._getCss, this);\n this._touchEnd = __bind(this._touchEnd, this);\n this._touchMove = __bind(this._touchMove, this);\n this._touchStart = __bind(this._touchStart, this);\n this.endThreshold = 130;\n this.startThreshold = this.element.hasClass('navbar-offcanvas-right') ? $(\"body\").outerWidth() - 60 : 20;\n this.maxStartThreshold = this.element.hasClass('navbar-offcanvas-right') ? $(\"body\").outerWidth() - 20 : 60;\n this.currentX = 0;\n this.fade = this.element.hasClass('navbar-offcanvas-fade') ? true : false;\n $(document).on(\"touchstart\", this._touchStart);\n $(document).on(\"touchmove\", this._touchMove);\n $(document).on(\"touchend\", this._touchEnd);\n }\n\n OffcanvasTouch.prototype._touchStart = function(e) {\n this.startX = e.originalEvent.touches[0].pageX;\n if (this.element.is('.in')) {\n return this.element.height($(window).outerHeight());\n }\n };\n\n OffcanvasTouch.prototype._touchMove = function(e) {\n var x;\n if ($(e.target).parents('.navbar-offcanvas').length > 0) {\n return true;\n }\n if (this.startX > this.startThreshold && this.startX < this.maxStartThreshold) {\n e.preventDefault();\n x = e.originalEvent.touches[0].pageX - this.startX;\n x = this.element.hasClass('navbar-offcanvas-right') ? -x : x;\n if (Math.abs(x) < this.element.outerWidth()) {\n this.element.css(this._getCss(x));\n return this.element.css(this._getFade(x));\n }\n } else if (this.element.hasClass('in')) {\n e.preventDefault();\n x = e.originalEvent.touches[0].pageX + (this.currentX - this.startX);\n x = this.element.hasClass('navbar-offcanvas-right') ? -x : x;\n if (Math.abs(x) < this.element.outerWidth()) {\n this.element.css(this._getCss(x));\n return this.element.css(this._getFade(x));\n }\n }\n };\n\n OffcanvasTouch.prototype._touchEnd = function(e) {\n var end, sendEvents, x;\n if ($(e.target).parents('.navbar-offcanvas').length > 0) {\n return true;\n }\n sendEvents = false;\n x = e.originalEvent.changedTouches[0].pageX;\n if (Math.abs(x) === this.startX) {\n return;\n }\n end = this.element.hasClass('navbar-offcanvas-right') ? Math.abs(x) > (this.endThreshold + 50) : x < (this.endThreshold + 50);\n if (this.element.hasClass('in') && end) {\n this.currentX = 0;\n this.element.removeClass('in').css(this._clearCss());\n this.button.removeClass('is-open');\n sendEvents = true;\n } else if (Math.abs(x - this.startX) > this.endThreshold && this.startX > this.startThreshold && this.startX < this.maxStartThreshold) {\n this.currentX = this.element.hasClass('navbar-offcanvas-right') ? -this.element.outerWidth() : this.element.outerWidth();\n this.element.toggleClass('in').css(this._clearCss());\n this.button.toggleClass('is-open');\n sendEvents = true;\n } else {\n this.element.css(this._clearCss());\n }\n return this.offcanvas.bodyOverflow(sendEvents);\n };\n\n OffcanvasTouch.prototype._getCss = function(x) {\n x = this.element.hasClass('navbar-offcanvas-right') ? -x : x;\n return {\n \"-webkit-transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"-webkit-transition-duration\": \"0s\",\n \"-moz-transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"-moz-transition\": \"0s\",\n \"-o-transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"-o-transition\": \"0s\",\n \"transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"transition\": \"0s\"\n };\n };\n\n OffcanvasTouch.prototype._getFade = function(x) {\n if (this.fade) {\n return {\n \"opacity\": x / this.element.outerWidth()\n };\n } else {\n return {};\n }\n };\n\n OffcanvasTouch.prototype._clearCss = function() {\n return {\n \"-webkit-transform\": \"\",\n \"-webkit-transition-duration\": \"\",\n \"-moz-transform\": \"\",\n \"-moz-transition\": \"\",\n \"-o-transform\": \"\",\n \"-o-transition\": \"\",\n \"transform\": \"\",\n \"transition\": \"\",\n \"opacity\": \"\"\n };\n };\n\n return OffcanvasTouch;\n\n })();\n window.Offcanvas = Offcanvas = (function() {\n function Offcanvas(element) {\n var t, target;\n this.element = element;\n this.bodyOverflow = __bind(this.bodyOverflow, this);\n this._sendEventsAfter = __bind(this._sendEventsAfter, this);\n this._sendEventsBefore = __bind(this._sendEventsBefore, this);\n this._documentClicked = __bind(this._documentClicked, this);\n this._close = __bind(this._close, this);\n this._open = __bind(this._open, this);\n this._clicked = __bind(this._clicked, this);\n this._navbarHeight = __bind(this._navbarHeight, this);\n target = this.element.attr('data-target') ? this.element.attr('data-target') : false;\n if (target) {\n this.target = $(target);\n if (this.target.length && !this.target.hasClass('js-offcanvas-done')) {\n this.element.addClass('js-offcanvas-has-events');\n this.location = this.target.hasClass(\"navbar-offcanvas-right\") ? \"right\" : \"left\";\n this.target.addClass(this._transformSupported() ? \"offcanvas-transform js-offcanvas-done\" : \"offcanvas-position js-offcanvas-done\");\n this.target.data('offcanvas', this);\n this.element.on(\"click\", this._clicked);\n this.target.on('transitionend', (function(_this) {\n return function() {\n if (_this.target.is(':not(.in)')) {\n return _this.target.height('');\n }\n };\n })(this));\n $(document).on(\"click\", this._documentClicked);\n if (this.target.hasClass('navbar-offcanvas-touch')) {\n t = new OffcanvasTouch(this.element, this.target, this.location, this);\n }\n this.target.find(\".dropdown-toggle\").each(function() {\n var d;\n return d = new OffcanvasDropdown(this);\n });\n this.target.on('offcanvas.toggle', (function(_this) {\n return function(e) {\n return _this._clicked(e);\n };\n })(this));\n this.target.on('offcanvas.close', (function(_this) {\n return function(e) {\n return _this._close(e);\n };\n })(this));\n this.target.on('offcanvas.open', (function(_this) {\n return function(e) {\n return _this._open(e);\n };\n })(this));\n }\n } else {\n console.warn('Offcanvas: `data-target` attribute must be present.');\n }\n }\n\n Offcanvas.prototype._navbarHeight = function() {\n if (this.target.is('.in')) {\n return this.target.height($(window).outerHeight());\n }\n };\n\n Offcanvas.prototype._clicked = function(e) {\n e.preventDefault();\n this._sendEventsBefore();\n $(\".navbar-offcanvas\").not(this.target).trigger('offcanvas.close');\n this.target.toggleClass('in');\n this.element.toggleClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n };\n\n Offcanvas.prototype._open = function(e) {\n e.preventDefault();\n if (this.target.is('.in')) {\n return;\n }\n this._sendEventsBefore();\n this.target.addClass('in');\n this.element.addClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n };\n\n Offcanvas.prototype._close = function(e) {\n e.preventDefault();\n if (this.target.is(':not(.in)')) {\n return;\n }\n this._sendEventsBefore();\n this.target.removeClass('in');\n this.element.removeClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n };\n\n Offcanvas.prototype._documentClicked = function(e) {\n var clickedEl;\n clickedEl = $(e.target);\n if (!clickedEl.hasClass('offcanvas-toggle') && clickedEl.parents('.offcanvas-toggle').length === 0 && clickedEl.parents('.navbar-offcanvas').length === 0 && !clickedEl.hasClass('navbar-offcanvas')) {\n if (this.target.hasClass('in')) {\n e.preventDefault();\n this._sendEventsBefore();\n this.target.removeClass('in');\n this.element.removeClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n }\n }\n };\n\n Offcanvas.prototype._sendEventsBefore = function() {\n if (this.target.hasClass('in')) {\n return this.target.trigger('hide.bs.offcanvas');\n } else {\n return this.target.trigger('show.bs.offcanvas');\n }\n };\n\n Offcanvas.prototype._sendEventsAfter = function() {\n if (this.target.hasClass('in')) {\n return this.target.trigger('shown.bs.offcanvas');\n } else {\n return this.target.trigger('hidden.bs.offcanvas');\n }\n };\n\n Offcanvas.prototype.bodyOverflow = function(events) {\n if (events == null) {\n events = true;\n }\n if (this.target.is('.in')) {\n $('body').addClass('offcanvas-stop-scrolling');\n } else {\n $('body').removeClass('offcanvas-stop-scrolling');\n }\n if (events) {\n return this._sendEventsAfter();\n }\n };\n\n Offcanvas.prototype._transformSupported = function() {\n var asSupport, el, regex, translate3D;\n el = document.createElement('div');\n translate3D = \"translate3d(0px, 0px, 0px)\";\n regex = /translate3d\\(0px, 0px, 0px\\)/g;\n el.style.cssText = \"-webkit-transform: \" + translate3D + \"; -moz-transform: \" + translate3D + \"; -o-transform: \" + translate3D + \"; transform: \" + translate3D;\n asSupport = el.style.cssText.match(regex);\n return asSupport.length != null;\n };\n\n return Offcanvas;\n\n })();\n $.fn.bsOffcanvas = function() {\n return this.each(function() {\n return new Offcanvas($(this));\n });\n };\n return $(function() {\n $('[data-toggle=\"offcanvas\"]').each(function() {\n return $(this).bsOffcanvas();\n });\n $(window).on('resize', function() {\n $('.navbar-offcanvas.in').each(function() {\n return $(this).height('').removeClass('in');\n });\n $('.offcanvas-toggle').removeClass('is-open');\n return $('body').removeClass('offcanvas-stop-scrolling');\n });\n return $('.offcanvas-toggle').each(function() {\n return $(this).on('click', function(e) {\n var el, selector;\n if (!$(this).hasClass('js-offcanvas-has-events')) {\n selector = $(this).attr('data-target');\n el = $(selector);\n if (el) {\n el.height('');\n el.removeClass('in');\n return $('body').css({\n overflow: '',\n position: ''\n });\n }\n }\n });\n });\n });\n })(__webpack_provided_window_dot_jQuery, window);\n\n}).call(this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(factory) {\r\n if (true) {\r\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0), __webpack_require__(5)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n } else if (typeof exports === 'object') {\r\n factory(require('jquery'), require('hammerjs'));\r\n } else {\r\n factory(jQuery, Hammer);\r\n }\r\n}(function($, Hammer) {\r\n function hammerify(el, options) {\r\n var $el = $(el);\r\n if(!$el.data(\"hammer\")) {\r\n $el.data(\"hammer\", new Hammer($el[0], options));\r\n }\r\n }\r\n\r\n $.fn.hammer = function(options) {\r\n return this.each(function() {\r\n hammerify(this, options);\r\n });\r\n };\r\n\r\n // extend the emit method to also trigger jQuery events\r\n Hammer.Manager.prototype.emit = (function(originalEmit) {\r\n return function(type, data) {\r\n originalEmit.call(this, type, data);\r\n $(this.element).trigger({\r\n type: type,\r\n gesture: data\r\n });\r\n };\r\n })(Hammer.Manager.prototype.emit);\r\n}));\r\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {var require;var require;// PouchDB 6.4.3\n// \n// (c) 2012-2018 Dale Harvey and the PouchDB team\n// PouchDB may be freely distributed under the Apache license, version 2.0.\n// For all details and documentation:\n// http://pouchdb.com\n(function(f){if(true){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.PouchDB = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n'use strict';\n\nmodule.exports = argsArray;\n\nfunction argsArray(fun) {\n return function () {\n var len = arguments.length;\n if (len) {\n var args = [];\n var i = -1;\n while (++i < len) {\n args[i] = arguments[i];\n }\n return fun.call(this, args);\n } else {\n return fun.call(this, []);\n }\n };\n}\n},{}],2:[function(_dereq_,module,exports){\n(function (process){\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = _dereq_(3);\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',\n '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',\n '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',\n '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',\n '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',\n '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',\n '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',\n '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',\n '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',\n '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',\n '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // Internet Explorer and Edge do not support colors.\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n}).call(this,_dereq_(9))\n},{\"3\":3,\"9\":9}],3:[function(_dereq_,module,exports){\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = _dereq_(8);\n\n/**\n * Active `debug` instances.\n */\nexports.instances = [];\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n var prevTime;\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n exports.instances.push(debug);\n\n return debug;\n}\n\nfunction destroy () {\n var index = exports.instances.indexOf(this);\n if (index !== -1) {\n exports.instances.splice(index, 1);\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < exports.instances.length; i++) {\n var instance = exports.instances[i];\n instance.enabled = exports.enabled(instance.namespace);\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n},{\"8\":8}],4:[function(_dereq_,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n},{}],5:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],6:[function(_dereq_,module,exports){\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n},{}],7:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(5);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"5\":5}],8:[function(_dereq_,module,exports){\n/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n},{}],9:[function(_dereq_,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],10:[function(_dereq_,module,exports){\n(function (factory) {\n if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD\n define(factory);\n } else {\n // Browser globals (with support for web workers)\n var glob;\n\n try {\n glob = window;\n } catch (e) {\n glob = self;\n }\n\n glob.SparkMD5 = factory();\n }\n}(function (undefined) {\n\n 'use strict';\n\n /*\n * Fastest md5 implementation around (JKM md5).\n * Credits: Joseph Myers\n *\n * @see http://www.myersdaily.org/joseph/javascript/md5-text.html\n * @see http://jsperf.com/md5-shootout/7\n */\n\n /* this function is much faster,\n so if possible we use it. Some IEs\n are the only ones I know of that\n need the idiotic second function,\n generated by an if clause. */\n var add32 = function (a, b) {\n return (a + b) & 0xFFFFFFFF;\n },\n hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\n\n\n function cmn(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n return add32((a << s) | (a >>> (32 - s)), b);\n }\n\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n\n function md5blk(s) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n\n function md5blk_array(a) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n }\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n return state;\n }\n\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n\n // Not sure if it is a bug, however IE10 will always produce a sub array of length 1\n // containing the last element of the parent array if the sub array specified starts\n // beyond the length of the parent array - weird.\n // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue\n a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);\n\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << ((i % 4) << 3);\n }\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n\n return state;\n }\n\n function rhex(n) {\n var s = '',\n j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];\n }\n return s;\n }\n\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join('');\n }\n\n // In some cases the fast add32 function cannot be used..\n if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {\n add32 = function (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n };\n }\n\n // ---------------------------------------------------\n\n /**\n * ArrayBuffer slice polyfill.\n *\n * @see https://github.com/ttaubert/node-arraybuffer-slice\n */\n\n if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = (val | 0) || 0;\n\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n\n return Math.min(val, length);\n }\n\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n\n if (to !== undefined) {\n end = clamp(to, length);\n }\n\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n\n return target;\n };\n })();\n }\n\n // ---------------------------------------------------\n\n /**\n * Helpers.\n */\n\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n\n return str;\n }\n\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n\n return returnUInt8Array ? arr : buff;\n }\n\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n\n return returnUInt8Array ? result : result.buffer;\n }\n\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n\n return String.fromCharCode.apply(String, bytes);\n }\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation.\n *\n * Use this class to perform an incremental md5, otherwise use the\n * static methods instead.\n */\n\n function SparkMD5() {\n // call reset to init the instance\n this.reset();\n }\n\n /**\n * Appends a string.\n * A conversion will be applied if an utf8 string is detected.\n *\n * @param {String} str The string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.append = function (str) {\n // Converts the string to utf8 bytes if necessary\n // Then append as binary\n this.appendBinary(toUtf8(str));\n\n return this;\n };\n\n /**\n * Appends a binary string.\n *\n * @param {String} contents The binary string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n\n var length = this._buff.length,\n i;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n\n this._buff = this._buff.substring(i - 64);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.reset = function () {\n this._buff = '';\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash\n };\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n\n return this;\n };\n\n /**\n * Releases memory used by the incremental buffer and other additional\n * resources. If you plan to use the instance again, use reset instead.\n */\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n\n /**\n * Finish the final calculation based on the tail.\n *\n * @param {Array} tail The tail (will be modified)\n * @param {Number} length The length of the remaining buffer\n */\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Do the final computation based on the tail and length\n // Beware that the final length may not fit in 32 bits so we take care of that\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n\n /**\n * Performs the md5 hash on a string.\n * A conversion will be applied if utf8 string is detected.\n *\n * @param {String} str The string\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hash = function (str, raw) {\n // Converts the string to utf8 bytes if necessary\n // Then compute it using the binary function\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n\n /**\n * Performs the md5 hash on a binary string.\n *\n * @param {String} content The binary string\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation for array buffers.\n *\n * Use this class to perform an incremental md5 ONLY for array buffers.\n */\n SparkMD5.ArrayBuffer = function () {\n // call reset to init the instance\n this.reset();\n };\n\n /**\n * Appends an array buffer.\n *\n * @param {ArrayBuffer} arr The array to be appended\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n\n this._length += arr.byteLength;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n\n this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n\n // Convert buffer to a string\n state.buff = arrayBuffer2Utf8Str(state.buff);\n\n return state;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n // Convert string to buffer\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n\n return SparkMD5.prototype.setState.call(this, state);\n };\n\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n\n /**\n * Performs the md5 hash on an array buffer.\n *\n * @param {ArrayBuffer} arr The array buffer\n * @param {Boolean} raw True to get the raw string, false to get the hex one\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n return SparkMD5;\n}));\n\n},{}],11:[function(_dereq_,module,exports){\nvar v1 = _dereq_(14);\nvar v4 = _dereq_(15);\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n\n},{\"14\":14,\"15\":15}],12:[function(_dereq_,module,exports){\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n\n},{}],13:[function(_dereq_,module,exports){\n// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n\n},{}],14:[function(_dereq_,module,exports){\nvar rng = _dereq_(13);\nvar bytesToUuid = _dereq_(12);\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n\n},{\"12\":12,\"13\":13}],15:[function(_dereq_,module,exports){\nvar rng = _dereq_(13);\nvar bytesToUuid = _dereq_(12);\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n\n},{\"12\":12,\"13\":13}],16:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Stringify/parse functions that don't operate\n * recursively, so they avoid call stack exceeded\n * errors.\n */\nexports.stringify = function stringify(input) {\n var queue = [];\n queue.push({obj: input});\n\n var res = '';\n var next, obj, prefix, val, i, arrayPrefix, keys, k, key, value, objPrefix;\n while ((next = queue.pop())) {\n obj = next.obj;\n prefix = next.prefix || '';\n val = next.val || '';\n res += prefix;\n if (val) {\n res += val;\n } else if (typeof obj !== 'object') {\n res += typeof obj === 'undefined' ? null : JSON.stringify(obj);\n } else if (obj === null) {\n res += 'null';\n } else if (Array.isArray(obj)) {\n queue.push({val: ']'});\n for (i = obj.length - 1; i >= 0; i--) {\n arrayPrefix = i === 0 ? '' : ',';\n queue.push({obj: obj[i], prefix: arrayPrefix});\n }\n queue.push({val: '['});\n } else { // object\n keys = [];\n for (k in obj) {\n if (obj.hasOwnProperty(k)) {\n keys.push(k);\n }\n }\n queue.push({val: '}'});\n for (i = keys.length - 1; i >= 0; i--) {\n key = keys[i];\n value = obj[key];\n objPrefix = (i > 0 ? ',' : '');\n objPrefix += JSON.stringify(key) + ':';\n queue.push({obj: value, prefix: objPrefix});\n }\n queue.push({val: '{'});\n }\n }\n return res;\n};\n\n// Convenience function for the parse function.\n// This pop function is basically copied from\n// pouchCollate.parseIndexableString\nfunction pop(obj, stack, metaStack) {\n var lastMetaElement = metaStack[metaStack.length - 1];\n if (obj === lastMetaElement.element) {\n // popping a meta-element, e.g. an object whose value is another object\n metaStack.pop();\n lastMetaElement = metaStack[metaStack.length - 1];\n }\n var element = lastMetaElement.element;\n var lastElementIndex = lastMetaElement.index;\n if (Array.isArray(element)) {\n element.push(obj);\n } else if (lastElementIndex === stack.length - 2) { // obj with key+value\n var key = stack.pop();\n element[key] = obj;\n } else {\n stack.push(obj); // obj with key only\n }\n}\n\nexports.parse = function (str) {\n var stack = [];\n var metaStack = []; // stack for arrays and objects\n var i = 0;\n var collationIndex,parsedNum,numChar;\n var parsedString,lastCh,numConsecutiveSlashes,ch;\n var arrayElement, objElement;\n while (true) {\n collationIndex = str[i++];\n if (collationIndex === '}' ||\n collationIndex === ']' ||\n typeof collationIndex === 'undefined') {\n if (stack.length === 1) {\n return stack.pop();\n } else {\n pop(stack.pop(), stack, metaStack);\n continue;\n }\n }\n switch (collationIndex) {\n case ' ':\n case '\\t':\n case '\\n':\n case ':':\n case ',':\n break;\n case 'n':\n i += 3; // 'ull'\n pop(null, stack, metaStack);\n break;\n case 't':\n i += 3; // 'rue'\n pop(true, stack, metaStack);\n break;\n case 'f':\n i += 4; // 'alse'\n pop(false, stack, metaStack);\n break;\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n case '-':\n parsedNum = '';\n i--;\n while (true) {\n numChar = str[i++];\n if (/[\\d\\.\\-e\\+]/.test(numChar)) {\n parsedNum += numChar;\n } else {\n i--;\n break;\n }\n }\n pop(parseFloat(parsedNum), stack, metaStack);\n break;\n case '\"':\n parsedString = '';\n lastCh = void 0;\n numConsecutiveSlashes = 0;\n while (true) {\n ch = str[i++];\n if (ch !== '\"' || (lastCh === '\\\\' &&\n numConsecutiveSlashes % 2 === 1)) {\n parsedString += ch;\n lastCh = ch;\n if (lastCh === '\\\\') {\n numConsecutiveSlashes++;\n } else {\n numConsecutiveSlashes = 0;\n }\n } else {\n break;\n }\n }\n pop(JSON.parse('\"' + parsedString + '\"'), stack, metaStack);\n break;\n case '[':\n arrayElement = { element: [], index: stack.length };\n stack.push(arrayElement.element);\n metaStack.push(arrayElement);\n break;\n case '{':\n objElement = { element: {}, index: stack.length };\n stack.push(objElement.element);\n metaStack.push(objElement);\n break;\n default:\n throw new Error(\n 'unexpectedly reached end of input: ' + collationIndex);\n }\n }\n};\n\n},{}],17:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar lie = _interopDefault(_dereq_(7));\nvar getArguments = _interopDefault(_dereq_(1));\nvar nextTick = _interopDefault(_dereq_(5));\nvar events = _dereq_(4);\nvar inherits = _interopDefault(_dereq_(6));\nvar uuidV4 = _interopDefault(_dereq_(11));\nvar debug = _interopDefault(_dereq_(2));\nvar Md5 = _interopDefault(_dereq_(10));\nvar vuvuzela = _interopDefault(_dereq_(16));\n\n/* istanbul ignore next */\nvar PouchPromise = typeof Promise === 'function' ? Promise : lie;\n\nfunction isBinaryObject(object) {\n return (typeof ArrayBuffer !== 'undefined' && object instanceof ArrayBuffer) ||\n (typeof Blob !== 'undefined' && object instanceof Blob);\n}\n\nfunction cloneArrayBuffer(buff) {\n if (typeof buff.slice === 'function') {\n return buff.slice(0);\n }\n // IE10-11 slice() polyfill\n var target = new ArrayBuffer(buff.byteLength);\n var targetArray = new Uint8Array(target);\n var sourceArray = new Uint8Array(buff);\n targetArray.set(sourceArray);\n return target;\n}\n\nfunction cloneBinaryObject(object) {\n if (object instanceof ArrayBuffer) {\n return cloneArrayBuffer(object);\n }\n var size = object.size;\n var type = object.type;\n // Blob\n if (typeof object.slice === 'function') {\n return object.slice(0, size, type);\n }\n // PhantomJS slice() replacement\n return object.webkitSlice(0, size, type);\n}\n\n// most of this is borrowed from lodash.isPlainObject:\n// https://github.com/fis-components/lodash.isplainobject/\n// blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js\n\nvar funcToString = Function.prototype.toString;\nvar objectCtorString = funcToString.call(Object);\n\nfunction isPlainObject(value) {\n var proto = Object.getPrototypeOf(value);\n /* istanbul ignore if */\n if (proto === null) { // not sure when this happens, but I guess it can\n return true;\n }\n var Ctor = proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\nfunction clone(object) {\n var newObject;\n var i;\n var len;\n\n if (!object || typeof object !== 'object') {\n return object;\n }\n\n if (Array.isArray(object)) {\n newObject = [];\n for (i = 0, len = object.length; i < len; i++) {\n newObject[i] = clone(object[i]);\n }\n return newObject;\n }\n\n // special case: to avoid inconsistencies between IndexedDB\n // and other backends, we automatically stringify Dates\n if (object instanceof Date) {\n return object.toISOString();\n }\n\n if (isBinaryObject(object)) {\n return cloneBinaryObject(object);\n }\n\n if (!isPlainObject(object)) {\n return object; // don't clone objects like Workers\n }\n\n newObject = {};\n for (i in object) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(object, i)) {\n var value = clone(object[i]);\n if (typeof value !== 'undefined') {\n newObject[i] = value;\n }\n }\n }\n return newObject;\n}\n\nfunction once(fun) {\n var called = false;\n return getArguments(function (args) {\n /* istanbul ignore if */\n if (called) {\n // this is a smoke test and should never actually happen\n throw new Error('once called more than once');\n } else {\n called = true;\n fun.apply(this, args);\n }\n });\n}\n\nfunction toPromise(func) {\n //create the function we will be returning\n return getArguments(function (args) {\n // Clone arguments\n args = clone(args);\n var self = this;\n // if the last argument is a function, assume its a callback\n var usedCB = (typeof args[args.length - 1] === 'function') ? args.pop() : false;\n var promise = new PouchPromise(function (fulfill, reject) {\n var resp;\n try {\n var callback = once(function (err, mesg) {\n if (err) {\n reject(err);\n } else {\n fulfill(mesg);\n }\n });\n // create a callback for this invocation\n // apply the function in the orig context\n args.push(callback);\n resp = func.apply(self, args);\n if (resp && typeof resp.then === 'function') {\n fulfill(resp);\n }\n } catch (e) {\n reject(e);\n }\n });\n // if there is a callback, call it back\n if (usedCB) {\n promise.then(function (result) {\n usedCB(null, result);\n }, usedCB);\n }\n return promise;\n });\n}\n\nfunction logApiCall(self, name, args) {\n /* istanbul ignore if */\n if (self.constructor.listeners('debug').length) {\n var logArgs = ['api', self.name, name];\n for (var i = 0; i < args.length - 1; i++) {\n logArgs.push(args[i]);\n }\n self.constructor.emit('debug', logArgs);\n\n // override the callback itself to log the response\n var origCallback = args[args.length - 1];\n args[args.length - 1] = function (err, res) {\n var responseArgs = ['api', self.name, name];\n responseArgs = responseArgs.concat(\n err ? ['error', err] : ['success', res]\n );\n self.constructor.emit('debug', responseArgs);\n origCallback(err, res);\n };\n }\n}\n\nfunction adapterFun(name, callback) {\n return toPromise(getArguments(function (args) {\n if (this._closed) {\n return PouchPromise.reject(new Error('database is closed'));\n }\n if (this._destroyed) {\n return PouchPromise.reject(new Error('database is destroyed'));\n }\n var self = this;\n logApiCall(self, name, args);\n if (!this.taskqueue.isReady) {\n return new PouchPromise(function (fulfill, reject) {\n self.taskqueue.addTask(function (failed) {\n if (failed) {\n reject(failed);\n } else {\n fulfill(self[name].apply(self, args));\n }\n });\n });\n }\n return callback.apply(this, args);\n }));\n}\n\nfunction mangle(key) {\n return '$' + key;\n}\nfunction unmangle(key) {\n return key.substring(1);\n}\nfunction Map$1() {\n this._store = {};\n}\nMap$1.prototype.get = function (key) {\n var mangled = mangle(key);\n return this._store[mangled];\n};\nMap$1.prototype.set = function (key, value) {\n var mangled = mangle(key);\n this._store[mangled] = value;\n return true;\n};\nMap$1.prototype.has = function (key) {\n var mangled = mangle(key);\n return mangled in this._store;\n};\nMap$1.prototype[\"delete\"] = function (key) {\n var mangled = mangle(key);\n var res = mangled in this._store;\n delete this._store[mangled];\n return res;\n};\nMap$1.prototype.forEach = function (cb) {\n var keys = Object.keys(this._store);\n for (var i = 0, len = keys.length; i < len; i++) {\n var key = keys[i];\n var value = this._store[key];\n key = unmangle(key);\n cb(value, key);\n }\n};\nObject.defineProperty(Map$1.prototype, 'size', {\n get: function () {\n return Object.keys(this._store).length;\n }\n});\n\nfunction Set$1(array) {\n this._store = new Map$1();\n\n // init with an array\n if (array && Array.isArray(array)) {\n for (var i = 0, len = array.length; i < len; i++) {\n this.add(array[i]);\n }\n }\n}\nSet$1.prototype.add = function (key) {\n return this._store.set(key, true);\n};\nSet$1.prototype.has = function (key) {\n return this._store.has(key);\n};\nSet$1.prototype.forEach = function (cb) {\n this._store.forEach(function (value, key) {\n cb(key);\n });\n};\nObject.defineProperty(Set$1.prototype, 'size', {\n get: function () {\n return this._store.size;\n }\n});\n\n/* global Map,Set,Symbol */\n// Based on https://kangax.github.io/compat-table/es6/ we can sniff out\n// incomplete Map/Set implementations which would otherwise cause our tests to fail.\n// Notably they fail in IE11 and iOS 8.4, which this prevents.\nfunction supportsMapAndSet() {\n if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') {\n return false;\n }\n var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species);\n return prop && 'get' in prop && Map[Symbol.species] === Map;\n}\n\n// based on https://github.com/montagejs/collections\n/* global Map,Set */\n\nvar ExportedSet;\nvar ExportedMap;\n\n{\n if (supportsMapAndSet()) { // prefer built-in Map/Set\n ExportedSet = Set;\n ExportedMap = Map;\n } else { // fall back to our polyfill\n ExportedSet = Set$1;\n ExportedMap = Map$1;\n }\n}\n\n// like underscore/lodash _.pick()\nfunction pick(obj, arr) {\n var res = {};\n for (var i = 0, len = arr.length; i < len; i++) {\n var prop = arr[i];\n if (prop in obj) {\n res[prop] = obj[prop];\n }\n }\n return res;\n}\n\n// Most browsers throttle concurrent requests at 6, so it's silly\n// to shim _bulk_get by trying to launch potentially hundreds of requests\n// and then letting the majority time out. We can handle this ourselves.\nvar MAX_NUM_CONCURRENT_REQUESTS = 6;\n\nfunction identityFunction(x) {\n return x;\n}\n\nfunction formatResultForOpenRevsGet(result) {\n return [{\n ok: result\n }];\n}\n\n// shim for P/CouchDB adapters that don't directly implement _bulk_get\nfunction bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}\n\nfunction isChromeApp() {\n return (typeof chrome !== \"undefined\" &&\n typeof chrome.storage !== \"undefined\" &&\n typeof chrome.storage.local !== \"undefined\");\n}\n\nvar hasLocal;\n\nif (isChromeApp()) {\n hasLocal = false;\n} else {\n try {\n localStorage.setItem('_pouch_check_localstorage', 1);\n hasLocal = !!localStorage.getItem('_pouch_check_localstorage');\n } catch (e) {\n hasLocal = false;\n }\n}\n\nfunction hasLocalStorage() {\n return hasLocal;\n}\n\n// Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We\n// avoid using process.nextTick() directly because the polyfill is very large and we don't\n// need all of it (see: https://github.com/defunctzombie/node-process).\n// \"immediate\" 3.0.8 is used by lie, and it's a smaller version of the latest \"immediate\"\n// package, so it's the one we use.\n// When we use nextTick() in our codebase, we only care about not releasing Zalgo\n// (see: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony).\n// Microtask vs macrotask doesn't matter to us. So we're free to use the fastest\n// (least latency) option, which is \"immediate\" due to use of microtasks.\n// All of our nextTicks are isolated to this one function so we can easily swap out one\n// implementation for another.\n\ninherits(Changes, events.EventEmitter);\n\n/* istanbul ignore next */\nfunction attachBrowserEvents(self) {\n if (isChromeApp()) {\n chrome.storage.onChanged.addListener(function (e) {\n // make sure it's event addressed to us\n if (e.db_name != null) {\n //object only has oldValue, newValue members\n self.emit(e.dbName.newValue);\n }\n });\n } else if (hasLocalStorage()) {\n if (typeof addEventListener !== 'undefined') {\n addEventListener(\"storage\", function (e) {\n self.emit(e.key);\n });\n } else { // old IE\n window.attachEvent(\"storage\", function (e) {\n self.emit(e.key);\n });\n }\n }\n}\n\nfunction Changes() {\n events.EventEmitter.call(this);\n this._listeners = {};\n\n attachBrowserEvents(this);\n}\nChanges.prototype.addListener = function (dbName, id, db, opts) {\n /* istanbul ignore if */\n if (this._listeners[id]) {\n return;\n }\n var self = this;\n var inprogress = false;\n function eventFunction() {\n /* istanbul ignore if */\n if (!self._listeners[id]) {\n return;\n }\n if (inprogress) {\n inprogress = 'waiting';\n return;\n }\n inprogress = true;\n var changesOpts = pick(opts, [\n 'style', 'include_docs', 'attachments', 'conflicts', 'filter',\n 'doc_ids', 'view', 'since', 'query_params', 'binary'\n ]);\n\n /* istanbul ignore next */\n function onError() {\n inprogress = false;\n }\n\n db.changes(changesOpts).on('change', function (c) {\n if (c.seq > opts.since && !opts.cancelled) {\n opts.since = c.seq;\n opts.onChange(c);\n }\n }).on('complete', function () {\n if (inprogress === 'waiting') {\n nextTick(eventFunction);\n }\n inprogress = false;\n }).on('error', onError);\n }\n this._listeners[id] = eventFunction;\n this.on(dbName, eventFunction);\n};\n\nChanges.prototype.removeListener = function (dbName, id) {\n /* istanbul ignore if */\n if (!(id in this._listeners)) {\n return;\n }\n events.EventEmitter.prototype.removeListener.call(this, dbName,\n this._listeners[id]);\n delete this._listeners[id];\n};\n\n\n/* istanbul ignore next */\nChanges.prototype.notifyLocalWindows = function (dbName) {\n //do a useless change on a storage thing\n //in order to get other windows's listeners to activate\n if (isChromeApp()) {\n chrome.storage.local.set({dbName: dbName});\n } else if (hasLocalStorage()) {\n localStorage[dbName] = (localStorage[dbName] === \"a\") ? \"b\" : \"a\";\n }\n};\n\nChanges.prototype.notify = function (dbName) {\n this.emit(dbName);\n this.notifyLocalWindows(dbName);\n};\n\nfunction guardedConsole(method) {\n /* istanbul ignore else */\n if (typeof console !== 'undefined' && typeof console[method] === 'function') {\n var args = Array.prototype.slice.call(arguments, 1);\n console[method].apply(console, args);\n }\n}\n\nfunction randomNumber(min, max) {\n var maxTimeout = 600000; // Hard-coded default of 10 minutes\n min = parseInt(min, 10) || 0;\n max = parseInt(max, 10);\n if (max !== max || max <= min) {\n max = (min || 1) << 1; //doubling\n } else {\n max = max + 1;\n }\n // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout\n if (max > maxTimeout) {\n min = maxTimeout >> 1; // divide by two\n max = maxTimeout;\n }\n var ratio = Math.random();\n var range = max - min;\n\n return ~~(range * ratio + min); // ~~ coerces to an int, but fast.\n}\n\nfunction defaultBackOff(min) {\n var max = 0;\n if (!min) {\n max = 2000;\n }\n return randomNumber(min, max);\n}\n\n// designed to give info to browser users, who are disturbed\n// when they see http errors in the console\nfunction explainError(status, str) {\n guardedConsole('info', 'The above ' + status + ' is totally normal. ' + str);\n}\n\nvar assign;\n{\n if (typeof Object.assign === 'function') {\n assign = Object.assign;\n } else {\n // lite Object.assign polyfill based on\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n assign = function (target) {\n var to = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var nextSource = arguments[index];\n\n if (nextSource != null) { // Skip over if undefined or null\n for (var nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n };\n }\n}\n\nvar $inject_Object_assign = assign;\n\ninherits(PouchError, Error);\n\nfunction PouchError(status, error, reason) {\n Error.call(this, reason);\n this.status = status;\n this.name = error;\n this.message = reason;\n this.error = true;\n}\n\nPouchError.prototype.toString = function () {\n return JSON.stringify({\n status: this.status,\n name: this.name,\n message: this.message,\n reason: this.reason\n });\n};\n\nvar UNAUTHORIZED = new PouchError(401, 'unauthorized', \"Name or password is incorrect.\");\nvar MISSING_BULK_DOCS = new PouchError(400, 'bad_request', \"Missing JSON list of 'docs'\");\nvar MISSING_DOC = new PouchError(404, 'not_found', 'missing');\nvar REV_CONFLICT = new PouchError(409, 'conflict', 'Document update conflict');\nvar INVALID_ID = new PouchError(400, 'bad_request', '_id field must contain a string');\nvar MISSING_ID = new PouchError(412, 'missing_id', '_id is required for puts');\nvar RESERVED_ID = new PouchError(400, 'bad_request', 'Only reserved document ids may start with underscore.');\nvar NOT_OPEN = new PouchError(412, 'precondition_failed', 'Database not open');\nvar UNKNOWN_ERROR = new PouchError(500, 'unknown_error', 'Database encountered an unknown error');\nvar BAD_ARG = new PouchError(500, 'badarg', 'Some query argument is invalid');\nvar INVALID_REQUEST = new PouchError(400, 'invalid_request', 'Request was invalid');\nvar QUERY_PARSE_ERROR = new PouchError(400, 'query_parse_error', 'Some query parameter is invalid');\nvar DOC_VALIDATION = new PouchError(500, 'doc_validation', 'Bad special document member');\nvar BAD_REQUEST = new PouchError(400, 'bad_request', 'Something wrong with the request');\nvar NOT_AN_OBJECT = new PouchError(400, 'bad_request', 'Document must be a JSON object');\nvar DB_MISSING = new PouchError(404, 'not_found', 'Database not found');\nvar IDB_ERROR = new PouchError(500, 'indexed_db_went_bad', 'unknown');\nvar WSQ_ERROR = new PouchError(500, 'web_sql_went_bad', 'unknown');\nvar LDB_ERROR = new PouchError(500, 'levelDB_went_went_bad', 'unknown');\nvar FORBIDDEN = new PouchError(403, 'forbidden', 'Forbidden by design doc validate_doc_update function');\nvar INVALID_REV = new PouchError(400, 'bad_request', 'Invalid rev format');\nvar FILE_EXISTS = new PouchError(412, 'file_exists', 'The database could not be created, the file already exists.');\nvar MISSING_STUB = new PouchError(412, 'missing_stub', 'A pre-existing attachment stub wasn\\'t found');\nvar INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid');\n\nfunction createError(error, reason) {\n function CustomPouchError(reason) {\n // inherit error properties from our parent error manually\n // so as to allow proper JSON parsing.\n /* jshint ignore:start */\n for (var p in error) {\n if (typeof error[p] !== 'function') {\n this[p] = error[p];\n }\n }\n /* jshint ignore:end */\n if (reason !== undefined) {\n this.reason = reason;\n }\n }\n CustomPouchError.prototype = PouchError.prototype;\n return new CustomPouchError(reason);\n}\n\nfunction generateErrorFromResponse(err) {\n\n if (typeof err !== 'object') {\n var data = err;\n err = UNKNOWN_ERROR;\n err.data = data;\n }\n\n if ('error' in err && err.error === 'conflict') {\n err.name = 'conflict';\n err.status = 409;\n }\n\n if (!('name' in err)) {\n err.name = err.error || 'unknown';\n }\n\n if (!('status' in err)) {\n err.status = 500;\n }\n\n if (!('message' in err)) {\n err.message = err.message || err.reason;\n }\n\n return err;\n}\n\nfunction tryFilter(filter, doc, req) {\n try {\n return !filter(doc, req);\n } catch (err) {\n var msg = 'Filter function threw: ' + err.toString();\n return createError(BAD_REQUEST, msg);\n }\n}\n\nfunction filterChange(opts) {\n var req = {};\n var hasFilter = opts.filter && typeof opts.filter === 'function';\n req.query = opts.query_params;\n\n return function filter(change) {\n if (!change.doc) {\n // CSG sends events on the changes feed that don't have documents,\n // this hack makes a whole lot of existing code robust.\n change.doc = {};\n }\n\n var filterReturn = hasFilter && tryFilter(opts.filter, change.doc, req);\n\n if (typeof filterReturn === 'object') {\n return filterReturn;\n }\n\n if (filterReturn) {\n return false;\n }\n\n if (!opts.include_docs) {\n delete change.doc;\n } else if (!opts.attachments) {\n for (var att in change.doc._attachments) {\n /* istanbul ignore else */\n if (change.doc._attachments.hasOwnProperty(att)) {\n change.doc._attachments[att].stub = true;\n }\n }\n }\n return true;\n };\n}\n\nfunction flatten(arrs) {\n var res = [];\n for (var i = 0, len = arrs.length; i < len; i++) {\n res = res.concat(arrs[i]);\n }\n return res;\n}\n\n// shim for Function.prototype.name,\n// for browsers that don't support it like IE\n\n/* istanbul ignore next */\n\n// Determine id an ID is valid\n// - invalid IDs begin with an underescore that does not begin '_design' or\n// '_local'\n// - any other string value is a valid id\n// Returns the specific error object for each case\nfunction invalidIdError(id) {\n var err;\n if (!id) {\n err = createError(MISSING_ID);\n } else if (typeof id !== 'string') {\n err = createError(INVALID_ID);\n } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) {\n err = createError(RESERVED_ID);\n }\n if (err) {\n throw err;\n }\n}\n\n// Checks if a PouchDB object is \"remote\" or not. This is\n// designed to opt-in to certain optimizations, such as\n// avoiding checks for \"dependentDbs\" and other things that\n// we know only apply to local databases. In general, \"remote\"\n// should be true for the http adapter, and for third-party\n// adapters with similar expensive boundaries to cross for\n// every API call, such as socket-pouch and worker-pouch.\n// Previously, this was handled via db.type() === 'http'\n// which is now deprecated.\n\nfunction isRemote(db) {\n if (typeof db._remote === 'boolean') {\n return db._remote;\n }\n /* istanbul ignore next */\n if (typeof db.type === 'function') {\n guardedConsole('warn',\n 'db.type() is deprecated and will be removed in ' +\n 'a future version of PouchDB');\n return db.type() === 'http';\n }\n /* istanbul ignore next */\n return false;\n}\n\nfunction listenerCount(ee, type) {\n return 'listenerCount' in ee ? ee.listenerCount(type) :\n events.EventEmitter.listenerCount(ee, type);\n}\n\nfunction parseDesignDocFunctionName(s) {\n if (!s) {\n return null;\n }\n var parts = s.split('/');\n if (parts.length === 2) {\n return parts;\n }\n if (parts.length === 1) {\n return [s, s];\n }\n return null;\n}\n\nfunction normalizeDesignDocFunctionName(s) {\n var normalized = parseDesignDocFunctionName(s);\n return normalized ? normalized.join('/') : null;\n}\n\n// originally parseUri 1.2.2, now patched by us\n// (c) Steven Levithan <stevenlevithan.com>\n// MIT License\nvar keys = [\"source\", \"protocol\", \"authority\", \"userInfo\", \"user\", \"password\",\n \"host\", \"port\", \"relative\", \"path\", \"directory\", \"file\", \"query\", \"anchor\"];\nvar qName =\"queryKey\";\nvar qParser = /(?:^|&)([^&=]*)=?([^&]*)/g;\n\n// use the \"loose\" parser\n/* eslint maxlen: 0, no-useless-escape: 0 */\nvar parser = /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\n\nfunction parseUri(str) {\n var m = parser.exec(str);\n var uri = {};\n var i = 14;\n\n while (i--) {\n var key = keys[i];\n var value = m[i] || \"\";\n var encoded = ['user', 'password'].indexOf(key) !== -1;\n uri[key] = encoded ? decodeURIComponent(value) : value;\n }\n\n uri[qName] = {};\n uri[keys[12]].replace(qParser, function ($0, $1, $2) {\n if ($1) {\n uri[qName][$1] = $2;\n }\n });\n\n return uri;\n}\n\n// Based on https://github.com/alexdavid/scope-eval v0.0.3\n// (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js)\n// This is basically just a wrapper around new Function()\n\nfunction scopeEval(source, scope) {\n var keys = [];\n var values = [];\n for (var key in scope) {\n if (scope.hasOwnProperty(key)) {\n keys.push(key);\n values.push(scope[key]);\n }\n }\n keys.push(source);\n return Function.apply(null, keys).apply(null, values);\n}\n\n// this is essentially the \"update sugar\" function from daleharvey/pouchdb#1388\n// the diffFun tells us what delta to apply to the doc. it either returns\n// the doc, or false if it doesn't need to do an update after all\nfunction upsert(db, docId, diffFun) {\n return new PouchPromise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}\n\nfunction tryAndPut(db, doc, diffFun) {\n return db.put(doc).then(function (res) {\n return {\n updated: true,\n rev: res.rev\n };\n }, function (err) {\n /* istanbul ignore next */\n if (err.status !== 409) {\n throw err;\n }\n return upsert(db, doc._id, diffFun);\n });\n}\n\nfunction rev() {\n return uuidV4.v4().replace(/-/g, '').toLowerCase();\n}\n\nvar uuid = uuidV4.v4;\n\n// We fetch all leafs of the revision tree, and sort them based on tree length\n// and whether they were deleted, undeleted documents with the longest revision\n// tree (most edits) win\n// The final sort algorithm is slightly documented in a sidebar here:\n// http://guide.couchdb.org/draft/conflicts.html\nfunction winningRev(metadata) {\n var winningId;\n var winningPos;\n var winningDeleted;\n var toVisit = metadata.rev_tree.slice();\n var node;\n while ((node = toVisit.pop())) {\n var tree = node.ids;\n var branches = tree[2];\n var pos = node.pos;\n if (branches.length) { // non-leaf\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: pos + 1, ids: branches[i]});\n }\n continue;\n }\n var deleted = !!tree[1].deleted;\n var id = tree[0];\n // sort by deleted, then pos, then id\n if (!winningId || (winningDeleted !== deleted ? winningDeleted :\n winningPos !== pos ? winningPos < pos : winningId < id)) {\n winningId = id;\n winningPos = pos;\n winningDeleted = deleted;\n }\n }\n\n return winningPos + '-' + winningId;\n}\n\n// Pretty much all below can be combined into a higher order function to\n// traverse revisions\n// The return value from the callback will be passed as context to all\n// children of that node\nfunction traverseRevTree(revs, callback) {\n var toVisit = revs.slice();\n\n var node;\n while ((node = toVisit.pop())) {\n var pos = node.pos;\n var tree = node.ids;\n var branches = tree[2];\n var newCtx =\n callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]);\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx});\n }\n }\n}\n\nfunction sortByPos(a, b) {\n return a.pos - b.pos;\n}\n\nfunction collectLeaves(revs) {\n var leaves = [];\n traverseRevTree(revs, function (isLeaf, pos, id, acc, opts) {\n if (isLeaf) {\n leaves.push({rev: pos + \"-\" + id, pos: pos, opts: opts});\n }\n });\n leaves.sort(sortByPos).reverse();\n for (var i = 0, len = leaves.length; i < len; i++) {\n delete leaves[i].pos;\n }\n return leaves;\n}\n\n// returns revs of all conflicts that is leaves such that\n// 1. are not deleted and\n// 2. are different than winning revision\nfunction collectConflicts(metadata) {\n var win = winningRev(metadata);\n var leaves = collectLeaves(metadata.rev_tree);\n var conflicts = [];\n for (var i = 0, len = leaves.length; i < len; i++) {\n var leaf = leaves[i];\n if (leaf.rev !== win && !leaf.opts.deleted) {\n conflicts.push(leaf.rev);\n }\n }\n return conflicts;\n}\n\n// compact a tree by marking its non-leafs as missing,\n// and return a list of revs to delete\nfunction compactTree(metadata) {\n var revs = [];\n traverseRevTree(metadata.rev_tree, function (isLeaf, pos,\n revHash, ctx, opts) {\n if (opts.status === 'available' && !isLeaf) {\n revs.push(pos + '-' + revHash);\n opts.status = 'missing';\n }\n });\n return revs;\n}\n\n// build up a list of all the paths to the leafs in this revision tree\nfunction rootToLeaf(revs) {\n var paths = [];\n var toVisit = revs.slice();\n var node;\n while ((node = toVisit.pop())) {\n var pos = node.pos;\n var tree = node.ids;\n var id = tree[0];\n var opts = tree[1];\n var branches = tree[2];\n var isLeaf = branches.length === 0;\n\n var history = node.history ? node.history.slice() : [];\n history.push({id: id, opts: opts});\n if (isLeaf) {\n paths.push({pos: (pos + 1 - history.length), ids: history});\n }\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: pos + 1, ids: branches[i], history: history});\n }\n }\n return paths.reverse();\n}\n\n// for a better overview of what this is doing, read:\n// https://github.com/apache/couchdb-couch/blob/master/src/couch_key_tree.erl\n//\n// But for a quick intro, CouchDB uses a revision tree to store a documents\n// history, A -> B -> C, when a document has conflicts, that is a branch in the\n// tree, A -> (B1 | B2 -> C), We store these as a nested array in the format\n//\n// KeyTree = [Path ... ]\n// Path = {pos: position_from_root, ids: Tree}\n// Tree = [Key, Opts, [Tree, ...]], in particular single node: [Key, []]\n\nfunction sortByPos$1(a, b) {\n return a.pos - b.pos;\n}\n\n// classic binary search\nfunction binarySearch(arr, item, comparator) {\n var low = 0;\n var high = arr.length;\n var mid;\n while (low < high) {\n mid = (low + high) >>> 1;\n if (comparator(arr[mid], item) < 0) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return low;\n}\n\n// assuming the arr is sorted, insert the item in the proper place\nfunction insertSorted(arr, item, comparator) {\n var idx = binarySearch(arr, item, comparator);\n arr.splice(idx, 0, item);\n}\n\n// Turn a path as a flat array into a tree with a single branch.\n// If any should be stemmed from the beginning of the array, that's passed\n// in as the second argument\nfunction pathToTree(path, numStemmed) {\n var root;\n var leaf;\n for (var i = numStemmed, len = path.length; i < len; i++) {\n var node = path[i];\n var currentLeaf = [node.id, node.opts, []];\n if (leaf) {\n leaf[2].push(currentLeaf);\n leaf = currentLeaf;\n } else {\n root = leaf = currentLeaf;\n }\n }\n return root;\n}\n\n// compare the IDs of two trees\nfunction compareTree(a, b) {\n return a[0] < b[0] ? -1 : 1;\n}\n\n// Merge two trees together\n// The roots of tree1 and tree2 must be the same revision\nfunction mergeTree(in_tree1, in_tree2) {\n var queue = [{tree1: in_tree1, tree2: in_tree2}];\n var conflicts = false;\n while (queue.length > 0) {\n var item = queue.pop();\n var tree1 = item.tree1;\n var tree2 = item.tree2;\n\n if (tree1[1].status || tree2[1].status) {\n tree1[1].status =\n (tree1[1].status === 'available' ||\n tree2[1].status === 'available') ? 'available' : 'missing';\n }\n\n for (var i = 0; i < tree2[2].length; i++) {\n if (!tree1[2][0]) {\n conflicts = 'new_leaf';\n tree1[2][0] = tree2[2][i];\n continue;\n }\n\n var merged = false;\n for (var j = 0; j < tree1[2].length; j++) {\n if (tree1[2][j][0] === tree2[2][i][0]) {\n queue.push({tree1: tree1[2][j], tree2: tree2[2][i]});\n merged = true;\n }\n }\n if (!merged) {\n conflicts = 'new_branch';\n insertSorted(tree1[2], tree2[2][i], compareTree);\n }\n }\n }\n return {conflicts: conflicts, tree: in_tree1};\n}\n\nfunction doMerge(tree, path, dontExpand) {\n var restree = [];\n var conflicts = false;\n var merged = false;\n var res;\n\n if (!tree.length) {\n return {tree: [path], conflicts: 'new_leaf'};\n }\n\n for (var i = 0, len = tree.length; i < len; i++) {\n var branch = tree[i];\n if (branch.pos === path.pos && branch.ids[0] === path.ids[0]) {\n // Paths start at the same position and have the same root, so they need\n // merged\n res = mergeTree(branch.ids, path.ids);\n restree.push({pos: branch.pos, ids: res.tree});\n conflicts = conflicts || res.conflicts;\n merged = true;\n } else if (dontExpand !== true) {\n // The paths start at a different position, take the earliest path and\n // traverse up until it as at the same point from root as the path we\n // want to merge. If the keys match we return the longer path with the\n // other merged After stemming we dont want to expand the trees\n\n var t1 = branch.pos < path.pos ? branch : path;\n var t2 = branch.pos < path.pos ? path : branch;\n var diff = t2.pos - t1.pos;\n\n var candidateParents = [];\n\n var trees = [];\n trees.push({ids: t1.ids, diff: diff, parent: null, parentIdx: null});\n while (trees.length > 0) {\n var item = trees.pop();\n if (item.diff === 0) {\n if (item.ids[0] === t2.ids[0]) {\n candidateParents.push(item);\n }\n continue;\n }\n var elements = item.ids[2];\n for (var j = 0, elementsLen = elements.length; j < elementsLen; j++) {\n trees.push({\n ids: elements[j],\n diff: item.diff - 1,\n parent: item.ids,\n parentIdx: j\n });\n }\n }\n\n var el = candidateParents[0];\n\n if (!el) {\n restree.push(branch);\n } else {\n res = mergeTree(el.ids, t2.ids);\n el.parent[2][el.parentIdx] = res.tree;\n restree.push({pos: t1.pos, ids: t1.ids});\n conflicts = conflicts || res.conflicts;\n merged = true;\n }\n } else {\n restree.push(branch);\n }\n }\n\n // We didnt find\n if (!merged) {\n restree.push(path);\n }\n\n restree.sort(sortByPos$1);\n\n return {\n tree: restree,\n conflicts: conflicts || 'internal_node'\n };\n}\n\n// To ensure we dont grow the revision tree infinitely, we stem old revisions\nfunction stem(tree, depth) {\n // First we break out the tree into a complete list of root to leaf paths\n var paths = rootToLeaf(tree);\n var stemmedRevs;\n\n var result;\n for (var i = 0, len = paths.length; i < len; i++) {\n // Then for each path, we cut off the start of the path based on the\n // `depth` to stem to, and generate a new set of flat trees\n var path = paths[i];\n var stemmed = path.ids;\n var node;\n if (stemmed.length > depth) {\n // only do the stemming work if we actually need to stem\n if (!stemmedRevs) {\n stemmedRevs = {}; // avoid allocating this object unnecessarily\n }\n var numStemmed = stemmed.length - depth;\n node = {\n pos: path.pos + numStemmed,\n ids: pathToTree(stemmed, numStemmed)\n };\n\n for (var s = 0; s < numStemmed; s++) {\n var rev = (path.pos + s) + '-' + stemmed[s].id;\n stemmedRevs[rev] = true;\n }\n } else { // no need to actually stem\n node = {\n pos: path.pos,\n ids: pathToTree(stemmed, 0)\n };\n }\n\n // Then we remerge all those flat trees together, ensuring that we dont\n // connect trees that would go beyond the depth limit\n if (result) {\n result = doMerge(result, node, true).tree;\n } else {\n result = [node];\n }\n }\n\n // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed\n if (stemmedRevs) {\n traverseRevTree(result, function (isLeaf, pos, revHash) {\n // some revisions may have been removed in a branch but not in another\n delete stemmedRevs[pos + '-' + revHash];\n });\n }\n\n return {\n tree: result,\n revs: stemmedRevs ? Object.keys(stemmedRevs) : []\n };\n}\n\nfunction merge(tree, path, depth) {\n var newTree = doMerge(tree, path);\n var stemmed = stem(newTree.tree, depth);\n return {\n tree: stemmed.tree,\n stemmedRevs: stemmed.revs,\n conflicts: newTree.conflicts\n };\n}\n\n// return true if a rev exists in the rev tree, false otherwise\nfunction revExists(revs, rev) {\n var toVisit = revs.slice();\n var splitRev = rev.split('-');\n var targetPos = parseInt(splitRev[0], 10);\n var targetId = splitRev[1];\n\n var node;\n while ((node = toVisit.pop())) {\n if (node.pos === targetPos && node.ids[0] === targetId) {\n return true;\n }\n var branches = node.ids[2];\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: node.pos + 1, ids: branches[i]});\n }\n }\n return false;\n}\n\nfunction getTrees(node) {\n return node.ids;\n}\n\n// check if a specific revision of a doc has been deleted\n// - metadata: the metadata object from the doc store\n// - rev: (optional) the revision to check. defaults to winning revision\nfunction isDeleted(metadata, rev) {\n if (!rev) {\n rev = winningRev(metadata);\n }\n var id = rev.substring(rev.indexOf('-') + 1);\n var toVisit = metadata.rev_tree.map(getTrees);\n\n var tree;\n while ((tree = toVisit.pop())) {\n if (tree[0] === id) {\n return !!tree[1].deleted;\n }\n toVisit = toVisit.concat(tree[2]);\n }\n}\n\nfunction isLocalId(id) {\n return (/^_local/).test(id);\n}\n\n// returns the current leaf node for a given revision\nfunction latest(rev, metadata) {\n var toVisit = metadata.rev_tree.slice();\n var node;\n while ((node = toVisit.pop())) {\n var pos = node.pos;\n var tree = node.ids;\n var id = tree[0];\n var opts = tree[1];\n var branches = tree[2];\n var isLeaf = branches.length === 0;\n\n var history = node.history ? node.history.slice() : [];\n history.push({id: id, pos: pos, opts: opts});\n\n if (isLeaf) {\n for (var i = 0, len = history.length; i < len; i++) {\n var historyNode = history[i];\n var historyRev = historyNode.pos + '-' + historyNode.id;\n\n if (historyRev === rev) {\n // return the rev of this leaf\n return pos + '-' + id;\n }\n }\n }\n\n for (var j = 0, l = branches.length; j < l; j++) {\n toVisit.push({pos: pos + 1, ids: branches[j], history: history});\n }\n }\n\n /* istanbul ignore next */\n throw new Error('Unable to resolve latest revision for id ' + metadata.id + ', rev ' + rev);\n}\n\ninherits(Changes$2, events.EventEmitter);\n\nfunction tryCatchInChangeListener(self, change, pending, lastSeq) {\n // isolate try/catches to avoid V8 deoptimizations\n try {\n self.emit('change', change, pending, lastSeq);\n } catch (e) {\n guardedConsole('error', 'Error in .on(\"change\", function):', e);\n }\n}\n\nfunction Changes$2(db, opts, callback) {\n events.EventEmitter.call(this);\n var self = this;\n this.db = db;\n opts = opts ? clone(opts) : {};\n var complete = opts.complete = once(function (err, resp) {\n if (err) {\n if (listenerCount(self, 'error') > 0) {\n self.emit('error', err);\n }\n } else {\n self.emit('complete', resp);\n }\n self.removeAllListeners();\n db.removeListener('destroyed', onDestroy);\n });\n if (callback) {\n self.on('complete', function (resp) {\n callback(null, resp);\n });\n self.on('error', callback);\n }\n function onDestroy() {\n self.cancel();\n }\n db.once('destroyed', onDestroy);\n\n opts.onChange = function (change, pending, lastSeq) {\n /* istanbul ignore if */\n if (self.isCancelled) {\n return;\n }\n tryCatchInChangeListener(self, change, pending, lastSeq);\n };\n\n var promise = new PouchPromise(function (fulfill, reject) {\n opts.complete = function (err, res) {\n if (err) {\n reject(err);\n } else {\n fulfill(res);\n }\n };\n });\n self.once('cancel', function () {\n db.removeListener('destroyed', onDestroy);\n opts.complete(null, {status: 'cancelled'});\n });\n this.then = promise.then.bind(promise);\n this['catch'] = promise['catch'].bind(promise);\n this.then(function (result) {\n complete(null, result);\n }, complete);\n\n\n\n if (!db.taskqueue.isReady) {\n db.taskqueue.addTask(function (failed) {\n if (failed) {\n opts.complete(failed);\n } else if (self.isCancelled) {\n self.emit('cancel');\n } else {\n self.validateChanges(opts);\n }\n });\n } else {\n self.validateChanges(opts);\n }\n}\nChanges$2.prototype.cancel = function () {\n this.isCancelled = true;\n if (this.db.taskqueue.isReady) {\n this.emit('cancel');\n }\n};\nfunction processChange(doc, metadata, opts) {\n var changeList = [{rev: doc._rev}];\n if (opts.style === 'all_docs') {\n changeList = collectLeaves(metadata.rev_tree)\n .map(function (x) { return {rev: x.rev}; });\n }\n var change = {\n id: metadata.id,\n changes: changeList,\n doc: doc\n };\n\n if (isDeleted(metadata, doc._rev)) {\n change.deleted = true;\n }\n if (opts.conflicts) {\n change.doc._conflicts = collectConflicts(metadata);\n if (!change.doc._conflicts.length) {\n delete change.doc._conflicts;\n }\n }\n return change;\n}\n\nChanges$2.prototype.validateChanges = function (opts) {\n var callback = opts.complete;\n var self = this;\n\n /* istanbul ignore else */\n if (PouchDB._changesFilterPlugin) {\n PouchDB._changesFilterPlugin.validate(opts, function (err) {\n if (err) {\n return callback(err);\n }\n self.doChanges(opts);\n });\n } else {\n self.doChanges(opts);\n }\n};\n\nChanges$2.prototype.doChanges = function (opts) {\n var self = this;\n var callback = opts.complete;\n\n opts = clone(opts);\n if ('live' in opts && !('continuous' in opts)) {\n opts.continuous = opts.live;\n }\n opts.processChange = processChange;\n\n if (opts.since === 'latest') {\n opts.since = 'now';\n }\n if (!opts.since) {\n opts.since = 0;\n }\n if (opts.since === 'now') {\n this.db.info().then(function (info) {\n /* istanbul ignore if */\n if (self.isCancelled) {\n callback(null, {status: 'cancelled'});\n return;\n }\n opts.since = info.update_seq;\n self.doChanges(opts);\n }, callback);\n return;\n }\n\n /* istanbul ignore else */\n if (PouchDB._changesFilterPlugin) {\n PouchDB._changesFilterPlugin.normalize(opts);\n if (PouchDB._changesFilterPlugin.shouldFilter(this, opts)) {\n return PouchDB._changesFilterPlugin.filter(this, opts);\n }\n } else {\n ['doc_ids', 'filter', 'selector', 'view'].forEach(function (key) {\n if (key in opts) {\n guardedConsole('warn',\n 'The \"' + key + '\" option was passed in to changes/replicate, ' +\n 'but pouchdb-changes-filter plugin is not installed, so it ' +\n 'was ignored. Please install the plugin to enable filtering.'\n );\n }\n });\n }\n\n if (!('descending' in opts)) {\n opts.descending = false;\n }\n\n // 0 and 1 should return 1 document\n opts.limit = opts.limit === 0 ? 1 : opts.limit;\n opts.complete = callback;\n var newPromise = this.db._changes(opts);\n /* istanbul ignore else */\n if (newPromise && typeof newPromise.cancel === 'function') {\n var cancel = self.cancel;\n self.cancel = getArguments(function (args) {\n newPromise.cancel();\n cancel.apply(this, args);\n });\n }\n};\n\n/*\n * A generic pouch adapter\n */\n\nfunction compare(left, right) {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\n// Wrapper for functions that call the bulkdocs api with a single doc,\n// if the first result is an error, return an error\nfunction yankError(callback, docId) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n err = err || results[0];\n err.docId = docId;\n callback(err);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}\n\n// clean docs given to us by the user\nfunction cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}\n\n// compare two docs, first by _id then by _rev\nfunction compareByIdThenRev(a, b) {\n var idCompare = compare(a._id, b._id);\n if (idCompare !== 0) {\n return idCompare;\n }\n var aStart = a._revisions ? a._revisions.start : 0;\n var bStart = b._revisions ? b._revisions.start : 0;\n return compare(aStart, bStart);\n}\n\n// for every node in a revision tree computes its distance from the closest\n// leaf\nfunction computeHeight(revs) {\n var height = {};\n var edges = [];\n traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev$$1 = pos + \"-\" + id;\n if (isLeaf) {\n height[rev$$1] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev$$1});\n }\n return rev$$1;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}\n\nfunction allDocsKeysParse(opts) {\n var keys = ('limit' in opts) ?\n opts.keys.slice(opts.skip, opts.limit + opts.skip) :\n (opts.skip > 0) ? opts.keys.slice(opts.skip) : opts.keys;\n opts.keys = keys;\n opts.skip = 0;\n delete opts.limit;\n if (opts.descending) {\n keys.reverse();\n opts.descending = false;\n }\n}\n\n// all compaction is done in a queue, to avoid attaching\n// too many listeners at once\nfunction doNextCompaction(self) {\n var task = self._compactionQueue[0];\n var opts = task.opts;\n var callback = task.callback;\n self.get('_local/compaction')[\"catch\"](function () {\n return false;\n }).then(function (doc) {\n if (doc && doc.last_seq) {\n opts.last_seq = doc.last_seq;\n }\n self._compact(opts, function (err, res) {\n /* istanbul ignore if */\n if (err) {\n callback(err);\n } else {\n callback(null, res);\n }\n nextTick(function () {\n self._compactionQueue.shift();\n if (self._compactionQueue.length) {\n doNextCompaction(self);\n }\n });\n });\n });\n}\n\nfunction attachmentNameError(name) {\n if (name.charAt(0) === '_') {\n return name + ' is not a valid attachment name, attachment ' +\n 'names cannot start with \\'_\\'';\n }\n return false;\n}\n\ninherits(AbstractPouchDB, events.EventEmitter);\n\nfunction AbstractPouchDB() {\n events.EventEmitter.call(this);\n}\n\nAbstractPouchDB.prototype.post =\n adapterFun('post', function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n if (typeof doc !== 'object' || Array.isArray(doc)) {\n return callback(createError(NOT_AN_OBJECT));\n }\n this.bulkDocs({docs: [doc]}, opts, yankError(callback, doc._id));\n});\n\nAbstractPouchDB.prototype.put = adapterFun('put', function (doc, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts;\n opts = {};\n }\n if (typeof doc !== 'object' || Array.isArray(doc)) {\n return cb(createError(NOT_AN_OBJECT));\n }\n invalidIdError(doc._id);\n if (isLocalId(doc._id) && typeof this._putLocal === 'function') {\n if (doc._deleted) {\n return this._removeLocal(doc, cb);\n } else {\n return this._putLocal(doc, cb);\n }\n }\n var self = this;\n if (opts.force && doc._rev) {\n transformForceOptionToNewEditsOption();\n putDoc(function (err) {\n var result = err ? null : {ok: true, id: doc._id, rev: doc._rev};\n cb(err, result);\n });\n } else {\n putDoc(cb);\n }\n\n function transformForceOptionToNewEditsOption() {\n var parts = doc._rev.split('-');\n var oldRevId = parts[1];\n var oldRevNum = parseInt(parts[0], 10);\n\n var newRevNum = oldRevNum + 1;\n var newRevId = rev();\n\n doc._revisions = {\n start: newRevNum,\n ids: [newRevId, oldRevId]\n };\n doc._rev = newRevNum + '-' + newRevId;\n opts.new_edits = false;\n }\n function putDoc(next) {\n if (typeof self._put === 'function' && opts.new_edits !== false) {\n self._put(doc, opts, next);\n } else {\n self.bulkDocs({docs: [doc]}, opts, yankError(next, doc._id));\n }\n }\n});\n\nAbstractPouchDB.prototype.putAttachment =\n adapterFun('putAttachment', function (docId, attachmentId, rev$$1,\n blob, type) {\n var api = this;\n if (typeof type === 'function') {\n type = blob;\n blob = rev$$1;\n rev$$1 = null;\n }\n // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267\n /* istanbul ignore if */\n if (typeof type === 'undefined') {\n type = blob;\n blob = rev$$1;\n rev$$1 = null;\n }\n if (!type) {\n guardedConsole('warn', 'Attachment', attachmentId, 'on document', docId, 'is missing content_type');\n }\n\n function createAttachment(doc) {\n var prevrevpos = '_rev' in doc ? parseInt(doc._rev, 10) : 0;\n doc._attachments = doc._attachments || {};\n doc._attachments[attachmentId] = {\n content_type: type,\n data: blob,\n revpos: ++prevrevpos\n };\n return api.put(doc);\n }\n\n return api.get(docId).then(function (doc) {\n if (doc._rev !== rev$$1) {\n throw createError(REV_CONFLICT);\n }\n\n return createAttachment(doc);\n }, function (err) {\n // create new doc\n /* istanbul ignore else */\n if (err.reason === MISSING_DOC.message) {\n return createAttachment({_id: docId});\n } else {\n throw err;\n }\n });\n});\n\nAbstractPouchDB.prototype.removeAttachment =\n adapterFun('removeAttachment', function (docId, attachmentId, rev$$1,\n callback) {\n var self = this;\n self.get(docId, function (err, obj) {\n /* istanbul ignore if */\n if (err) {\n callback(err);\n return;\n }\n if (obj._rev !== rev$$1) {\n callback(createError(REV_CONFLICT));\n return;\n }\n /* istanbul ignore if */\n if (!obj._attachments) {\n return callback();\n }\n delete obj._attachments[attachmentId];\n if (Object.keys(obj._attachments).length === 0) {\n delete obj._attachments;\n }\n self.put(obj, callback);\n });\n});\n\nAbstractPouchDB.prototype.remove =\n adapterFun('remove', function (docOrId, optsOrRev, opts, callback) {\n var doc;\n if (typeof optsOrRev === 'string') {\n // id, rev, opts, callback style\n doc = {\n _id: docOrId,\n _rev: optsOrRev\n };\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n } else {\n // doc, opts, callback style\n doc = docOrId;\n if (typeof optsOrRev === 'function') {\n callback = optsOrRev;\n opts = {};\n } else {\n callback = opts;\n opts = optsOrRev;\n }\n }\n opts = opts || {};\n opts.was_delete = true;\n var newDoc = {_id: doc._id, _rev: (doc._rev || opts.rev)};\n newDoc._deleted = true;\n if (isLocalId(newDoc._id) && typeof this._removeLocal === 'function') {\n return this._removeLocal(doc, callback);\n }\n this.bulkDocs({docs: [newDoc]}, opts, yankError(callback, newDoc._id));\n});\n\nAbstractPouchDB.prototype.revsDiff =\n adapterFun('revsDiff', function (req, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var ids = Object.keys(req);\n\n if (!ids.length) {\n return callback(null, {});\n }\n\n var count = 0;\n var missing = new ExportedMap();\n\n function addToMissing(id, revId) {\n if (!missing.has(id)) {\n missing.set(id, {missing: []});\n }\n missing.get(id).missing.push(revId);\n }\n\n function processDoc(id, rev_tree) {\n // Is this fast enough? Maybe we should switch to a set simulated by a map\n var missingForId = req[id].slice(0);\n traverseRevTree(rev_tree, function (isLeaf, pos, revHash, ctx,\n opts) {\n var rev$$1 = pos + '-' + revHash;\n var idx = missingForId.indexOf(rev$$1);\n if (idx === -1) {\n return;\n }\n\n missingForId.splice(idx, 1);\n /* istanbul ignore if */\n if (opts.status !== 'available') {\n addToMissing(id, rev$$1);\n }\n });\n\n // Traversing the tree is synchronous, so now `missingForId` contains\n // revisions that were not found in the tree\n missingForId.forEach(function (rev$$1) {\n addToMissing(id, rev$$1);\n });\n }\n\n ids.map(function (id) {\n this._getRevisionTree(id, function (err, rev_tree) {\n if (err && err.status === 404 && err.message === 'missing') {\n missing.set(id, {missing: req[id]});\n } else if (err) {\n /* istanbul ignore next */\n return callback(err);\n } else {\n processDoc(id, rev_tree);\n }\n\n if (++count === ids.length) {\n // convert LazyMap to object\n var missingObj = {};\n missing.forEach(function (value, key) {\n missingObj[key] = value;\n });\n return callback(null, missingObj);\n }\n });\n }, this);\n});\n\n// _bulk_get API for faster replication, as described in\n// https://github.com/apache/couchdb-chttpd/pull/33\n// At the \"abstract\" level, it will just run multiple get()s in\n// parallel, because this isn't much of a performance cost\n// for local databases (except the cost of multiple transactions, which is\n// small). The http adapter overrides this in order\n// to do a more efficient single HTTP request.\nAbstractPouchDB.prototype.bulkGet =\n adapterFun('bulkGet', function (opts, callback) {\n bulkGet(this, opts, callback);\n});\n\n// compact one document and fire callback\n// by compacting we mean removing all revisions which\n// are further from the leaf in revision tree than max_height\nAbstractPouchDB.prototype.compactDocument =\n adapterFun('compactDocument', function (docId, maxHeight, callback) {\n var self = this;\n this._getRevisionTree(docId, function (err, revTree) {\n /* istanbul ignore if */\n if (err) {\n return callback(err);\n }\n var height = computeHeight(revTree);\n var candidates = [];\n var revs = [];\n Object.keys(height).forEach(function (rev$$1) {\n if (height[rev$$1] > maxHeight) {\n candidates.push(rev$$1);\n }\n });\n\n traverseRevTree(revTree, function (isLeaf, pos, revHash, ctx, opts) {\n var rev$$1 = pos + '-' + revHash;\n if (opts.status === 'available' && candidates.indexOf(rev$$1) !== -1) {\n revs.push(rev$$1);\n }\n });\n self._doCompaction(docId, revs, callback);\n });\n});\n\n// compact the whole database using single document\n// compaction\nAbstractPouchDB.prototype.compact =\n adapterFun('compact', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n var self = this;\n opts = opts || {};\n\n self._compactionQueue = self._compactionQueue || [];\n self._compactionQueue.push({opts: opts, callback: callback});\n if (self._compactionQueue.length === 1) {\n doNextCompaction(self);\n }\n});\nAbstractPouchDB.prototype._compact = function (opts, callback) {\n var self = this;\n var changesOpts = {\n return_docs: false,\n last_seq: opts.last_seq || 0\n };\n var promises = [];\n\n function onChange(row) {\n promises.push(self.compactDocument(row.id, 0));\n }\n function onComplete(resp) {\n var lastSeq = resp.last_seq;\n PouchPromise.all(promises).then(function () {\n return upsert(self, '_local/compaction', function deltaFunc(doc) {\n if (!doc.last_seq || doc.last_seq < lastSeq) {\n doc.last_seq = lastSeq;\n return doc;\n }\n return false; // somebody else got here first, don't update\n });\n }).then(function () {\n callback(null, {ok: true});\n })[\"catch\"](callback);\n }\n self.changes(changesOpts)\n .on('change', onChange)\n .on('complete', onComplete)\n .on('error', callback);\n};\n\n/* Begin api wrappers. Specific functionality to storage belongs in the\n _[method] */\nAbstractPouchDB.prototype.get = adapterFun('get', function (id, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts;\n opts = {};\n }\n if (typeof id !== 'string') {\n return cb(createError(INVALID_ID));\n }\n if (isLocalId(id) && typeof this._getLocal === 'function') {\n return this._getLocal(id, cb);\n }\n var leaves = [], self = this;\n\n function finishOpenRevs() {\n var result = [];\n var count = leaves.length;\n /* istanbul ignore if */\n if (!count) {\n return cb(null, result);\n }\n\n // order with open_revs is unspecified\n leaves.forEach(function (leaf) {\n self.get(id, {\n rev: leaf,\n revs: opts.revs,\n latest: opts.latest,\n attachments: opts.attachments,\n binary: opts.binary\n }, function (err, doc) {\n if (!err) {\n // using latest=true can produce duplicates\n var existing;\n for (var i = 0, l = result.length; i < l; i++) {\n if (result[i].ok && result[i].ok._rev === doc._rev) {\n existing = true;\n break;\n }\n }\n if (!existing) {\n result.push({ok: doc});\n }\n } else {\n result.push({missing: leaf});\n }\n count--;\n if (!count) {\n cb(null, result);\n }\n });\n });\n }\n\n if (opts.open_revs) {\n if (opts.open_revs === \"all\") {\n this._getRevisionTree(id, function (err, rev_tree) {\n if (err) {\n return cb(err);\n }\n leaves = collectLeaves(rev_tree).map(function (leaf) {\n return leaf.rev;\n });\n finishOpenRevs();\n });\n } else {\n if (Array.isArray(opts.open_revs)) {\n leaves = opts.open_revs;\n for (var i = 0; i < leaves.length; i++) {\n var l = leaves[i];\n // looks like it's the only thing couchdb checks\n if (!(typeof (l) === \"string\" && /^\\d+-/.test(l))) {\n return cb(createError(INVALID_REV));\n }\n }\n finishOpenRevs();\n } else {\n return cb(createError(UNKNOWN_ERROR, 'function_clause'));\n }\n }\n return; // open_revs does not like other options\n }\n\n return this._get(id, opts, function (err, result) {\n if (err) {\n err.docId = id;\n return cb(err);\n }\n\n var doc = result.doc;\n var metadata = result.metadata;\n var ctx = result.ctx;\n\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n doc._conflicts = conflicts;\n }\n }\n\n if (isDeleted(metadata, doc._rev)) {\n doc._deleted = true;\n }\n\n if (opts.revs || opts.revs_info) {\n var splittedRev = doc._rev.split('-');\n var revNo = parseInt(splittedRev[0], 10);\n var revHash = splittedRev[1];\n\n var paths = rootToLeaf(metadata.rev_tree);\n var path = null;\n\n for (var i = 0; i < paths.length; i++) {\n var currentPath = paths[i];\n var hashIndex = currentPath.ids.map(function (x) { return x.id; })\n .indexOf(revHash);\n var hashFoundAtRevPos = hashIndex === (revNo - 1);\n\n if (hashFoundAtRevPos || (!path && hashIndex !== -1)) {\n path = currentPath;\n }\n }\n\n var indexOfRev = path.ids.map(function (x) { return x.id; })\n .indexOf(doc._rev.split('-')[1]) + 1;\n var howMany = path.ids.length - indexOfRev;\n path.ids.splice(indexOfRev, howMany);\n path.ids.reverse();\n\n if (opts.revs) {\n doc._revisions = {\n start: (path.pos + path.ids.length) - 1,\n ids: path.ids.map(function (rev$$1) {\n return rev$$1.id;\n })\n };\n }\n if (opts.revs_info) {\n var pos = path.pos + path.ids.length;\n doc._revs_info = path.ids.map(function (rev$$1) {\n pos--;\n return {\n rev: pos + '-' + rev$$1.id,\n status: rev$$1.opts.status\n };\n });\n }\n }\n\n if (opts.attachments && doc._attachments) {\n var attachments = doc._attachments;\n var count = Object.keys(attachments).length;\n if (count === 0) {\n return cb(null, doc);\n }\n Object.keys(attachments).forEach(function (key) {\n this._getAttachment(doc._id, key, attachments[key], {\n // Previously the revision handling was done in adapter.js\n // getAttachment, however since idb-next doesnt we need to\n // pass the rev through\n rev: doc._rev,\n binary: opts.binary,\n ctx: ctx\n }, function (err, data) {\n var att = doc._attachments[key];\n att.data = data;\n delete att.stub;\n delete att.length;\n if (!--count) {\n cb(null, doc);\n }\n });\n }, self);\n } else {\n if (doc._attachments) {\n for (var key in doc._attachments) {\n /* istanbul ignore else */\n if (doc._attachments.hasOwnProperty(key)) {\n doc._attachments[key].stub = true;\n }\n }\n }\n cb(null, doc);\n }\n });\n});\n\n// TODO: I dont like this, it forces an extra read for every\n// attachment read and enforces a confusing api between\n// adapter.js and the adapter implementation\nAbstractPouchDB.prototype.getAttachment =\n adapterFun('getAttachment', function (docId, attachmentId, opts, callback) {\n var self = this;\n if (opts instanceof Function) {\n callback = opts;\n opts = {};\n }\n this._get(docId, opts, function (err, res) {\n if (err) {\n return callback(err);\n }\n if (res.doc._attachments && res.doc._attachments[attachmentId]) {\n opts.ctx = res.ctx;\n opts.binary = true;\n self._getAttachment(docId, attachmentId,\n res.doc._attachments[attachmentId], opts, callback);\n } else {\n return callback(createError(MISSING_DOC));\n }\n });\n});\n\nAbstractPouchDB.prototype.allDocs =\n adapterFun('allDocs', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts.skip = typeof opts.skip !== 'undefined' ? opts.skip : 0;\n if (opts.start_key) {\n opts.startkey = opts.start_key;\n }\n if (opts.end_key) {\n opts.endkey = opts.end_key;\n }\n if ('keys' in opts) {\n if (!Array.isArray(opts.keys)) {\n return callback(new TypeError('options.keys must be an array'));\n }\n var incompatibleOpt =\n ['startkey', 'endkey', 'key'].filter(function (incompatibleOpt) {\n return incompatibleOpt in opts;\n })[0];\n if (incompatibleOpt) {\n callback(createError(QUERY_PARSE_ERROR,\n 'Query parameter `' + incompatibleOpt +\n '` is not compatible with multi-get'\n ));\n return;\n }\n if (!isRemote(this)) {\n allDocsKeysParse(opts);\n if (opts.keys.length === 0) {\n return this._allDocs({limit: 0}, callback);\n }\n }\n }\n\n return this._allDocs(opts, callback);\n});\n\nAbstractPouchDB.prototype.changes = function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return new Changes$2(this, opts, callback);\n};\n\nAbstractPouchDB.prototype.close = adapterFun('close', function (callback) {\n this._closed = true;\n this.emit('closed');\n return this._close(callback);\n});\n\nAbstractPouchDB.prototype.info = adapterFun('info', function (callback) {\n var self = this;\n this._info(function (err, info) {\n if (err) {\n return callback(err);\n }\n // assume we know better than the adapter, unless it informs us\n info.db_name = info.db_name || self.name;\n info.auto_compaction = !!(self.auto_compaction && !isRemote(self));\n info.adapter = self.adapter;\n callback(null, info);\n });\n});\n\nAbstractPouchDB.prototype.id = adapterFun('id', function (callback) {\n return this._id(callback);\n});\n\n/* istanbul ignore next */\nAbstractPouchDB.prototype.type = function () {\n return (typeof this._type === 'function') ? this._type() : this.adapter;\n};\n\nAbstractPouchDB.prototype.bulkDocs =\n adapterFun('bulkDocs', function (req, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n opts = opts || {};\n\n if (Array.isArray(req)) {\n req = {\n docs: req\n };\n }\n\n if (!req || !req.docs || !Array.isArray(req.docs)) {\n return callback(createError(MISSING_BULK_DOCS));\n }\n\n for (var i = 0; i < req.docs.length; ++i) {\n if (typeof req.docs[i] !== 'object' || Array.isArray(req.docs[i])) {\n return callback(createError(NOT_AN_OBJECT));\n }\n }\n\n var attachmentError;\n req.docs.forEach(function (doc) {\n if (doc._attachments) {\n Object.keys(doc._attachments).forEach(function (name) {\n attachmentError = attachmentError || attachmentNameError(name);\n if (!doc._attachments[name].content_type) {\n guardedConsole('warn', 'Attachment', name, 'on document', doc._id, 'is missing content_type');\n }\n });\n }\n });\n\n if (attachmentError) {\n return callback(createError(BAD_REQUEST, attachmentError));\n }\n\n if (!('new_edits' in opts)) {\n if ('new_edits' in req) {\n opts.new_edits = req.new_edits;\n } else {\n opts.new_edits = true;\n }\n }\n\n var adapter = this;\n if (!opts.new_edits && !isRemote(adapter)) {\n // ensure revisions of the same doc are sorted, so that\n // the local adapter processes them correctly (#2935)\n req.docs.sort(compareByIdThenRev);\n }\n\n cleanDocs(req.docs);\n\n // in the case of conflicts, we want to return the _ids to the user\n // however, the underlying adapter may destroy the docs array, so\n // create a copy here\n var ids = req.docs.map(function (doc) {\n return doc._id;\n });\n\n return this._bulkDocs(req, opts, function (err, res) {\n if (err) {\n return callback(err);\n }\n if (!opts.new_edits) {\n // this is what couch does when new_edits is false\n res = res.filter(function (x) {\n return x.error;\n });\n }\n // add ids for error/conflict responses (not required for CouchDB)\n if (!isRemote(adapter)) {\n for (var i = 0, l = res.length; i < l; i++) {\n res[i].id = res[i].id || ids[i];\n }\n }\n\n callback(null, res);\n });\n});\n\nAbstractPouchDB.prototype.registerDependentDatabase =\n adapterFun('registerDependentDatabase', function (dependentDb,\n callback) {\n var depDB = new this.constructor(dependentDb, this.__opts);\n\n function diffFun(doc) {\n doc.dependentDbs = doc.dependentDbs || {};\n if (doc.dependentDbs[dependentDb]) {\n return false; // no update required\n }\n doc.dependentDbs[dependentDb] = true;\n return doc;\n }\n upsert(this, '_local/_pouch_dependentDbs', diffFun)\n .then(function () {\n callback(null, {db: depDB});\n })[\"catch\"](callback);\n});\n\nAbstractPouchDB.prototype.destroy =\n adapterFun('destroy', function (opts, callback) {\n\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n var self = this;\n var usePrefix = 'use_prefix' in self ? self.use_prefix : true;\n\n function destroyDb() {\n // call destroy method of the particular adaptor\n self._destroy(opts, function (err, resp) {\n if (err) {\n return callback(err);\n }\n self._destroyed = true;\n self.emit('destroyed');\n callback(null, resp || { 'ok': true });\n });\n }\n\n if (isRemote(self)) {\n // no need to check for dependent DBs if it's a remote DB\n return destroyDb();\n }\n\n self.get('_local/_pouch_dependentDbs', function (err, localDoc) {\n if (err) {\n /* istanbul ignore if */\n if (err.status !== 404) {\n return callback(err);\n } else { // no dependencies\n return destroyDb();\n }\n }\n var dependentDbs = localDoc.dependentDbs;\n var PouchDB = self.constructor;\n var deletedMap = Object.keys(dependentDbs).map(function (name) {\n // use_prefix is only false in the browser\n /* istanbul ignore next */\n var trueName = usePrefix ?\n name.replace(new RegExp('^' + PouchDB.prefix), '') : name;\n return new PouchDB(trueName, self.__opts).destroy();\n });\n PouchPromise.all(deletedMap).then(destroyDb, callback);\n });\n});\n\nfunction TaskQueue$1() {\n this.isReady = false;\n this.failed = false;\n this.queue = [];\n}\n\nTaskQueue$1.prototype.execute = function () {\n var fun;\n if (this.failed) {\n while ((fun = this.queue.shift())) {\n fun(this.failed);\n }\n } else {\n while ((fun = this.queue.shift())) {\n fun();\n }\n }\n};\n\nTaskQueue$1.prototype.fail = function (err) {\n this.failed = err;\n this.execute();\n};\n\nTaskQueue$1.prototype.ready = function (db) {\n this.isReady = true;\n this.db = db;\n this.execute();\n};\n\nTaskQueue$1.prototype.addTask = function (fun) {\n this.queue.push(fun);\n if (this.failed) {\n this.execute();\n }\n};\n\nfunction parseAdapter(name, opts) {\n var match = name.match(/([a-z-]*):\\/\\/(.*)/);\n if (match) {\n // the http adapter expects the fully qualified name\n return {\n name: /https?/.test(match[1]) ? match[1] + '://' + match[2] : match[2],\n adapter: match[1]\n };\n }\n\n var adapters = PouchDB.adapters;\n var preferredAdapters = PouchDB.preferredAdapters;\n var prefix = PouchDB.prefix;\n var adapterName = opts.adapter;\n\n if (!adapterName) { // automatically determine adapter\n for (var i = 0; i < preferredAdapters.length; ++i) {\n adapterName = preferredAdapters[i];\n // check for browsers that have been upgraded from websql-only to websql+idb\n /* istanbul ignore if */\n if (adapterName === 'idb' && 'websql' in adapters &&\n hasLocalStorage() && localStorage['_pouch__websqldb_' + prefix + name]) {\n // log it, because this can be confusing during development\n guardedConsole('log', 'PouchDB is downgrading \"' + name + '\" to WebSQL to' +\n ' avoid data loss, because it was already opened with WebSQL.');\n continue; // keep using websql to avoid user data loss\n }\n break;\n }\n }\n\n var adapter = adapters[adapterName];\n\n // if adapter is invalid, then an error will be thrown later\n var usePrefix = (adapter && 'use_prefix' in adapter) ?\n adapter.use_prefix : true;\n\n return {\n name: usePrefix ? (prefix + name) : name,\n adapter: adapterName\n };\n}\n\n// OK, so here's the deal. Consider this code:\n// var db1 = new PouchDB('foo');\n// var db2 = new PouchDB('foo');\n// db1.destroy();\n// ^ these two both need to emit 'destroyed' events,\n// as well as the PouchDB constructor itself.\n// So we have one db object (whichever one got destroy() called on it)\n// responsible for emitting the initial event, which then gets emitted\n// by the constructor, which then broadcasts it to any other dbs\n// that may have been created with the same name.\nfunction prepareForDestruction(self) {\n\n function onDestroyed(from_constructor) {\n self.removeListener('closed', onClosed);\n if (!from_constructor) {\n self.constructor.emit('destroyed', self.name);\n }\n }\n\n function onClosed() {\n self.removeListener('destroyed', onDestroyed);\n self.constructor.emit('unref', self);\n }\n\n self.once('destroyed', onDestroyed);\n self.once('closed', onClosed);\n self.constructor.emit('ref', self);\n}\n\ninherits(PouchDB, AbstractPouchDB);\nfunction PouchDB(name, opts) {\n // In Node our test suite only tests this for PouchAlt unfortunately\n /* istanbul ignore if */\n if (!(this instanceof PouchDB)) {\n return new PouchDB(name, opts);\n }\n\n var self = this;\n opts = opts || {};\n\n if (name && typeof name === 'object') {\n opts = name;\n name = opts.name;\n delete opts.name;\n }\n\n this.__opts = opts = clone(opts);\n\n self.auto_compaction = opts.auto_compaction;\n self.prefix = PouchDB.prefix;\n\n if (typeof name !== 'string') {\n throw new Error('Missing/invalid DB name');\n }\n\n var prefixedName = (opts.prefix || '') + name;\n var backend = parseAdapter(prefixedName, opts);\n\n opts.name = backend.name;\n opts.adapter = opts.adapter || backend.adapter;\n\n self.name = name;\n self._adapter = opts.adapter;\n PouchDB.emit('debug', ['adapter', 'Picked adapter: ', opts.adapter]);\n\n if (!PouchDB.adapters[opts.adapter] ||\n !PouchDB.adapters[opts.adapter].valid()) {\n throw new Error('Invalid Adapter: ' + opts.adapter);\n }\n\n AbstractPouchDB.call(self);\n self.taskqueue = new TaskQueue$1();\n\n self.adapter = opts.adapter;\n\n PouchDB.adapters[opts.adapter].call(self, opts, function (err) {\n if (err) {\n return self.taskqueue.fail(err);\n }\n prepareForDestruction(self);\n\n self.emit('created', self);\n PouchDB.emit('created', self.name);\n self.taskqueue.ready(self);\n });\n\n}\n\nPouchDB.adapters = {};\nPouchDB.preferredAdapters = [];\n\nPouchDB.prefix = '_pouch_';\n\nvar eventEmitter = new events.EventEmitter();\n\nfunction setUpEventEmitter(Pouch) {\n Object.keys(events.EventEmitter.prototype).forEach(function (key) {\n if (typeof events.EventEmitter.prototype[key] === 'function') {\n Pouch[key] = eventEmitter[key].bind(eventEmitter);\n }\n });\n\n // these are created in constructor.js, and allow us to notify each DB with\n // the same name that it was destroyed, via the constructor object\n var destructListeners = Pouch._destructionListeners = new ExportedMap();\n\n Pouch.on('ref', function onConstructorRef(db) {\n if (!destructListeners.has(db.name)) {\n destructListeners.set(db.name, []);\n }\n destructListeners.get(db.name).push(db);\n });\n\n Pouch.on('unref', function onConstructorUnref(db) {\n if (!destructListeners.has(db.name)) {\n return;\n }\n var dbList = destructListeners.get(db.name);\n var pos = dbList.indexOf(db);\n if (pos < 0) {\n /* istanbul ignore next */\n return;\n }\n dbList.splice(pos, 1);\n if (dbList.length > 1) {\n /* istanbul ignore next */\n destructListeners.set(db.name, dbList);\n } else {\n destructListeners[\"delete\"](db.name);\n }\n });\n\n Pouch.on('destroyed', function onConstructorDestroyed(name) {\n if (!destructListeners.has(name)) {\n return;\n }\n var dbList = destructListeners.get(name);\n destructListeners[\"delete\"](name);\n dbList.forEach(function (db) {\n db.emit('destroyed',true);\n });\n });\n}\n\nsetUpEventEmitter(PouchDB);\n\nPouchDB.adapter = function (id, obj, addToPreferredAdapters) {\n /* istanbul ignore else */\n if (obj.valid()) {\n PouchDB.adapters[id] = obj;\n if (addToPreferredAdapters) {\n PouchDB.preferredAdapters.push(id);\n }\n }\n};\n\nPouchDB.plugin = function (obj) {\n if (typeof obj === 'function') { // function style for plugins\n obj(PouchDB);\n } else if (typeof obj !== 'object' || Object.keys(obj).length === 0) {\n throw new Error('Invalid plugin: got \"' + obj + '\", expected an object or a function');\n } else {\n Object.keys(obj).forEach(function (id) { // object style for plugins\n PouchDB.prototype[id] = obj[id];\n });\n }\n if (this.__defaults) {\n PouchDB.__defaults = $inject_Object_assign({}, this.__defaults);\n }\n return PouchDB;\n};\n\nPouchDB.defaults = function (defaultOpts) {\n function PouchAlt(name, opts) {\n if (!(this instanceof PouchAlt)) {\n return new PouchAlt(name, opts);\n }\n\n opts = opts || {};\n\n if (name && typeof name === 'object') {\n opts = name;\n name = opts.name;\n delete opts.name;\n }\n\n opts = $inject_Object_assign({}, PouchAlt.__defaults, opts);\n PouchDB.call(this, name, opts);\n }\n\n inherits(PouchAlt, PouchDB);\n\n PouchAlt.preferredAdapters = PouchDB.preferredAdapters.slice();\n Object.keys(PouchDB).forEach(function (key) {\n if (!(key in PouchAlt)) {\n PouchAlt[key] = PouchDB[key];\n }\n });\n\n // make default options transitive\n // https://github.com/pouchdb/pouchdb/issues/5922\n PouchAlt.__defaults = $inject_Object_assign({}, this.__defaults, defaultOpts);\n\n return PouchAlt;\n};\n\n// managed automatically by set-version.js\nvar version = \"6.4.3\";\n\nfunction debugPouch(PouchDB) {\n PouchDB.debug = debug;\n var logs = {};\n /* istanbul ignore next */\n PouchDB.on('debug', function (args) {\n // first argument is log identifier\n var logId = args[0];\n // rest should be passed verbatim to debug module\n var logArgs = args.slice(1);\n if (!logs[logId]) {\n logs[logId] = debug('pouchdb:' + logId);\n }\n logs[logId].apply(null, logArgs);\n });\n}\n\n// this would just be \"return doc[field]\", but fields\n// can be \"deep\" due to dot notation\nfunction getFieldFromDoc(doc, parsedField) {\n var value = doc;\n for (var i = 0, len = parsedField.length; i < len; i++) {\n var key = parsedField[i];\n value = value[key];\n if (!value) {\n break;\n }\n }\n return value;\n}\n\nfunction compare$1(left, right) {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\n// Converts a string in dot notation to an array of its components, with backslash escaping\nfunction parseField(fieldName) {\n // fields may be deep (e.g. \"foo.bar.baz\"), so parse\n var fields = [];\n var current = '';\n for (var i = 0, len = fieldName.length; i < len; i++) {\n var ch = fieldName[i];\n if (ch === '.') {\n if (i > 0 && fieldName[i - 1] === '\\\\') { // escaped delimiter\n current = current.substring(0, current.length - 1) + '.';\n } else { // not escaped, so delimiter\n fields.push(current);\n current = '';\n }\n } else { // normal character\n current += ch;\n }\n }\n fields.push(current);\n return fields;\n}\n\nvar combinationFields = ['$or', '$nor', '$not'];\nfunction isCombinationalField(field) {\n return combinationFields.indexOf(field) > -1;\n}\n\nfunction getKey(obj) {\n return Object.keys(obj)[0];\n}\n\nfunction getValue(obj) {\n return obj[getKey(obj)];\n}\n\n\n// flatten an array of selectors joined by an $and operator\nfunction mergeAndedSelectors(selectors) {\n\n // sort to ensure that e.g. if the user specified\n // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into\n // just {$gt: 'b'}\n var res = {};\n\n selectors.forEach(function (selector) {\n Object.keys(selector).forEach(function (field) {\n var matcher = selector[field];\n if (typeof matcher !== 'object') {\n matcher = {$eq: matcher};\n }\n\n if (isCombinationalField(field)) {\n if (matcher instanceof Array) {\n res[field] = matcher.map(function (m) {\n return mergeAndedSelectors([m]);\n });\n } else {\n res[field] = mergeAndedSelectors([matcher]);\n }\n } else {\n var fieldMatchers = res[field] = res[field] || {};\n Object.keys(matcher).forEach(function (operator) {\n var value = matcher[operator];\n\n if (operator === '$gt' || operator === '$gte') {\n return mergeGtGte(operator, value, fieldMatchers);\n } else if (operator === '$lt' || operator === '$lte') {\n return mergeLtLte(operator, value, fieldMatchers);\n } else if (operator === '$ne') {\n return mergeNe(value, fieldMatchers);\n } else if (operator === '$eq') {\n return mergeEq(value, fieldMatchers);\n }\n fieldMatchers[operator] = value;\n });\n }\n });\n });\n\n return res;\n}\n\n\n\n// collapse logically equivalent gt/gte values\nfunction mergeGtGte(operator, value, fieldMatchers) {\n if (typeof fieldMatchers.$eq !== 'undefined') {\n return; // do nothing\n }\n if (typeof fieldMatchers.$gte !== 'undefined') {\n if (operator === '$gte') {\n if (value > fieldMatchers.$gte) { // more specificity\n fieldMatchers.$gte = value;\n }\n } else { // operator === '$gt'\n if (value >= fieldMatchers.$gte) { // more specificity\n delete fieldMatchers.$gte;\n fieldMatchers.$gt = value;\n }\n }\n } else if (typeof fieldMatchers.$gt !== 'undefined') {\n if (operator === '$gte') {\n if (value > fieldMatchers.$gt) { // more specificity\n delete fieldMatchers.$gt;\n fieldMatchers.$gte = value;\n }\n } else { // operator === '$gt'\n if (value > fieldMatchers.$gt) { // more specificity\n fieldMatchers.$gt = value;\n }\n }\n } else {\n fieldMatchers[operator] = value;\n }\n}\n\n// collapse logically equivalent lt/lte values\nfunction mergeLtLte(operator, value, fieldMatchers) {\n if (typeof fieldMatchers.$eq !== 'undefined') {\n return; // do nothing\n }\n if (typeof fieldMatchers.$lte !== 'undefined') {\n if (operator === '$lte') {\n if (value < fieldMatchers.$lte) { // more specificity\n fieldMatchers.$lte = value;\n }\n } else { // operator === '$gt'\n if (value <= fieldMatchers.$lte) { // more specificity\n delete fieldMatchers.$lte;\n fieldMatchers.$lt = value;\n }\n }\n } else if (typeof fieldMatchers.$lt !== 'undefined') {\n if (operator === '$lte') {\n if (value < fieldMatchers.$lt) { // more specificity\n delete fieldMatchers.$lt;\n fieldMatchers.$lte = value;\n }\n } else { // operator === '$gt'\n if (value < fieldMatchers.$lt) { // more specificity\n fieldMatchers.$lt = value;\n }\n }\n } else {\n fieldMatchers[operator] = value;\n }\n}\n\n// combine $ne values into one array\nfunction mergeNe(value, fieldMatchers) {\n if ('$ne' in fieldMatchers) {\n // there are many things this could \"not\" be\n fieldMatchers.$ne.push(value);\n } else { // doesn't exist yet\n fieldMatchers.$ne = [value];\n }\n}\n\n// add $eq into the mix\nfunction mergeEq(value, fieldMatchers) {\n // these all have less specificity than the $eq\n // TODO: check for user errors here\n delete fieldMatchers.$gt;\n delete fieldMatchers.$gte;\n delete fieldMatchers.$lt;\n delete fieldMatchers.$lte;\n delete fieldMatchers.$ne;\n fieldMatchers.$eq = value;\n}\n\n\n//\n// normalize the selector\n//\nfunction massageSelector(input) {\n var result = clone(input);\n var wasAnded = false;\n if ('$and' in result) {\n result = mergeAndedSelectors(result['$and']);\n wasAnded = true;\n }\n\n ['$or', '$nor'].forEach(function (orOrNor) {\n if (orOrNor in result) {\n // message each individual selector\n // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}}\n result[orOrNor].forEach(function (subSelector) {\n var fields = Object.keys(subSelector);\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n var matcher = subSelector[field];\n if (typeof matcher !== 'object' || matcher === null) {\n subSelector[field] = {$eq: matcher};\n }\n }\n });\n }\n });\n\n if ('$not' in result) {\n //This feels a little like forcing, but it will work for now,\n //I would like to come back to this and make the merging of selectors a little more generic\n result['$not'] = mergeAndedSelectors([result['$not']]);\n }\n\n var fields = Object.keys(result);\n\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n var matcher = result[field];\n\n if (typeof matcher !== 'object' || matcher === null) {\n matcher = {$eq: matcher};\n } else if ('$ne' in matcher && !wasAnded) {\n // I put these in an array, since there may be more than one\n // but in the \"mergeAnded\" operation, I already take care of that\n matcher.$ne = [matcher.$ne];\n }\n result[field] = matcher;\n }\n\n return result;\n}\n\nfunction pad(str, padWith, upToLength) {\n var padding = '';\n var targetLength = upToLength - str.length;\n /* istanbul ignore next */\n while (padding.length < targetLength) {\n padding += padWith;\n }\n return padding;\n}\n\nfunction padLeft(str, padWith, upToLength) {\n var padding = pad(str, padWith, upToLength);\n return padding + str;\n}\n\nvar MIN_MAGNITUDE = -324; // verified by -Number.MIN_VALUE\nvar MAGNITUDE_DIGITS = 3; // ditto\nvar SEP = ''; // set to '_' for easier debugging \n\nfunction collate(a, b) {\n\n if (a === b) {\n return 0;\n }\n\n a = normalizeKey(a);\n b = normalizeKey(b);\n\n var ai = collationIndex(a);\n var bi = collationIndex(b);\n if ((ai - bi) !== 0) {\n return ai - bi;\n }\n switch (typeof a) {\n case 'number':\n return a - b;\n case 'boolean':\n return a < b ? -1 : 1;\n case 'string':\n return stringCollate(a, b);\n }\n return Array.isArray(a) ? arrayCollate(a, b) : objectCollate(a, b);\n}\n\n// couch considers null/NaN/Infinity/-Infinity === undefined,\n// for the purposes of mapreduce indexes. also, dates get stringified.\nfunction normalizeKey(key) {\n switch (typeof key) {\n case 'undefined':\n return null;\n case 'number':\n if (key === Infinity || key === -Infinity || isNaN(key)) {\n return null;\n }\n return key;\n case 'object':\n var origKey = key;\n if (Array.isArray(key)) {\n var len = key.length;\n key = new Array(len);\n for (var i = 0; i < len; i++) {\n key[i] = normalizeKey(origKey[i]);\n }\n /* istanbul ignore next */\n } else if (key instanceof Date) {\n return key.toJSON();\n } else if (key !== null) { // generic object\n key = {};\n for (var k in origKey) {\n if (origKey.hasOwnProperty(k)) {\n var val = origKey[k];\n if (typeof val !== 'undefined') {\n key[k] = normalizeKey(val);\n }\n }\n }\n }\n }\n return key;\n}\n\nfunction indexify(key) {\n if (key !== null) {\n switch (typeof key) {\n case 'boolean':\n return key ? 1 : 0;\n case 'number':\n return numToIndexableString(key);\n case 'string':\n // We've to be sure that key does not contain \\u0000\n // Do order-preserving replacements:\n // 0 -> 1, 1\n // 1 -> 1, 2\n // 2 -> 2, 2\n return key\n .replace(/\\u0002/g, '\\u0002\\u0002')\n .replace(/\\u0001/g, '\\u0001\\u0002')\n .replace(/\\u0000/g, '\\u0001\\u0001');\n case 'object':\n var isArray = Array.isArray(key);\n var arr = isArray ? key : Object.keys(key);\n var i = -1;\n var len = arr.length;\n var result = '';\n if (isArray) {\n while (++i < len) {\n result += toIndexableString(arr[i]);\n }\n } else {\n while (++i < len) {\n var objKey = arr[i];\n result += toIndexableString(objKey) +\n toIndexableString(key[objKey]);\n }\n }\n return result;\n }\n }\n return '';\n}\n\n// convert the given key to a string that would be appropriate\n// for lexical sorting, e.g. within a database, where the\n// sorting is the same given by the collate() function.\nfunction toIndexableString(key) {\n var zero = '\\u0000';\n key = normalizeKey(key);\n return collationIndex(key) + SEP + indexify(key) + zero;\n}\n\nfunction parseNumber(str, i) {\n var originalIdx = i;\n var num;\n var zero = str[i] === '1';\n if (zero) {\n num = 0;\n i++;\n } else {\n var neg = str[i] === '0';\n i++;\n var numAsString = '';\n var magAsString = str.substring(i, i + MAGNITUDE_DIGITS);\n var magnitude = parseInt(magAsString, 10) + MIN_MAGNITUDE;\n /* istanbul ignore next */\n if (neg) {\n magnitude = -magnitude;\n }\n i += MAGNITUDE_DIGITS;\n while (true) {\n var ch = str[i];\n if (ch === '\\u0000') {\n break;\n } else {\n numAsString += ch;\n }\n i++;\n }\n numAsString = numAsString.split('.');\n if (numAsString.length === 1) {\n num = parseInt(numAsString, 10);\n } else {\n /* istanbul ignore next */\n num = parseFloat(numAsString[0] + '.' + numAsString[1]);\n }\n /* istanbul ignore next */\n if (neg) {\n num = num - 10;\n }\n /* istanbul ignore next */\n if (magnitude !== 0) {\n // parseFloat is more reliable than pow due to rounding errors\n // e.g. Number.MAX_VALUE would return Infinity if we did\n // num * Math.pow(10, magnitude);\n num = parseFloat(num + 'e' + magnitude);\n }\n }\n return {num: num, length : i - originalIdx};\n}\n\n// move up the stack while parsing\n// this function moved outside of parseIndexableString for performance\nfunction pop(stack, metaStack) {\n var obj = stack.pop();\n\n if (metaStack.length) {\n var lastMetaElement = metaStack[metaStack.length - 1];\n if (obj === lastMetaElement.element) {\n // popping a meta-element, e.g. an object whose value is another object\n metaStack.pop();\n lastMetaElement = metaStack[metaStack.length - 1];\n }\n var element = lastMetaElement.element;\n var lastElementIndex = lastMetaElement.index;\n if (Array.isArray(element)) {\n element.push(obj);\n } else if (lastElementIndex === stack.length - 2) { // obj with key+value\n var key = stack.pop();\n element[key] = obj;\n } else {\n stack.push(obj); // obj with key only\n }\n }\n}\n\nfunction parseIndexableString(str) {\n var stack = [];\n var metaStack = []; // stack for arrays and objects\n var i = 0;\n\n /*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n while (true) {\n var collationIndex = str[i++];\n if (collationIndex === '\\u0000') {\n if (stack.length === 1) {\n return stack.pop();\n } else {\n pop(stack, metaStack);\n continue;\n }\n }\n switch (collationIndex) {\n case '1':\n stack.push(null);\n break;\n case '2':\n stack.push(str[i] === '1');\n i++;\n break;\n case '3':\n var parsedNum = parseNumber(str, i);\n stack.push(parsedNum.num);\n i += parsedNum.length;\n break;\n case '4':\n var parsedStr = '';\n /*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n while (true) {\n var ch = str[i];\n if (ch === '\\u0000') {\n break;\n }\n parsedStr += ch;\n i++;\n }\n // perform the reverse of the order-preserving replacement\n // algorithm (see above)\n parsedStr = parsedStr.replace(/\\u0001\\u0001/g, '\\u0000')\n .replace(/\\u0001\\u0002/g, '\\u0001')\n .replace(/\\u0002\\u0002/g, '\\u0002');\n stack.push(parsedStr);\n break;\n case '5':\n var arrayElement = { element: [], index: stack.length };\n stack.push(arrayElement.element);\n metaStack.push(arrayElement);\n break;\n case '6':\n var objElement = { element: {}, index: stack.length };\n stack.push(objElement.element);\n metaStack.push(objElement);\n break;\n /* istanbul ignore next */\n default:\n throw new Error(\n 'bad collationIndex or unexpectedly reached end of input: ' +\n collationIndex);\n }\n }\n}\n\nfunction arrayCollate(a, b) {\n var len = Math.min(a.length, b.length);\n for (var i = 0; i < len; i++) {\n var sort = collate(a[i], b[i]);\n if (sort !== 0) {\n return sort;\n }\n }\n return (a.length === b.length) ? 0 :\n (a.length > b.length) ? 1 : -1;\n}\nfunction stringCollate(a, b) {\n // See: https://github.com/daleharvey/pouchdb/issues/40\n // This is incompatible with the CouchDB implementation, but its the\n // best we can do for now\n return (a === b) ? 0 : ((a > b) ? 1 : -1);\n}\nfunction objectCollate(a, b) {\n var ak = Object.keys(a), bk = Object.keys(b);\n var len = Math.min(ak.length, bk.length);\n for (var i = 0; i < len; i++) {\n // First sort the keys\n var sort = collate(ak[i], bk[i]);\n if (sort !== 0) {\n return sort;\n }\n // if the keys are equal sort the values\n sort = collate(a[ak[i]], b[bk[i]]);\n if (sort !== 0) {\n return sort;\n }\n\n }\n return (ak.length === bk.length) ? 0 :\n (ak.length > bk.length) ? 1 : -1;\n}\n// The collation is defined by erlangs ordered terms\n// the atoms null, true, false come first, then numbers, strings,\n// arrays, then objects\n// null/undefined/NaN/Infinity/-Infinity are all considered null\nfunction collationIndex(x) {\n var id = ['boolean', 'number', 'string', 'object'];\n var idx = id.indexOf(typeof x);\n //false if -1 otherwise true, but fast!!!!1\n if (~idx) {\n if (x === null) {\n return 1;\n }\n if (Array.isArray(x)) {\n return 5;\n }\n return idx < 3 ? (idx + 2) : (idx + 3);\n }\n /* istanbul ignore next */\n if (Array.isArray(x)) {\n return 5;\n }\n}\n\n// conversion:\n// x yyy zz...zz\n// x = 0 for negative, 1 for 0, 2 for positive\n// y = exponent (for negative numbers negated) moved so that it's >= 0\n// z = mantisse\nfunction numToIndexableString(num) {\n\n if (num === 0) {\n return '1';\n }\n\n // convert number to exponential format for easier and\n // more succinct string sorting\n var expFormat = num.toExponential().split(/e\\+?/);\n var magnitude = parseInt(expFormat[1], 10);\n\n var neg = num < 0;\n\n var result = neg ? '0' : '2';\n\n // first sort by magnitude\n // it's easier if all magnitudes are positive\n var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE);\n var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS);\n\n result += SEP + magString;\n\n // then sort by the factor\n var factor = Math.abs(parseFloat(expFormat[0])); // [1..10)\n /* istanbul ignore next */\n if (neg) { // for negative reverse ordering\n factor = 10 - factor;\n }\n\n var factorStr = factor.toFixed(20);\n\n // strip zeros from the end\n factorStr = factorStr.replace(/\\.?0+$/, '');\n\n result += SEP + factorStr;\n\n return result;\n}\n\n// create a comparator based on the sort object\nfunction createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare$1(aRow.doc._id, bRow.doc._id);\n };\n}\n\nfunction filterInMemoryFields(rows, requestDef, inMemoryFields) {\n rows = rows.filter(function (row) {\n return rowFilter(row.doc, requestDef.selector, inMemoryFields);\n });\n\n if (requestDef.sort) {\n // in-memory sort\n var fieldSorter = createFieldSorter(requestDef.sort);\n rows = rows.sort(fieldSorter);\n if (typeof requestDef.sort[0] !== 'string' &&\n getValue(requestDef.sort[0]) === 'desc') {\n rows = rows.reverse();\n }\n }\n\n if ('limit' in requestDef || 'skip' in requestDef) {\n // have to do the limit in-memory\n var skip = requestDef.skip || 0;\n var limit = ('limit' in requestDef ? requestDef.limit : rows.length) + skip;\n rows = rows.slice(skip, limit);\n }\n return rows;\n}\n\nfunction rowFilter(doc, selector, inMemoryFields) {\n return inMemoryFields.every(function (field) {\n var matcher = selector[field];\n var parsedField = parseField(field);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n if (isCombinationalField(field)) {\n return matchCominationalSelector(field, matcher, doc);\n }\n\n return matchSelector(matcher, doc, parsedField, docFieldValue);\n });\n}\n\nfunction matchSelector(matcher, doc, parsedField, docFieldValue) {\n if (!matcher) {\n // no filtering necessary; this field is just needed for sorting\n return true;\n }\n\n return Object.keys(matcher).every(function (userOperator) {\n var userValue = matcher[userOperator];\n return match(userOperator, doc, userValue, parsedField, docFieldValue);\n });\n}\n\nfunction matchCominationalSelector(field, matcher, doc) {\n\n if (field === '$or') {\n return matcher.some(function (orMatchers) {\n return rowFilter(doc, orMatchers, Object.keys(orMatchers));\n });\n }\n\n if (field === '$not') {\n return !rowFilter(doc, matcher, Object.keys(matcher));\n }\n\n //`$nor`\n return !matcher.find(function (orMatchers) {\n return rowFilter(doc, orMatchers, Object.keys(orMatchers));\n });\n\n}\n\nfunction match(userOperator, doc, userValue, parsedField, docFieldValue) {\n if (!matchers[userOperator]) {\n throw new Error('unknown operator \"' + userOperator +\n '\" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, ' +\n '$nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all');\n }\n return matchers[userOperator](doc, userValue, parsedField, docFieldValue);\n}\n\nfunction fieldExists(docFieldValue) {\n return typeof docFieldValue !== 'undefined' && docFieldValue !== null;\n}\n\nfunction fieldIsNotUndefined(docFieldValue) {\n return typeof docFieldValue !== 'undefined';\n}\n\nfunction modField(docFieldValue, userValue) {\n var divisor = userValue[0];\n var mod = userValue[1];\n if (divisor === 0) {\n throw new Error('Bad divisor, cannot divide by zero');\n }\n\n if (parseInt(divisor, 10) !== divisor ) {\n throw new Error('Divisor is not an integer');\n }\n\n if (parseInt(mod, 10) !== mod ) {\n throw new Error('Modulus is not an integer');\n }\n\n if (parseInt(docFieldValue, 10) !== docFieldValue) {\n return false;\n }\n\n return docFieldValue % divisor === mod;\n}\n\nfunction arrayContainsValue(docFieldValue, userValue) {\n return userValue.some(function (val) {\n if (docFieldValue instanceof Array) {\n return docFieldValue.indexOf(val) > -1;\n }\n\n return docFieldValue === val;\n });\n}\n\nfunction arrayContainsAllValues(docFieldValue, userValue) {\n return userValue.every(function (val) {\n return docFieldValue.indexOf(val) > -1;\n });\n}\n\nfunction arraySize(docFieldValue, userValue) {\n return docFieldValue.length === userValue;\n}\n\nfunction regexMatch(docFieldValue, userValue) {\n var re = new RegExp(userValue);\n\n return re.test(docFieldValue);\n}\n\nfunction typeMatch(docFieldValue, userValue) {\n\n switch (userValue) {\n case 'null':\n return docFieldValue === null;\n case 'boolean':\n return typeof (docFieldValue) === 'boolean';\n case 'number':\n return typeof (docFieldValue) === 'number';\n case 'string':\n return typeof (docFieldValue) === 'string';\n case 'array':\n return docFieldValue instanceof Array;\n case 'object':\n return ({}).toString.call(docFieldValue) === '[object Object]';\n }\n\n throw new Error(userValue + ' not supported as a type.' +\n 'Please use one of object, string, array, number, boolean or null.');\n\n}\n\nvar matchers = {\n\n '$elemMatch': function (doc, userValue, parsedField, docFieldValue) {\n if (!Array.isArray(docFieldValue)) {\n return false;\n }\n\n if (docFieldValue.length === 0) {\n return false;\n }\n\n if (typeof docFieldValue[0] === 'object') {\n return docFieldValue.some(function (val) {\n return rowFilter(val, userValue, Object.keys(userValue));\n });\n }\n\n return docFieldValue.some(function (val) {\n return matchSelector(userValue, doc, parsedField, val);\n });\n },\n\n '$allMatch': function (doc, userValue, parsedField, docFieldValue) {\n if (!Array.isArray(docFieldValue)) {\n return false;\n }\n\n /* istanbul ignore next */\n if (docFieldValue.length === 0) {\n return false;\n }\n\n if (typeof docFieldValue[0] === 'object') {\n return docFieldValue.every(function (val) {\n return rowFilter(val, userValue, Object.keys(userValue));\n });\n }\n\n return docFieldValue.every(function (val) {\n return matchSelector(userValue, doc, parsedField, val);\n });\n },\n\n '$eq': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) === 0;\n },\n\n '$gte': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) >= 0;\n },\n\n '$gt': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) > 0;\n },\n\n '$lte': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) <= 0;\n },\n\n '$lt': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) < 0;\n },\n\n '$exists': function (doc, userValue, parsedField, docFieldValue) {\n //a field that is null is still considered to exist\n if (userValue) {\n return fieldIsNotUndefined(docFieldValue);\n }\n\n return !fieldIsNotUndefined(docFieldValue);\n },\n\n '$mod': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && modField(docFieldValue, userValue);\n },\n\n '$ne': function (doc, userValue, parsedField, docFieldValue) {\n return userValue.every(function (neValue) {\n return collate(docFieldValue, neValue) !== 0;\n });\n },\n '$in': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && arrayContainsValue(docFieldValue, userValue);\n },\n\n '$nin': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && !arrayContainsValue(docFieldValue, userValue);\n },\n\n '$size': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && arraySize(docFieldValue, userValue);\n },\n\n '$all': function (doc, userValue, parsedField, docFieldValue) {\n return Array.isArray(docFieldValue) && arrayContainsAllValues(docFieldValue, userValue);\n },\n\n '$regex': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && regexMatch(docFieldValue, userValue);\n },\n\n '$type': function (doc, userValue, parsedField, docFieldValue) {\n return typeMatch(docFieldValue, userValue);\n }\n};\n\n// return true if the given doc matches the supplied selector\nfunction matchesSelector(doc, selector) {\n /* istanbul ignore if */\n if (typeof selector !== 'object') {\n // match the CouchDB error message\n throw new Error('Selector error: expected a JSON object');\n }\n\n selector = massageSelector(selector);\n var row = {\n 'doc': doc\n };\n\n var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector));\n return rowsMatched && rowsMatched.length === 1;\n}\n\nfunction evalFilter(input) {\n return scopeEval('\"use strict\";\\nreturn ' + input + ';', {});\n}\n\nfunction evalView(input) {\n var code = [\n 'return function(doc) {',\n ' \"use strict\";',\n ' var emitted = false;',\n ' var emit = function (a, b) {',\n ' emitted = true;',\n ' };',\n ' var view = ' + input + ';',\n ' view(doc);',\n ' if (emitted) {',\n ' return true;',\n ' }',\n '};'\n ].join('\\n');\n\n return scopeEval(code, {});\n}\n\nfunction validate(opts, callback) {\n if (opts.selector) {\n if (opts.filter && opts.filter !== '_selector') {\n var filterName = typeof opts.filter === 'string' ?\n opts.filter : 'function';\n return callback(new Error('selector invalid for filter \"' + filterName + '\"'));\n }\n }\n callback();\n}\n\nfunction normalize(opts) {\n if (opts.view && !opts.filter) {\n opts.filter = '_view';\n }\n\n if (opts.selector && !opts.filter) {\n opts.filter = '_selector';\n }\n\n if (opts.filter && typeof opts.filter === 'string') {\n if (opts.filter === '_view') {\n opts.view = normalizeDesignDocFunctionName(opts.view);\n } else {\n opts.filter = normalizeDesignDocFunctionName(opts.filter);\n }\n }\n}\n\nfunction shouldFilter(changesHandler, opts) {\n return opts.filter && typeof opts.filter === 'string' &&\n !opts.doc_ids && !isRemote(changesHandler.db);\n}\n\nfunction filter(changesHandler, opts) {\n var callback = opts.complete;\n if (opts.filter === '_view') {\n if (!opts.view || typeof opts.view !== 'string') {\n var err = createError(BAD_REQUEST,\n '`view` filter parameter not found or invalid.');\n return callback(err);\n }\n // fetch a view from a design doc, make it behave like a filter\n var viewName = parseDesignDocFunctionName(opts.view);\n changesHandler.db.get('_design/' + viewName[0], function (err, ddoc) {\n /* istanbul ignore if */\n if (changesHandler.isCancelled) {\n return callback(null, {status: 'cancelled'});\n }\n /* istanbul ignore next */\n if (err) {\n return callback(generateErrorFromResponse(err));\n }\n var mapFun = ddoc && ddoc.views && ddoc.views[viewName[1]] &&\n ddoc.views[viewName[1]].map;\n if (!mapFun) {\n return callback(createError(MISSING_DOC,\n (ddoc.views ? 'missing json key: ' + viewName[1] :\n 'missing json key: views')));\n }\n opts.filter = evalView(mapFun);\n changesHandler.doChanges(opts);\n });\n } else if (opts.selector) {\n opts.filter = function (doc) {\n return matchesSelector(doc, opts.selector);\n };\n changesHandler.doChanges(opts);\n } else {\n // fetch a filter from a design doc\n var filterName = parseDesignDocFunctionName(opts.filter);\n changesHandler.db.get('_design/' + filterName[0], function (err, ddoc) {\n /* istanbul ignore if */\n if (changesHandler.isCancelled) {\n return callback(null, {status: 'cancelled'});\n }\n /* istanbul ignore next */\n if (err) {\n return callback(generateErrorFromResponse(err));\n }\n var filterFun = ddoc && ddoc.filters && ddoc.filters[filterName[1]];\n if (!filterFun) {\n return callback(createError(MISSING_DOC,\n ((ddoc && ddoc.filters) ? 'missing json key: ' + filterName[1]\n : 'missing json key: filters')));\n }\n opts.filter = evalFilter(filterFun);\n changesHandler.doChanges(opts);\n });\n }\n}\n\nfunction applyChangesFilterPlugin(PouchDB) {\n PouchDB._changesFilterPlugin = {\n validate: validate,\n normalize: normalize,\n shouldFilter: shouldFilter,\n filter: filter\n };\n}\n\n// TODO: remove from pouchdb-core (breaking)\nPouchDB.plugin(debugPouch);\n\n// TODO: remove from pouchdb-core (breaking)\nPouchDB.plugin(applyChangesFilterPlugin);\n\nPouchDB.version = version;\n\nfunction toObject(array) {\n return array.reduce(function (obj, item) {\n obj[item] = true;\n return obj;\n }, {});\n}\n// List of top level reserved words for doc\nvar reservedWords = toObject([\n '_id',\n '_rev',\n '_attachments',\n '_deleted',\n '_revisions',\n '_revs_info',\n '_conflicts',\n '_deleted_conflicts',\n '_local_seq',\n '_rev_tree',\n //replication documents\n '_replication_id',\n '_replication_state',\n '_replication_state_time',\n '_replication_state_reason',\n '_replication_stats',\n // Specific to Couchbase Sync Gateway\n '_removed'\n]);\n\n// List of reserved words that should end up the document\nvar dataWords = toObject([\n '_attachments',\n //replication documents\n '_replication_id',\n '_replication_state',\n '_replication_state_time',\n '_replication_state_reason',\n '_replication_stats'\n]);\n\nfunction parseRevisionInfo(rev$$1) {\n if (!/^\\d+-./.test(rev$$1)) {\n return createError(INVALID_REV);\n }\n var idx = rev$$1.indexOf('-');\n var left = rev$$1.substring(0, idx);\n var right = rev$$1.substring(idx + 1);\n return {\n prefix: parseInt(left, 10),\n id: right\n };\n}\n\nfunction makeRevTreeFromRevisions(revisions, opts) {\n var pos = revisions.start - revisions.ids.length + 1;\n\n var revisionIds = revisions.ids;\n var ids = [revisionIds[0], opts, []];\n\n for (var i = 1, len = revisionIds.length; i < len; i++) {\n ids = [revisionIds[i], {status: 'missing'}, [ids]];\n }\n\n return [{\n pos: pos,\n ids: ids\n }];\n}\n\n// Preprocess documents, parse their revisions, assign an id and a\n// revision for new writes that are missing them, etc\nfunction parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = rev();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}\n\nvar thisAtob = function (str) {\n return atob(str);\n};\n\nvar thisBtoa = function (str) {\n return btoa(str);\n};\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor (e.g.\n// old QtWebKit versions, Android < 4.4).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== \"TypeError\") {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :\n typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :\n typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :\n WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction binaryStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\nfunction binStringToBluffer(binString, type) {\n return createBlob([binaryStringToArrayBuffer(binString)], {type: type});\n}\n\nfunction b64ToBluffer(b64, type) {\n return binStringToBluffer(thisAtob(b64), type);\n}\n\n//Can't find original post, but this is close\n//http://stackoverflow.com/questions/6965107/ (continues on next line)\n//converting-between-strings-and-arraybuffers\nfunction arrayBufferToBinaryString(buffer) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var length = bytes.byteLength;\n for (var i = 0; i < length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return binary;\n}\n\n// shim for browsers that don't support it\nfunction readAsBinaryString(blob, callback) {\n if (typeof FileReader === 'undefined') {\n // fix for Firefox in a web worker\n // https://bugzilla.mozilla.org/show_bug.cgi?id=901097\n return callback(arrayBufferToBinaryString(\n new FileReaderSync().readAsArrayBuffer(blob)));\n }\n\n var reader = new FileReader();\n var hasBinaryString = typeof reader.readAsBinaryString === 'function';\n reader.onloadend = function (e) {\n var result = e.target.result || '';\n if (hasBinaryString) {\n return callback(result);\n }\n callback(arrayBufferToBinaryString(result));\n };\n if (hasBinaryString) {\n reader.readAsBinaryString(blob);\n } else {\n reader.readAsArrayBuffer(blob);\n }\n}\n\nfunction blobToBinaryString(blobOrBuffer, callback) {\n readAsBinaryString(blobOrBuffer, function (bin) {\n callback(bin);\n });\n}\n\nfunction blobToBase64(blobOrBuffer, callback) {\n blobToBinaryString(blobOrBuffer, function (base64) {\n callback(thisBtoa(base64));\n });\n}\n\n// simplified API. universal browser support is assumed\nfunction readAsArrayBuffer(blob, callback) {\n if (typeof FileReader === 'undefined') {\n // fix for Firefox in a web worker:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=901097\n return callback(new FileReaderSync().readAsArrayBuffer(blob));\n }\n\n var reader = new FileReader();\n reader.onloadend = function (e) {\n var result = e.target.result || new ArrayBuffer(0);\n callback(result);\n };\n reader.readAsArrayBuffer(blob);\n}\n\n// this is not used in the browser\n\nvar setImmediateShim = global.setImmediate || global.setTimeout;\nvar MD5_CHUNK_SIZE = 32768;\n\nfunction rawToBase64(raw) {\n return thisBtoa(raw);\n}\n\nfunction sliceBlob(blob, start, end) {\n if (blob.webkitSlice) {\n return blob.webkitSlice(start, end);\n }\n return blob.slice(start, end);\n}\n\nfunction appendBlob(buffer, blob, start, end, callback) {\n if (start > 0 || end < blob.size) {\n // only slice blob if we really need to\n blob = sliceBlob(blob, start, end);\n }\n readAsArrayBuffer(blob, function (arrayBuffer) {\n buffer.append(arrayBuffer);\n callback();\n });\n}\n\nfunction appendString(buffer, string, start, end, callback) {\n if (start > 0 || end < string.length) {\n // only create a substring if we really need to\n string = string.substring(start, end);\n }\n buffer.appendBinary(string);\n callback();\n}\n\nfunction binaryMd5(data, callback) {\n var inputIsString = typeof data === 'string';\n var len = inputIsString ? data.length : data.size;\n var chunkSize = Math.min(MD5_CHUNK_SIZE, len);\n var chunks = Math.ceil(len / chunkSize);\n var currentChunk = 0;\n var buffer = inputIsString ? new Md5() : new Md5.ArrayBuffer();\n\n var append = inputIsString ? appendString : appendBlob;\n\n function next() {\n setImmediateShim(loadNextChunk);\n }\n\n function done() {\n var raw = buffer.end(true);\n var base64 = rawToBase64(raw);\n callback(base64);\n buffer.destroy();\n }\n\n function loadNextChunk() {\n var start = currentChunk * chunkSize;\n var end = start + chunkSize;\n currentChunk++;\n if (currentChunk < chunks) {\n append(buffer, data, start, end, next);\n } else {\n append(buffer, data, start, end, done);\n }\n }\n loadNextChunk();\n}\n\nfunction stringMd5(string) {\n return Md5.hash(string);\n}\n\nfunction parseBase64(data) {\n try {\n return thisAtob(data);\n } catch (e) {\n var err = createError(BAD_ARG,\n 'Attachment is not a valid base64 string');\n return {error: err};\n }\n}\n\nfunction preprocessString(att, blobType, callback) {\n var asBinary = parseBase64(att.data);\n if (asBinary.error) {\n return callback(asBinary.error);\n }\n\n att.length = asBinary.length;\n if (blobType === 'blob') {\n att.data = binStringToBluffer(asBinary, att.content_type);\n } else if (blobType === 'base64') {\n att.data = thisBtoa(asBinary);\n } else { // binary\n att.data = asBinary;\n }\n binaryMd5(asBinary, function (result) {\n att.digest = 'md5-' + result;\n callback();\n });\n}\n\nfunction preprocessBlob(att, blobType, callback) {\n binaryMd5(att.data, function (md5) {\n att.digest = 'md5-' + md5;\n // size is for blobs (browser), length is for buffers (node)\n att.length = att.data.size || att.data.length || 0;\n if (blobType === 'binary') {\n blobToBinaryString(att.data, function (binString) {\n att.data = binString;\n callback();\n });\n } else if (blobType === 'base64') {\n blobToBase64(att.data, function (b64) {\n att.data = b64;\n callback();\n });\n } else {\n callback();\n }\n });\n}\n\nfunction preprocessAttachment(att, blobType, callback) {\n if (att.stub) {\n return callback();\n }\n if (typeof att.data === 'string') { // input is a base64 string\n preprocessString(att, blobType, callback);\n } else { // input is a blob\n preprocessBlob(att, blobType, callback);\n }\n}\n\nfunction preprocessAttachments(docInfos, blobType, callback) {\n\n if (!docInfos.length) {\n return callback();\n }\n\n var docv = 0;\n var overallErr;\n\n docInfos.forEach(function (docInfo) {\n var attachments = docInfo.data && docInfo.data._attachments ?\n Object.keys(docInfo.data._attachments) : [];\n var recv = 0;\n\n if (!attachments.length) {\n return done();\n }\n\n function processedAttachment(err) {\n overallErr = err;\n recv++;\n if (recv === attachments.length) {\n done();\n }\n }\n\n for (var key in docInfo.data._attachments) {\n if (docInfo.data._attachments.hasOwnProperty(key)) {\n preprocessAttachment(docInfo.data._attachments[key],\n blobType, processedAttachment);\n }\n }\n });\n\n function done() {\n docv++;\n if (docInfos.length === docv) {\n if (overallErr) {\n callback(overallErr);\n } else {\n callback();\n }\n }\n }\n}\n\nfunction updateDoc(revLimit, prev, docInfo, results,\n i, cb, writeDoc, newEdits) {\n\n if (revExists(prev.rev_tree, docInfo.metadata.rev)) {\n results[i] = docInfo;\n return cb();\n }\n\n // sometimes this is pre-calculated. historically not always\n var previousWinningRev = prev.winningRev || winningRev(prev);\n var previouslyDeleted = 'deleted' in prev ? prev.deleted :\n isDeleted(prev, previousWinningRev);\n var deleted = 'deleted' in docInfo.metadata ? docInfo.metadata.deleted :\n isDeleted(docInfo.metadata);\n var isRoot = /^1-/.test(docInfo.metadata.rev);\n\n if (previouslyDeleted && !deleted && newEdits && isRoot) {\n var newDoc = docInfo.data;\n newDoc._rev = previousWinningRev;\n newDoc._id = docInfo.metadata.id;\n docInfo = parseDoc(newDoc, newEdits);\n }\n\n var merged = merge(prev.rev_tree, docInfo.metadata.rev_tree[0], revLimit);\n\n var inConflict = newEdits && ((\n (previouslyDeleted && deleted && merged.conflicts !== 'new_leaf') ||\n (!previouslyDeleted && merged.conflicts !== 'new_leaf') ||\n (previouslyDeleted && !deleted && merged.conflicts === 'new_branch')));\n\n if (inConflict) {\n var err = createError(REV_CONFLICT);\n results[i] = err;\n return cb();\n }\n\n var newRev = docInfo.metadata.rev;\n docInfo.metadata.rev_tree = merged.tree;\n docInfo.stemmedRevs = merged.stemmedRevs || [];\n /* istanbul ignore else */\n if (prev.rev_map) {\n docInfo.metadata.rev_map = prev.rev_map; // used only by leveldb\n }\n\n // recalculate\n var winningRev$$1 = winningRev(docInfo.metadata);\n var winningRevIsDeleted = isDeleted(docInfo.metadata, winningRev$$1);\n\n // calculate the total number of documents that were added/removed,\n // from the perspective of total_rows/doc_count\n var delta = (previouslyDeleted === winningRevIsDeleted) ? 0 :\n previouslyDeleted < winningRevIsDeleted ? -1 : 1;\n\n var newRevIsDeleted;\n if (newRev === winningRev$$1) {\n // if the new rev is the same as the winning rev, we can reuse that value\n newRevIsDeleted = winningRevIsDeleted;\n } else {\n // if they're not the same, then we need to recalculate\n newRevIsDeleted = isDeleted(docInfo.metadata, newRev);\n }\n\n writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted,\n true, delta, i, cb);\n}\n\nfunction rootIsMissing(docInfo) {\n return docInfo.metadata.rev_tree[0].ids[1].status === 'missing';\n}\n\nfunction processDocs(revLimit, docInfos, api, fetchedDocs, tx, results,\n writeDoc, opts, overallCallback) {\n\n // Default to 1000 locally\n revLimit = revLimit || 1000;\n\n function insertDoc(docInfo, resultsIdx, callback) {\n // Cant insert new deleted documents\n var winningRev$$1 = winningRev(docInfo.metadata);\n var deleted = isDeleted(docInfo.metadata, winningRev$$1);\n if ('was_delete' in opts && deleted) {\n results[resultsIdx] = createError(MISSING_DOC, 'deleted');\n return callback();\n }\n\n // 4712 - detect whether a new document was inserted with a _rev\n var inConflict = newEdits && rootIsMissing(docInfo);\n\n if (inConflict) {\n var err = createError(REV_CONFLICT);\n results[resultsIdx] = err;\n return callback();\n }\n\n var delta = deleted ? 0 : 1;\n\n writeDoc(docInfo, winningRev$$1, deleted, deleted, false,\n delta, resultsIdx, callback);\n }\n\n var newEdits = opts.new_edits;\n var idsToDocs = new ExportedMap();\n\n var docsDone = 0;\n var docsToDo = docInfos.length;\n\n function checkAllDocsDone() {\n if (++docsDone === docsToDo && overallCallback) {\n overallCallback();\n }\n }\n\n docInfos.forEach(function (currentDoc, resultsIdx) {\n\n if (currentDoc._id && isLocalId(currentDoc._id)) {\n var fun = currentDoc._deleted ? '_removeLocal' : '_putLocal';\n api[fun](currentDoc, {ctx: tx}, function (err, res) {\n results[resultsIdx] = err || res;\n checkAllDocsDone();\n });\n return;\n }\n\n var id = currentDoc.metadata.id;\n if (idsToDocs.has(id)) {\n docsToDo--; // duplicate\n idsToDocs.get(id).push([currentDoc, resultsIdx]);\n } else {\n idsToDocs.set(id, [[currentDoc, resultsIdx]]);\n }\n });\n\n // in the case of new_edits, the user can provide multiple docs\n // with the same id. these need to be processed sequentially\n idsToDocs.forEach(function (docs, id) {\n var numDone = 0;\n\n function docWritten() {\n if (++numDone < docs.length) {\n nextDoc();\n } else {\n checkAllDocsDone();\n }\n }\n function nextDoc() {\n var value = docs[numDone];\n var currentDoc = value[0];\n var resultsIdx = value[1];\n\n if (fetchedDocs.has(id)) {\n updateDoc(revLimit, fetchedDocs.get(id), currentDoc, results,\n resultsIdx, docWritten, writeDoc, newEdits);\n } else {\n // Ensure stemming applies to new writes as well\n var merged = merge([], currentDoc.metadata.rev_tree[0], revLimit);\n currentDoc.metadata.rev_tree = merged.tree;\n currentDoc.stemmedRevs = merged.stemmedRevs || [];\n insertDoc(currentDoc, resultsIdx, docWritten);\n }\n }\n nextDoc();\n });\n}\n\n// IndexedDB requires a versioned database structure, so we use the\n// version here to manage migrations.\nvar ADAPTER_VERSION = 5;\n\n// The object stores created for each database\n// DOC_STORE stores the document meta data, its revision history and state\n// Keyed by document id\nvar DOC_STORE = 'document-store';\n// BY_SEQ_STORE stores a particular version of a document, keyed by its\n// sequence id\nvar BY_SEQ_STORE = 'by-sequence';\n// Where we store attachments\nvar ATTACH_STORE = 'attach-store';\n// Where we store many-to-many relations\n// between attachment digests and seqs\nvar ATTACH_AND_SEQ_STORE = 'attach-seq-store';\n\n// Where we store database-wide meta data in a single record\n// keyed by id: META_STORE\nvar META_STORE = 'meta-store';\n// Where we store local documents\nvar LOCAL_STORE = 'local-store';\n// Where we detect blob support\nvar DETECT_BLOB_SUPPORT_STORE = 'detect-blob-support';\n\nfunction safeJsonParse(str) {\n // This try/catch guards against stack overflow errors.\n // JSON.parse() is faster than vuvuzela.parse() but vuvuzela\n // cannot overflow.\n try {\n return JSON.parse(str);\n } catch (e) {\n /* istanbul ignore next */\n return vuvuzela.parse(str);\n }\n}\n\nfunction safeJsonStringify(json) {\n try {\n return JSON.stringify(json);\n } catch (e) {\n /* istanbul ignore next */\n return vuvuzela.stringify(json);\n }\n}\n\nfunction idbError(callback) {\n return function (evt) {\n var message = 'unknown_error';\n if (evt.target && evt.target.error) {\n message = evt.target.error.name || evt.target.error.message;\n }\n callback(createError(IDB_ERROR, message, evt.type));\n };\n}\n\n// Unfortunately, the metadata has to be stringified\n// when it is put into the database, because otherwise\n// IndexedDB can throw errors for deeply-nested objects.\n// Originally we just used JSON.parse/JSON.stringify; now\n// we use this custom vuvuzela library that avoids recursion.\n// If we could do it all over again, we'd probably use a\n// format for the revision trees other than JSON.\nfunction encodeMetadata(metadata, winningRev, deleted) {\n return {\n data: safeJsonStringify(metadata),\n winningRev: winningRev,\n deletedOrLocal: deleted ? '1' : '0',\n seq: metadata.seq, // highest seq for this doc\n id: metadata.id\n };\n}\n\nfunction decodeMetadata(storedObject) {\n if (!storedObject) {\n return null;\n }\n var metadata = safeJsonParse(storedObject.data);\n metadata.winningRev = storedObject.winningRev;\n metadata.deleted = storedObject.deletedOrLocal === '1';\n metadata.seq = storedObject.seq;\n return metadata;\n}\n\n// read the doc back out from the database. we don't store the\n// _id or _rev because we already have _doc_id_rev.\nfunction decodeDoc(doc) {\n if (!doc) {\n return doc;\n }\n var idx = doc._doc_id_rev.lastIndexOf(':');\n doc._id = doc._doc_id_rev.substring(0, idx - 1);\n doc._rev = doc._doc_id_rev.substring(idx + 1);\n delete doc._doc_id_rev;\n return doc;\n}\n\n// Read a blob from the database, encoding as necessary\n// and translating from base64 if the IDB doesn't support\n// native Blobs\nfunction readBlobData(body, type, asBlob, callback) {\n if (asBlob) {\n if (!body) {\n callback(createBlob([''], {type: type}));\n } else if (typeof body !== 'string') { // we have blob support\n callback(body);\n } else { // no blob support\n callback(b64ToBluffer(body, type));\n }\n } else { // as base64 string\n if (!body) {\n callback('');\n } else if (typeof body !== 'string') { // we have blob support\n readAsBinaryString(body, function (binary) {\n callback(thisBtoa(binary));\n });\n } else { // no blob support\n callback(body);\n }\n }\n}\n\nfunction fetchAttachmentsIfNecessary(doc, opts, txn, cb) {\n var attachments = Object.keys(doc._attachments || {});\n if (!attachments.length) {\n return cb && cb();\n }\n var numDone = 0;\n\n function checkDone() {\n if (++numDone === attachments.length && cb) {\n cb();\n }\n }\n\n function fetchAttachment(doc, att) {\n var attObj = doc._attachments[att];\n var digest = attObj.digest;\n var req = txn.objectStore(ATTACH_STORE).get(digest);\n req.onsuccess = function (e) {\n attObj.body = e.target.result.body;\n checkDone();\n };\n }\n\n attachments.forEach(function (att) {\n if (opts.attachments && opts.include_docs) {\n fetchAttachment(doc, att);\n } else {\n doc._attachments[att].stub = true;\n checkDone();\n }\n });\n}\n\n// IDB-specific postprocessing necessary because\n// we don't know whether we stored a true Blob or\n// a base64-encoded string, and if it's a Blob it\n// needs to be read outside of the transaction context\nfunction postProcessAttachments(results, asBlob) {\n return PouchPromise.all(results.map(function (row) {\n if (row.doc && row.doc._attachments) {\n var attNames = Object.keys(row.doc._attachments);\n return PouchPromise.all(attNames.map(function (att) {\n var attObj = row.doc._attachments[att];\n if (!('body' in attObj)) { // already processed\n return;\n }\n var body = attObj.body;\n var type = attObj.content_type;\n return new PouchPromise(function (resolve) {\n readBlobData(body, type, asBlob, function (data) {\n row.doc._attachments[att] = $inject_Object_assign(\n pick(attObj, ['digest', 'content_type']),\n {data: data}\n );\n resolve();\n });\n });\n }));\n }\n }));\n}\n\nfunction compactRevs(revs, docId, txn) {\n\n var possiblyOrphanedDigests = [];\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n var attStore = txn.objectStore(ATTACH_STORE);\n var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE);\n var count = revs.length;\n\n function checkDone() {\n count--;\n if (!count) { // done processing all revs\n deleteOrphanedAttachments();\n }\n }\n\n function deleteOrphanedAttachments() {\n if (!possiblyOrphanedDigests.length) {\n return;\n }\n possiblyOrphanedDigests.forEach(function (digest) {\n var countReq = attAndSeqStore.index('digestSeq').count(\n IDBKeyRange.bound(\n digest + '::', digest + '::\\uffff', false, false));\n countReq.onsuccess = function (e) {\n var count = e.target.result;\n if (!count) {\n // orphaned\n attStore[\"delete\"](digest);\n }\n };\n });\n }\n\n revs.forEach(function (rev$$1) {\n var index = seqStore.index('_doc_id_rev');\n var key = docId + \"::\" + rev$$1;\n index.getKey(key).onsuccess = function (e) {\n var seq = e.target.result;\n if (typeof seq !== 'number') {\n return checkDone();\n }\n seqStore[\"delete\"](seq);\n\n var cursor = attAndSeqStore.index('seq')\n .openCursor(IDBKeyRange.only(seq));\n\n cursor.onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n var digest = cursor.value.digestSeq.split('::')[0];\n possiblyOrphanedDigests.push(digest);\n attAndSeqStore[\"delete\"](cursor.primaryKey);\n cursor[\"continue\"]();\n } else { // done\n checkDone();\n }\n };\n };\n });\n}\n\nfunction openTransactionSafely(idb, stores, mode) {\n try {\n return {\n txn: idb.transaction(stores, mode)\n };\n } catch (err) {\n return {\n error: err\n };\n }\n}\n\nvar changesHandler$$1 = new Changes();\n\nfunction idbBulkDocs(dbOpts, req, opts, api, idb, callback) {\n var docInfos = req.docs;\n var txn;\n var docStore;\n var bySeqStore;\n var attachStore;\n var attachAndSeqStore;\n var metaStore;\n var docInfoError;\n var metaDoc;\n\n for (var i = 0, len = docInfos.length; i < len; i++) {\n var doc = docInfos[i];\n if (doc._id && isLocalId(doc._id)) {\n continue;\n }\n doc = docInfos[i] = parseDoc(doc, opts.new_edits);\n if (doc.error && !docInfoError) {\n docInfoError = doc;\n }\n }\n\n if (docInfoError) {\n return callback(docInfoError);\n }\n\n var allDocsProcessed = false;\n var docCountDelta = 0;\n var results = new Array(docInfos.length);\n var fetchedDocs = new ExportedMap();\n var preconditionErrored = false;\n var blobType = api._meta.blobSupport ? 'blob' : 'base64';\n\n preprocessAttachments(docInfos, blobType, function (err) {\n if (err) {\n return callback(err);\n }\n startTransaction();\n });\n\n function startTransaction() {\n\n var stores = [\n DOC_STORE, BY_SEQ_STORE,\n ATTACH_STORE,\n LOCAL_STORE, ATTACH_AND_SEQ_STORE,\n META_STORE\n ];\n var txnResult = openTransactionSafely(idb, stores, 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n txn = txnResult.txn;\n txn.onabort = idbError(callback);\n txn.ontimeout = idbError(callback);\n txn.oncomplete = complete;\n docStore = txn.objectStore(DOC_STORE);\n bySeqStore = txn.objectStore(BY_SEQ_STORE);\n attachStore = txn.objectStore(ATTACH_STORE);\n attachAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE);\n metaStore = txn.objectStore(META_STORE);\n\n metaStore.get(META_STORE).onsuccess = function (e) {\n metaDoc = e.target.result;\n updateDocCountIfReady();\n };\n\n verifyAttachments(function (err) {\n if (err) {\n preconditionErrored = true;\n return callback(err);\n }\n fetchExistingDocs();\n });\n }\n\n function onAllDocsProcessed() {\n allDocsProcessed = true;\n updateDocCountIfReady();\n }\n\n function idbProcessDocs() {\n processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs,\n txn, results, writeDoc, opts, onAllDocsProcessed);\n }\n\n function updateDocCountIfReady() {\n if (!metaDoc || !allDocsProcessed) {\n return;\n }\n // caching the docCount saves a lot of time in allDocs() and\n // info(), which is why we go to all the trouble of doing this\n metaDoc.docCount += docCountDelta;\n metaStore.put(metaDoc);\n }\n\n function fetchExistingDocs() {\n\n if (!docInfos.length) {\n return;\n }\n\n var numFetched = 0;\n\n function checkDone() {\n if (++numFetched === docInfos.length) {\n idbProcessDocs();\n }\n }\n\n function readMetadata(event) {\n var metadata = decodeMetadata(event.target.result);\n\n if (metadata) {\n fetchedDocs.set(metadata.id, metadata);\n }\n checkDone();\n }\n\n for (var i = 0, len = docInfos.length; i < len; i++) {\n var docInfo = docInfos[i];\n if (docInfo._id && isLocalId(docInfo._id)) {\n checkDone(); // skip local docs\n continue;\n }\n var req = docStore.get(docInfo.metadata.id);\n req.onsuccess = readMetadata;\n }\n }\n\n function complete() {\n if (preconditionErrored) {\n return;\n }\n\n changesHandler$$1.notify(api._meta.name);\n callback(null, results);\n }\n\n function verifyAttachment(digest, callback) {\n\n var req = attachStore.get(digest);\n req.onsuccess = function (e) {\n if (!e.target.result) {\n var err = createError(MISSING_STUB,\n 'unknown stub attachment with digest ' +\n digest);\n err.status = 412;\n callback(err);\n } else {\n callback();\n }\n };\n }\n\n function verifyAttachments(finish) {\n\n\n var digests = [];\n docInfos.forEach(function (docInfo) {\n if (docInfo.data && docInfo.data._attachments) {\n Object.keys(docInfo.data._attachments).forEach(function (filename) {\n var att = docInfo.data._attachments[filename];\n if (att.stub) {\n digests.push(att.digest);\n }\n });\n }\n });\n if (!digests.length) {\n return finish();\n }\n var numDone = 0;\n var err;\n\n function checkDone() {\n if (++numDone === digests.length) {\n finish(err);\n }\n }\n digests.forEach(function (digest) {\n verifyAttachment(digest, function (attErr) {\n if (attErr && !err) {\n err = attErr;\n }\n checkDone();\n });\n });\n }\n\n function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted,\n isUpdate, delta, resultsIdx, callback) {\n\n docInfo.metadata.winningRev = winningRev$$1;\n docInfo.metadata.deleted = winningRevIsDeleted;\n\n var doc = docInfo.data;\n doc._id = docInfo.metadata.id;\n doc._rev = docInfo.metadata.rev;\n\n if (newRevIsDeleted) {\n doc._deleted = true;\n }\n\n var hasAttachments = doc._attachments &&\n Object.keys(doc._attachments).length;\n if (hasAttachments) {\n return writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback);\n }\n\n docCountDelta += delta;\n updateDocCountIfReady();\n\n finishDoc(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback);\n }\n\n function finishDoc(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback) {\n\n var doc = docInfo.data;\n var metadata = docInfo.metadata;\n\n doc._doc_id_rev = metadata.id + '::' + metadata.rev;\n delete doc._id;\n delete doc._rev;\n\n function afterPutDoc(e) {\n var revsToDelete = docInfo.stemmedRevs || [];\n\n if (isUpdate && api.auto_compaction) {\n revsToDelete = revsToDelete.concat(compactTree(docInfo.metadata));\n }\n\n if (revsToDelete && revsToDelete.length) {\n compactRevs(revsToDelete, docInfo.metadata.id, txn);\n }\n\n metadata.seq = e.target.result;\n // Current _rev is calculated from _rev_tree on read\n // delete metadata.rev;\n var metadataToStore = encodeMetadata(metadata, winningRev$$1,\n winningRevIsDeleted);\n var metaDataReq = docStore.put(metadataToStore);\n metaDataReq.onsuccess = afterPutMetadata;\n }\n\n function afterPutDocError(e) {\n // ConstraintError, need to update, not put (see #1638 for details)\n e.preventDefault(); // avoid transaction abort\n e.stopPropagation(); // avoid transaction onerror\n var index = bySeqStore.index('_doc_id_rev');\n var getKeyReq = index.getKey(doc._doc_id_rev);\n getKeyReq.onsuccess = function (e) {\n var putReq = bySeqStore.put(doc, e.target.result);\n putReq.onsuccess = afterPutDoc;\n };\n }\n\n function afterPutMetadata() {\n results[resultsIdx] = {\n ok: true,\n id: metadata.id,\n rev: metadata.rev\n };\n fetchedDocs.set(docInfo.metadata.id, docInfo.metadata);\n insertAttachmentMappings(docInfo, metadata.seq, callback);\n }\n\n var putReq = bySeqStore.put(doc);\n\n putReq.onsuccess = afterPutDoc;\n putReq.onerror = afterPutDocError;\n }\n\n function writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback) {\n\n\n var doc = docInfo.data;\n\n var numDone = 0;\n var attachments = Object.keys(doc._attachments);\n\n function collectResults() {\n if (numDone === attachments.length) {\n finishDoc(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback);\n }\n }\n\n function attachmentSaved() {\n numDone++;\n collectResults();\n }\n\n attachments.forEach(function (key) {\n var att = docInfo.data._attachments[key];\n if (!att.stub) {\n var data = att.data;\n delete att.data;\n att.revpos = parseInt(winningRev$$1, 10);\n var digest = att.digest;\n saveAttachment(digest, data, attachmentSaved);\n } else {\n numDone++;\n collectResults();\n }\n });\n }\n\n // map seqs to attachment digests, which\n // we will need later during compaction\n function insertAttachmentMappings(docInfo, seq, callback) {\n\n var attsAdded = 0;\n var attsToAdd = Object.keys(docInfo.data._attachments || {});\n\n if (!attsToAdd.length) {\n return callback();\n }\n\n function checkDone() {\n if (++attsAdded === attsToAdd.length) {\n callback();\n }\n }\n\n function add(att) {\n var digest = docInfo.data._attachments[att].digest;\n var req = attachAndSeqStore.put({\n seq: seq,\n digestSeq: digest + '::' + seq\n });\n\n req.onsuccess = checkDone;\n req.onerror = function (e) {\n // this callback is for a constaint error, which we ignore\n // because this docid/rev has already been associated with\n // the digest (e.g. when new_edits == false)\n e.preventDefault(); // avoid transaction abort\n e.stopPropagation(); // avoid transaction onerror\n checkDone();\n };\n }\n for (var i = 0; i < attsToAdd.length; i++) {\n add(attsToAdd[i]); // do in parallel\n }\n }\n\n function saveAttachment(digest, data, callback) {\n\n\n var getKeyReq = attachStore.count(digest);\n getKeyReq.onsuccess = function (e) {\n var count = e.target.result;\n if (count) {\n return callback(); // already exists\n }\n var newAtt = {\n digest: digest,\n body: data\n };\n var putReq = attachStore.put(newAtt);\n putReq.onsuccess = callback;\n };\n }\n}\n\n// Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations\n// while falling back to a normal IDBCursor operation on browsers that don't support getAll() or\n// getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because\n// we're not processing each document one-at-a-time.\nfunction runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited,\n // not really clear the user wants a batched approach where the entire DB is read into memory,\n // perhaps they are filtering on a per-doc basis)\n // 3) descending no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n}\n\n// simple shim for objectStore.getAll(), falling back to IDBCursor\nfunction getAll(objectStore, keyRange, onSuccess) {\n if (typeof objectStore.getAll === 'function') {\n // use native getAll\n objectStore.getAll(keyRange).onsuccess = onSuccess;\n return;\n }\n // fall back to cursors\n var values = [];\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (cursor) {\n values.push(cursor.value);\n cursor[\"continue\"]();\n } else {\n onSuccess({\n target: {\n result: values\n }\n });\n }\n }\n\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n}\n\nfunction allDocsKeys(keys, docStore, onBatch) {\n // It's not guaranted to be returned in right order \n var valuesBatch = [];\n var count = 0;\n keys.forEach(function (key, index) {\n docStore.get(key).onsuccess = function (event) {\n if (event.target.result) {\n valuesBatch[index] = event.target.result;\n } else {\n valuesBatch[index] = {key: key, error: 'not_found'};\n }\n count++;\n if (count === keys.length) {\n onBatch(keys, valuesBatch, {});\n }\n };\n });\n}\n\nfunction createKeyRange(start, end, inclusiveEnd, key, descending) {\n try {\n if (start && end) {\n if (descending) {\n return IDBKeyRange.bound(end, start, !inclusiveEnd, false);\n } else {\n return IDBKeyRange.bound(start, end, false, !inclusiveEnd);\n }\n } else if (start) {\n if (descending) {\n return IDBKeyRange.upperBound(start);\n } else {\n return IDBKeyRange.lowerBound(start);\n }\n } else if (end) {\n if (descending) {\n return IDBKeyRange.lowerBound(end, !inclusiveEnd);\n } else {\n return IDBKeyRange.upperBound(end, !inclusiveEnd);\n }\n } else if (key) {\n return IDBKeyRange.only(key);\n }\n } catch (e) {\n return {error: e};\n }\n return null;\n}\n\nfunction idbAllDocs(opts, idb, callback) {\n var start = 'startkey' in opts ? opts.startkey : false;\n var end = 'endkey' in opts ? opts.endkey : false;\n var key = 'key' in opts ? opts.key : false;\n var keys = 'keys' in opts ? opts.keys : false; \n var skip = opts.skip || 0;\n var limit = typeof opts.limit === 'number' ? opts.limit : -1;\n var inclusiveEnd = opts.inclusive_end !== false;\n\n var keyRange; \n var keyRangeError;\n if (!keys) {\n keyRange = createKeyRange(start, end, inclusiveEnd, key, opts.descending);\n keyRangeError = keyRange && keyRange.error;\n if (keyRangeError && \n !(keyRangeError.name === \"DataError\" && keyRangeError.code === 0)) {\n // DataError with error code 0 indicates start is less than end, so\n // can just do an empty query. Else need to throw\n return callback(createError(IDB_ERROR,\n keyRangeError.name, keyRangeError.message));\n }\n }\n\n var stores = [DOC_STORE, BY_SEQ_STORE, META_STORE];\n\n if (opts.attachments) {\n stores.push(ATTACH_STORE);\n }\n var txnResult = openTransactionSafely(idb, stores, 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n txn.oncomplete = onTxnComplete;\n txn.onabort = idbError(callback);\n var docStore = txn.objectStore(DOC_STORE);\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n var metaStore = txn.objectStore(META_STORE);\n var docIdRevIndex = seqStore.index('_doc_id_rev');\n var results = [];\n var docCount;\n var updateSeq;\n\n metaStore.get(META_STORE).onsuccess = function (e) {\n docCount = e.target.result.docCount;\n };\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n getMaxUpdateSeq(seqStore, function (e) { \n if (e.target.result && e.target.result.length > 0) {\n updateSeq = e.target.result[0];\n }\n });\n }\n\n function getMaxUpdateSeq(objectStore, onSuccess) {\n function onCursor(e) {\n var cursor = e.target.result;\n var maxKey = undefined;\n if (cursor && cursor.key) {\n maxKey = cursor.key;\n } \n return onSuccess({\n target: {\n result: [maxKey]\n }\n });\n }\n objectStore.openCursor(null, 'prev').onsuccess = onCursor;\n }\n\n // if the user specifies include_docs=true, then we don't\n // want to block the main cursor while we're fetching the doc\n function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }\n\n function allDocsInner(winningRev$$1, metadata) {\n var row = {\n id: metadata.id,\n key: metadata.id,\n value: {\n rev: winningRev$$1\n }\n };\n var deleted = metadata.deleted;\n if (deleted) {\n if (keys) {\n results.push(row);\n // deleted docs are okay with \"keys\" requests\n row.value.deleted = true;\n row.doc = null;\n }\n } else if (skip-- <= 0) {\n results.push(row);\n if (opts.include_docs) {\n fetchDocAsynchronously(metadata, row, winningRev$$1);\n }\n }\n }\n\n function processBatch(batchValues) {\n for (var i = 0, len = batchValues.length; i < len; i++) {\n if (results.length === limit) {\n break;\n }\n var batchValue = batchValues[i];\n if (batchValue.error && keys) {\n // key was not found with \"keys\" requests\n results.push(batchValue);\n continue;\n }\n var metadata = decodeMetadata(batchValue);\n var winningRev$$1 = metadata.winningRev;\n allDocsInner(winningRev$$1, metadata);\n }\n }\n\n function onBatch(batchKeys, batchValues, cursor) {\n if (!cursor) {\n return;\n }\n processBatch(batchValues);\n if (results.length < limit) {\n cursor[\"continue\"]();\n }\n }\n\n function onGetAll(e) {\n var values = e.target.result;\n if (opts.descending) {\n values = values.reverse();\n }\n processBatch(values);\n }\n\n function onResultsReady() {\n var returnVal = {\n total_rows: docCount,\n offset: opts.skip,\n rows: results\n };\n \n /* istanbul ignore if */\n if (opts.update_seq && updateSeq !== undefined) {\n returnVal.update_seq = updateSeq;\n }\n callback(null, returnVal);\n }\n\n function onTxnComplete() {\n if (opts.attachments) {\n postProcessAttachments(results, opts.binary).then(onResultsReady);\n } else {\n onResultsReady();\n }\n }\n\n // don't bother doing any requests if start > end or limit === 0\n if (keyRangeError || limit === 0) {\n return;\n }\n if (keys) {\n return allDocsKeys(opts.keys, docStore, onBatch);\n }\n if (limit === -1) { // just fetch everything\n return getAll(docStore, keyRange, onGetAll);\n }\n // else do a cursor\n // choose a batch size based on the skip, since we'll need to skip that many\n runBatchedCursor(docStore, keyRange, opts.descending, limit + skip, onBatch);\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\nfunction checkBlobSupport(txn) {\n return new PouchPromise(function (resolve) {\n var blob$$1 = createBlob(['']);\n var req = txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob$$1, 'key');\n\n req.onsuccess = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome ||\n parseInt(matchedChrome[1], 10) >= 43);\n };\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction countDocs(txn, cb) {\n var index = txn.objectStore(DOC_STORE).index('deletedOrLocal');\n index.count(IDBKeyRange.only('0')).onsuccess = function (e) {\n cb(e.target.result);\n };\n}\n\n// This task queue ensures that IDB open calls are done in their own tick\n// and sequentially - i.e. we wait for the async IDB open to *fully* complete\n// before calling the next one. This works around IE/Edge race conditions in IDB.\n\nvar running = false;\nvar queue = [];\n\nfunction tryCode(fun, err, res, PouchDB) {\n try {\n fun(err, res);\n } catch (err) {\n // Shouldn't happen, but in some odd cases\n // IndexedDB implementations might throw a sync\n // error, in which case this will at least log it.\n PouchDB.emit('error', err);\n }\n}\n\nfunction applyNext() {\n if (running || !queue.length) {\n return;\n }\n running = true;\n queue.shift()();\n}\n\nfunction enqueueTask(action, callback, PouchDB) {\n queue.push(function runAction() {\n action(function runCallback(err, res) {\n tryCode(callback, err, res, PouchDB);\n running = false;\n nextTick(function runNext() {\n applyNext(PouchDB);\n });\n });\n });\n applyNext();\n}\n\nfunction changes(opts, api, dbName, idb) {\n opts = clone(opts);\n\n if (opts.continuous) {\n var id = dbName + ':' + uuid();\n changesHandler$$1.addListener(dbName, id, api, opts);\n changesHandler$$1.notify(dbName);\n return {\n cancel: function () {\n changesHandler$$1.removeListener(dbName, id);\n }\n };\n }\n\n var docIds = opts.doc_ids && new ExportedSet(opts.doc_ids);\n\n opts.since = opts.since || 0;\n var lastSeq = opts.since;\n\n var limit = 'limit' in opts ? opts.limit : -1;\n if (limit === 0) {\n limit = 1; // per CouchDB _changes spec\n }\n var returnDocs;\n if ('return_docs' in opts) {\n returnDocs = opts.return_docs;\n } else if ('returnDocs' in opts) {\n // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release\n returnDocs = opts.returnDocs;\n } else {\n returnDocs = true;\n }\n\n var results = [];\n var numResults = 0;\n var filter = filterChange(opts);\n var docIdsToMetadata = new ExportedMap();\n\n var txn;\n var bySeqStore;\n var docStore;\n var docIdRevIndex;\n\n function onBatch(batchKeys, batchValues, cursor) {\n if (!cursor || !batchKeys.length) { // done\n return;\n }\n\n var winningDocs = new Array(batchKeys.length);\n var metadatas = new Array(batchKeys.length);\n\n function processMetadataAndWinningDoc(metadata, winningDoc) {\n var change = opts.processChange(winningDoc, metadata, opts);\n lastSeq = change.seq = metadata.seq;\n\n var filtered = filter(change);\n if (typeof filtered === 'object') { // anything but true/false indicates error\n return opts.complete(filtered);\n }\n\n if (filtered) {\n numResults++;\n if (returnDocs) {\n results.push(change);\n }\n // process the attachment immediately\n // for the benefit of live listeners\n if (opts.attachments && opts.include_docs) {\n fetchAttachmentsIfNecessary(winningDoc, opts, txn, function () {\n postProcessAttachments([change], opts.binary).then(function () {\n opts.onChange(change);\n });\n });\n } else {\n opts.onChange(change);\n }\n }\n }\n\n function onBatchDone() {\n for (var i = 0, len = winningDocs.length; i < len; i++) {\n if (numResults === limit) {\n break;\n }\n var winningDoc = winningDocs[i];\n if (!winningDoc) {\n continue;\n }\n var metadata = metadatas[i];\n processMetadataAndWinningDoc(metadata, winningDoc);\n }\n\n if (numResults !== limit) {\n cursor[\"continue\"]();\n }\n }\n\n // Fetch all metadatas/winningdocs from this batch in parallel, then process\n // them all only once all data has been collected. This is done in parallel\n // because it's faster than doing it one-at-a-time.\n var numDone = 0;\n batchValues.forEach(function (value, i) {\n var doc = decodeDoc(value);\n var seq = batchKeys[i];\n fetchWinningDocAndMetadata(doc, seq, function (metadata, winningDoc) {\n metadatas[i] = metadata;\n winningDocs[i] = winningDoc;\n if (++numDone === batchKeys.length) {\n onBatchDone();\n }\n });\n });\n }\n\n function onGetMetadata(doc, seq, metadata, cb) {\n if (metadata.seq !== seq) {\n // some other seq is later\n return cb();\n }\n\n if (metadata.winningRev === doc._rev) {\n // this is the winning doc\n return cb(metadata, doc);\n }\n\n // fetch winning doc in separate request\n var docIdRev = doc._id + '::' + metadata.winningRev;\n var req = docIdRevIndex.get(docIdRev);\n req.onsuccess = function (e) {\n cb(metadata, decodeDoc(e.target.result));\n };\n }\n\n function fetchWinningDocAndMetadata(doc, seq, cb) {\n if (docIds && !docIds.has(doc._id)) {\n return cb();\n }\n\n var metadata = docIdsToMetadata.get(doc._id);\n if (metadata) { // cached\n return onGetMetadata(doc, seq, metadata, cb);\n }\n // metadata not cached, have to go fetch it\n docStore.get(doc._id).onsuccess = function (e) {\n metadata = decodeMetadata(e.target.result);\n docIdsToMetadata.set(doc._id, metadata);\n onGetMetadata(doc, seq, metadata, cb);\n };\n }\n\n function finish() {\n opts.complete(null, {\n results: results,\n last_seq: lastSeq\n });\n }\n\n function onTxnComplete() {\n if (!opts.continuous && opts.attachments) {\n // cannot guarantee that postProcessing was already done,\n // so do it again\n postProcessAttachments(results).then(finish);\n } else {\n finish();\n }\n }\n\n var objectStores = [DOC_STORE, BY_SEQ_STORE];\n if (opts.attachments) {\n objectStores.push(ATTACH_STORE);\n }\n var txnResult = openTransactionSafely(idb, objectStores, 'readonly');\n if (txnResult.error) {\n return opts.complete(txnResult.error);\n }\n txn = txnResult.txn;\n txn.onabort = idbError(opts.complete);\n txn.oncomplete = onTxnComplete;\n\n bySeqStore = txn.objectStore(BY_SEQ_STORE);\n docStore = txn.objectStore(DOC_STORE);\n docIdRevIndex = bySeqStore.index('_doc_id_rev');\n\n var keyRange = (opts.since && !opts.descending) ?\n IDBKeyRange.lowerBound(opts.since, true) : null;\n\n runBatchedCursor(bySeqStore, keyRange, opts.descending, limit, onBatch);\n}\n\nvar cachedDBs = new ExportedMap();\nvar blobSupportPromise;\nvar openReqList = new ExportedMap();\n\nfunction IdbPouch(opts, callback) {\n var api = this;\n\n enqueueTask(function (thisCallback) {\n init(api, opts, thisCallback);\n }, callback, api.constructor);\n}\n\nfunction init(api, opts, callback) {\n\n var dbName = opts.name;\n\n var idb = null;\n api._meta = null;\n\n // called when creating a fresh new database\n function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }\n\n // migration to version 2\n // unfortunately \"deletedOrLocal\" is a misnomer now that we no longer\n // store local docs in the main doc-store, but whaddyagonnado\n function addDeletedOrLocalIndex(txn, callback) {\n var docStore = txn.objectStore(DOC_STORE);\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n docStore.openCursor().onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n var metadata = cursor.value;\n var deleted = isDeleted(metadata);\n metadata.deletedOrLocal = deleted ? \"1\" : \"0\";\n docStore.put(metadata);\n cursor[\"continue\"]();\n } else {\n callback();\n }\n };\n }\n\n // migration to version 3 (part 1)\n function createLocalStoreSchema(db) {\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n }\n\n // migration to version 3 (part 2)\n function migrateLocalStore(txn, cb) {\n var localStore = txn.objectStore(LOCAL_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n var metadata = cursor.value;\n var docId = metadata.id;\n var local = isLocalId(docId);\n var rev$$1 = winningRev(metadata);\n if (local) {\n var docIdRev = docId + \"::\" + rev$$1;\n // remove all seq entries\n // associated with this docId\n var start = docId + \"::\";\n var end = docId + \"::~\";\n var index = seqStore.index('_doc_id_rev');\n var range = IDBKeyRange.bound(start, end, false, false);\n var seqCursor = index.openCursor(range);\n seqCursor.onsuccess = function (e) {\n seqCursor = e.target.result;\n if (!seqCursor) {\n // done\n docStore[\"delete\"](cursor.primaryKey);\n cursor[\"continue\"]();\n } else {\n var data = seqCursor.value;\n if (data._doc_id_rev === docIdRev) {\n localStore.put(data);\n }\n seqStore[\"delete\"](seqCursor.primaryKey);\n seqCursor[\"continue\"]();\n }\n };\n } else {\n cursor[\"continue\"]();\n }\n } else if (cb) {\n cb();\n }\n };\n }\n\n // migration to version 4 (part 1)\n function addAttachAndSeqStore(db) {\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }\n\n // migration to version 4 (part 2)\n function migrateAttsAndSeqs(txn, callback) {\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n var attStore = txn.objectStore(ATTACH_STORE);\n var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE);\n\n // need to actually populate the table. this is the expensive part,\n // so as an optimization, check first that this database even\n // contains attachments\n var req = attStore.count();\n req.onsuccess = function (e) {\n var count = e.target.result;\n if (!count) {\n return callback(); // done\n }\n\n seqStore.openCursor().onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return callback(); // done\n }\n var doc = cursor.value;\n var seq = cursor.primaryKey;\n var atts = Object.keys(doc._attachments || {});\n var digestMap = {};\n for (var j = 0; j < atts.length; j++) {\n var att = doc._attachments[atts[j]];\n digestMap[att.digest] = true; // uniq digests, just in case\n }\n var digests = Object.keys(digestMap);\n for (j = 0; j < digests.length; j++) {\n var digest = digests[j];\n attAndSeqStore.put({\n seq: seq,\n digestSeq: digest + '::' + seq\n });\n }\n cursor[\"continue\"]();\n };\n };\n }\n\n // migration to version 5\n // Instead of relying on on-the-fly migration of metadata,\n // this brings the doc-store to its modern form:\n // - metadata.winningrev\n // - metadata.seq\n // - stringify the metadata when storing it\n function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev ||\n winningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor[\"continue\"]();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor[\"continue\"]();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }\n\n api._remote = false;\n api.type = function () {\n return 'idb';\n };\n\n api._id = toPromise(function (callback) {\n callback(null, api._meta.instanceId);\n });\n\n api._bulkDocs = function idb_bulkDocs(req, reqOpts, callback) {\n idbBulkDocs(opts, req, reqOpts, api, idb, callback);\n };\n\n // First we look up the metadata in the ids database, then we fetch the\n // current revision(s) from the by sequence store\n api._get = function idb_get(id, opts, callback) {\n var doc;\n var metadata;\n var err;\n var txn = opts.ctx;\n if (!txn) {\n var txnResult = openTransactionSafely(idb,\n [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n txn = txnResult.txn;\n }\n\n function finish() {\n callback(err, {doc: doc, metadata: metadata, ctx: txn});\n }\n\n txn.objectStore(DOC_STORE).get(id).onsuccess = function (e) {\n metadata = decodeMetadata(e.target.result);\n // we can determine the result here if:\n // 1. there is no such document\n // 2. the document is deleted and we don't ask about specific rev\n // When we ask with opts.rev we expect the answer to be either\n // doc (possibly with _deleted=true) or missing error\n if (!metadata) {\n err = createError(MISSING_DOC, 'missing');\n return finish();\n }\n\n var rev$$1;\n if (!opts.rev) {\n rev$$1 = metadata.winningRev;\n var deleted = isDeleted(metadata);\n if (deleted) {\n err = createError(MISSING_DOC, \"deleted\");\n return finish();\n }\n } else {\n rev$$1 = opts.latest ? latest(opts.rev, metadata) : opts.rev;\n }\n\n var objectStore = txn.objectStore(BY_SEQ_STORE);\n var key = metadata.id + '::' + rev$$1;\n\n objectStore.index('_doc_id_rev').get(key).onsuccess = function (e) {\n doc = e.target.result;\n if (doc) {\n doc = decodeDoc(doc);\n }\n if (!doc) {\n err = createError(MISSING_DOC, 'missing');\n return finish();\n }\n finish();\n };\n };\n };\n\n api._getAttachment = function (docId, attachId, attachment, opts, callback) {\n var txn;\n if (opts.ctx) {\n txn = opts.ctx;\n } else {\n var txnResult = openTransactionSafely(idb,\n [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n txn = txnResult.txn;\n }\n var digest = attachment.digest;\n var type = attachment.content_type;\n\n txn.objectStore(ATTACH_STORE).get(digest).onsuccess = function (e) {\n var body = e.target.result.body;\n readBlobData(body, type, opts.binary, function (blobData) {\n callback(null, blobData);\n });\n };\n };\n\n api._info = function idb_info(callback) {\n var updateSeq;\n var docCount;\n\n var txnResult = openTransactionSafely(idb, [META_STORE, BY_SEQ_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) {\n docCount = e.target.result.docCount;\n };\n txn.objectStore(BY_SEQ_STORE).openCursor(null, 'prev').onsuccess = function (e) {\n var cursor = e.target.result;\n updateSeq = cursor ? cursor.key : 0;\n };\n\n txn.oncomplete = function () {\n callback(null, {\n doc_count: docCount,\n update_seq: updateSeq,\n // for debugging\n idb_attachment_format: (api._meta.blobSupport ? 'binary' : 'base64')\n });\n };\n };\n\n api._allDocs = function idb_allDocs(opts, callback) {\n idbAllDocs(opts, idb, callback);\n };\n\n api._changes = function idbChanges(opts) {\n return changes(opts, api, dbName, idb);\n };\n\n api._close = function (callback) {\n // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close\n // \"Returns immediately and closes the connection in a separate thread...\"\n idb.close();\n cachedDBs[\"delete\"](dbName);\n callback();\n };\n\n api._getRevisionTree = function (docId, callback) {\n var txnResult = openTransactionSafely(idb, [DOC_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n var req = txn.objectStore(DOC_STORE).get(docId);\n req.onsuccess = function (event) {\n var doc = decodeMetadata(event.target.result);\n if (!doc) {\n callback(createError(MISSING_DOC));\n } else {\n callback(null, doc.rev_tree);\n }\n };\n };\n\n // This function removes revisions of document docId\n // which are listed in revs and sets this document\n // revision to to rev_tree\n api._doCompaction = function (docId, revs, callback) {\n var stores = [\n DOC_STORE,\n BY_SEQ_STORE,\n ATTACH_STORE,\n ATTACH_AND_SEQ_STORE\n ];\n var txnResult = openTransactionSafely(idb, stores, 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n\n var docStore = txn.objectStore(DOC_STORE);\n\n docStore.get(docId).onsuccess = function (event) {\n var metadata = decodeMetadata(event.target.result);\n traverseRevTree(metadata.rev_tree, function (isLeaf, pos,\n revHash, ctx, opts) {\n var rev$$1 = pos + '-' + revHash;\n if (revs.indexOf(rev$$1) !== -1) {\n opts.status = 'missing';\n }\n });\n compactRevs(revs, docId, txn);\n var winningRev$$1 = metadata.winningRev;\n var deleted = metadata.deleted;\n txn.objectStore(DOC_STORE).put(\n encodeMetadata(metadata, winningRev$$1, deleted));\n };\n txn.onabort = idbError(callback);\n txn.oncomplete = function () {\n callback();\n };\n };\n\n\n api._getLocal = function (id, callback) {\n var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var tx = txnResult.txn;\n var req = tx.objectStore(LOCAL_STORE).get(id);\n\n req.onerror = idbError(callback);\n req.onsuccess = function (e) {\n var doc = e.target.result;\n if (!doc) {\n callback(createError(MISSING_DOC));\n } else {\n delete doc['_doc_id_rev']; // for backwards compat\n callback(null, doc);\n }\n };\n };\n\n api._putLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n delete doc._revisions; // ignore this, trust the rev\n var oldRev = doc._rev;\n var id = doc._id;\n if (!oldRev) {\n doc._rev = '0-1';\n } else {\n doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1);\n }\n\n var tx = opts.ctx;\n var ret;\n if (!tx) {\n var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n tx = txnResult.txn;\n tx.onerror = idbError(callback);\n tx.oncomplete = function () {\n if (ret) {\n callback(null, ret);\n }\n };\n }\n\n var oStore = tx.objectStore(LOCAL_STORE);\n var req;\n if (oldRev) {\n req = oStore.get(id);\n req.onsuccess = function (e) {\n var oldDoc = e.target.result;\n if (!oldDoc || oldDoc._rev !== oldRev) {\n callback(createError(REV_CONFLICT));\n } else { // update\n var req = oStore.put(doc);\n req.onsuccess = function () {\n ret = {ok: true, id: doc._id, rev: doc._rev};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n };\n }\n };\n } else { // new doc\n req = oStore.add(doc);\n req.onerror = function (e) {\n // constraint error, already exists\n callback(createError(REV_CONFLICT));\n e.preventDefault(); // avoid transaction abort\n e.stopPropagation(); // avoid transaction onerror\n };\n req.onsuccess = function () {\n ret = {ok: true, id: doc._id, rev: doc._rev};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n };\n }\n };\n\n api._removeLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var tx = opts.ctx;\n if (!tx) {\n var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n tx = txnResult.txn;\n tx.oncomplete = function () {\n if (ret) {\n callback(null, ret);\n }\n };\n }\n var ret;\n var id = doc._id;\n var oStore = tx.objectStore(LOCAL_STORE);\n var req = oStore.get(id);\n\n req.onerror = idbError(callback);\n req.onsuccess = function (e) {\n var oldDoc = e.target.result;\n if (!oldDoc || oldDoc._rev !== doc._rev) {\n callback(createError(MISSING_DOC));\n } else {\n oStore[\"delete\"](id);\n ret = {ok: true, id: id, rev: '0-0'};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n }\n };\n };\n\n api._destroy = function (opts, callback) {\n changesHandler$$1.removeAllListeners(dbName);\n\n //Close open request for \"dbName\" database to fix ie delay.\n var openReq = openReqList.get(dbName);\n if (openReq && openReq.result) {\n openReq.result.close();\n cachedDBs[\"delete\"](dbName);\n }\n var req = indexedDB.deleteDatabase(dbName);\n\n req.onsuccess = function () {\n //Remove open request from the list.\n openReqList[\"delete\"](dbName);\n if (hasLocalStorage() && (dbName in localStorage)) {\n delete localStorage[dbName];\n }\n callback(null, { 'ok': true });\n };\n\n req.onerror = idbError(callback);\n };\n\n var cached = cachedDBs.get(dbName);\n\n if (cached) {\n idb = cached.idb;\n api._meta = cached.global;\n return nextTick(function () {\n callback(null, api);\n });\n }\n\n var req;\n if (opts.storage) {\n req = tryStorageOption(dbName, opts.storage);\n } else {\n req = indexedDB.open(dbName, ADAPTER_VERSION);\n }\n\n openReqList.set(dbName, req);\n\n req.onupgradeneeded = function (e) {\n var db = e.target.result;\n if (e.oldVersion < 1) {\n return createSchema(db); // new db, initial schema\n }\n // do migrations\n\n var txn = e.currentTarget.transaction;\n // these migrations have to be done in this function, before\n // control is returned to the event loop, because IndexedDB\n\n if (e.oldVersion < 3) {\n createLocalStoreSchema(db); // v2 -> v3\n }\n if (e.oldVersion < 4) {\n addAttachAndSeqStore(db); // v3 -> v4\n }\n\n var migrations = [\n addDeletedOrLocalIndex, // v1 -> v2\n migrateLocalStore, // v2 -> v3\n migrateAttsAndSeqs, // v3 -> v4\n migrateMetadata // v4 -> v5\n ];\n\n var i = e.oldVersion;\n\n function next() {\n var migration = migrations[i - 1];\n i++;\n if (migration) {\n migration(txn, next);\n }\n }\n\n next();\n };\n\n req.onsuccess = function (e) {\n\n idb = e.target.result;\n\n idb.onversionchange = function () {\n idb.close();\n cachedDBs[\"delete\"](dbName);\n };\n\n idb.onabort = function (e) {\n guardedConsole('error', 'Database has a global failure', e.target.error);\n idb.close();\n cachedDBs[\"delete\"](dbName);\n };\n\n // Do a few setup operations (in parallel as much as possible):\n // 1. Fetch meta doc\n // 2. Check blob support\n // 3. Calculate docCount\n // 4. Generate an instanceId if necessary\n // 5. Store docCount and instanceId on meta doc\n\n var txn = idb.transaction([\n META_STORE,\n DETECT_BLOB_SUPPORT_STORE,\n DOC_STORE\n ], 'readwrite');\n\n var storedMetaDoc = false;\n var metaDoc;\n var docCount;\n var blobSupport;\n var instanceId;\n\n function completeSetup() {\n if (typeof blobSupport === 'undefined' || !storedMetaDoc) {\n return;\n }\n api._meta = {\n name: dbName,\n instanceId: instanceId,\n blobSupport: blobSupport\n };\n\n cachedDBs.set(dbName, {\n idb: idb,\n global: api._meta\n });\n callback(null, api);\n }\n\n function storeMetaDocIfReady() {\n if (typeof docCount === 'undefined' || typeof metaDoc === 'undefined') {\n return;\n }\n var instanceKey = dbName + '_id';\n if (instanceKey in metaDoc) {\n instanceId = metaDoc[instanceKey];\n } else {\n metaDoc[instanceKey] = instanceId = uuid();\n }\n metaDoc.docCount = docCount;\n txn.objectStore(META_STORE).put(metaDoc);\n }\n\n //\n // fetch or generate the instanceId\n //\n txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) {\n metaDoc = e.target.result || { id: META_STORE };\n storeMetaDocIfReady();\n };\n\n //\n // countDocs\n //\n countDocs(txn, function (count) {\n docCount = count;\n storeMetaDocIfReady();\n });\n\n //\n // check blob support\n //\n if (!blobSupportPromise) {\n // make sure blob support is only checked once\n blobSupportPromise = checkBlobSupport(txn);\n }\n\n blobSupportPromise.then(function (val) {\n blobSupport = val;\n completeSetup();\n });\n\n // only when the metadata put transaction has completed,\n // consider the setup done\n txn.oncomplete = function () {\n storedMetaDoc = true;\n completeSetup();\n };\n txn.onabort = idbError(callback);\n };\n\n req.onerror = function () {\n var msg = 'Failed to open indexedDB, are you in private browsing mode?';\n guardedConsole('error', msg);\n callback(createError(IDB_ERROR, msg));\n };\n}\n\nIdbPouch.valid = function () {\n // Issue #2533, we finally gave up on doing bug\n // detection instead of browser sniffing. Safari brought us\n // to our knees.\n var isSafari = typeof openDatabase !== 'undefined' &&\n /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) &&\n !/Chrome/.test(navigator.userAgent) &&\n !/BlackBerry/.test(navigator.platform);\n\n // Safari <10.1 does not meet our requirements for IDB support (#5572)\n // since Safari 10.1 shipped with fetch, we can use that to detect it\n var hasFetch = typeof fetch === 'function' &&\n fetch.toString().indexOf('[native code') !== -1;\n\n // On Firefox SecurityError is thrown while referencing indexedDB if cookies\n // are not allowed. `typeof indexedDB` also triggers the error.\n try {\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n};\n\nfunction tryStorageOption(dbName, storage) {\n try { // option only available in Firefox 26+\n return indexedDB.open(dbName, {\n version: ADAPTER_VERSION,\n storage: storage\n });\n } catch (err) {\n return indexedDB.open(dbName, ADAPTER_VERSION);\n }\n}\n\nfunction IDBPouch (PouchDB) {\n PouchDB.adapter('idb', IdbPouch, true);\n}\n\n//\n// Parsing hex strings. Yeah.\n//\n// So basically we need this because of a bug in WebSQL:\n// https://code.google.com/p/chromium/issues/detail?id=422690\n// https://bugs.webkit.org/show_bug.cgi?id=137637\n//\n// UTF-8 and UTF-16 are provided as separate functions\n// for meager performance improvements\n//\n\nfunction decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction hexToInt(charCode) {\n // '0'-'9' is 48-57\n // 'A'-'F' is 65-70\n // SQLite will only give us uppercase hex\n return charCode < 65 ? (charCode - 48) : (charCode - 55);\n}\n\n\n// Example:\n// pragma encoding=utf8;\n// select hex('A');\n// returns '41'\nfunction parseHexUtf8(str, start, end) {\n var result = '';\n while (start < end) {\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start++)) << 4) |\n hexToInt(str.charCodeAt(start++)));\n }\n return result;\n}\n\n// Example:\n// pragma encoding=utf16;\n// select hex('A');\n// returns '4100'\n// notice that the 00 comes after the 41 (i.e. it's swizzled)\nfunction parseHexUtf16(str, start, end) {\n var result = '';\n while (start < end) {\n // UTF-16, so swizzle the bytes\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start + 2)) << 12) |\n (hexToInt(str.charCodeAt(start + 3)) << 8) |\n (hexToInt(str.charCodeAt(start)) << 4) |\n hexToInt(str.charCodeAt(start + 1)));\n start += 4;\n }\n return result;\n}\n\nfunction parseHexString(str, encoding) {\n if (encoding === 'UTF-8') {\n return decodeUtf8(parseHexUtf8(str, 0, str.length));\n } else {\n return parseHexUtf16(str, 0, str.length);\n }\n}\n\nfunction quote(str) {\n return \"'\" + str + \"'\";\n}\n\nvar ADAPTER_VERSION$1 = 7; // used to manage migrations\n\n// The object stores created for each database\n// DOC_STORE stores the document meta data, its revision history and state\nvar DOC_STORE$1 = quote('document-store');\n// BY_SEQ_STORE stores a particular version of a document, keyed by its\n// sequence id\nvar BY_SEQ_STORE$1 = quote('by-sequence');\n// Where we store attachments\nvar ATTACH_STORE$1 = quote('attach-store');\nvar LOCAL_STORE$1 = quote('local-store');\nvar META_STORE$1 = quote('metadata-store');\n// where we store many-to-many relations between attachment\n// digests and seqs\nvar ATTACH_AND_SEQ_STORE$1 = quote('attach-seq-store');\n\n// escapeBlob and unescapeBlob are workarounds for a websql bug:\n// https://code.google.com/p/chromium/issues/detail?id=422690\n// https://bugs.webkit.org/show_bug.cgi?id=137637\n// The goal is to never actually insert the \\u0000 character\n// in the database.\nfunction escapeBlob(str) {\n return str\n .replace(/\\u0002/g, '\\u0002\\u0002')\n .replace(/\\u0001/g, '\\u0001\\u0002')\n .replace(/\\u0000/g, '\\u0001\\u0001');\n}\n\nfunction unescapeBlob(str) {\n return str\n .replace(/\\u0001\\u0001/g, '\\u0000')\n .replace(/\\u0001\\u0002/g, '\\u0001')\n .replace(/\\u0002\\u0002/g, '\\u0002');\n}\n\nfunction stringifyDoc(doc) {\n // don't bother storing the id/rev. it uses lots of space,\n // in persistent map/reduce especially\n delete doc._id;\n delete doc._rev;\n return JSON.stringify(doc);\n}\n\nfunction unstringifyDoc(doc, id, rev$$1) {\n doc = JSON.parse(doc);\n doc._id = id;\n doc._rev = rev$$1;\n return doc;\n}\n\n// question mark groups IN queries, e.g. 3 -> '(?,?,?)'\nfunction qMarks(num) {\n var s = '(';\n while (num--) {\n s += '?';\n if (num) {\n s += ',';\n }\n }\n return s + ')';\n}\n\nfunction select(selector, table, joiner, where, orderBy) {\n return 'SELECT ' + selector + ' FROM ' +\n (typeof table === 'string' ? table : table.join(' JOIN ')) +\n (joiner ? (' ON ' + joiner) : '') +\n (where ? (' WHERE ' +\n (typeof where === 'string' ? where : where.join(' AND '))) : '') +\n (orderBy ? (' ORDER BY ' + orderBy) : '');\n}\n\nfunction compactRevs$1(revs, docId, tx) {\n\n if (!revs.length) {\n return;\n }\n\n var numDone = 0;\n var seqs = [];\n\n function checkDone() {\n if (++numDone === revs.length) { // done\n deleteOrphans();\n }\n }\n\n function deleteOrphans() {\n // find orphaned attachment digests\n\n if (!seqs.length) {\n return;\n }\n\n var sql = 'SELECT DISTINCT digest AS digest FROM ' +\n ATTACH_AND_SEQ_STORE$1 + ' WHERE seq IN ' + qMarks(seqs.length);\n\n tx.executeSql(sql, seqs, function (tx, res) {\n\n var digestsToCheck = [];\n for (var i = 0; i < res.rows.length; i++) {\n digestsToCheck.push(res.rows.item(i).digest);\n }\n if (!digestsToCheck.length) {\n return;\n }\n\n var sql = 'DELETE FROM ' + ATTACH_AND_SEQ_STORE$1 +\n ' WHERE seq IN (' +\n seqs.map(function () { return '?'; }).join(',') +\n ')';\n tx.executeSql(sql, seqs, function (tx) {\n\n var sql = 'SELECT digest FROM ' + ATTACH_AND_SEQ_STORE$1 +\n ' WHERE digest IN (' +\n digestsToCheck.map(function () { return '?'; }).join(',') +\n ')';\n tx.executeSql(sql, digestsToCheck, function (tx, res) {\n var nonOrphanedDigests = new ExportedSet();\n for (var i = 0; i < res.rows.length; i++) {\n nonOrphanedDigests.add(res.rows.item(i).digest);\n }\n digestsToCheck.forEach(function (digest) {\n if (nonOrphanedDigests.has(digest)) {\n return;\n }\n tx.executeSql(\n 'DELETE FROM ' + ATTACH_AND_SEQ_STORE$1 + ' WHERE digest=?',\n [digest]);\n tx.executeSql(\n 'DELETE FROM ' + ATTACH_STORE$1 + ' WHERE digest=?', [digest]);\n });\n });\n });\n });\n }\n\n // update by-seq and attach stores in parallel\n revs.forEach(function (rev$$1) {\n var sql = 'SELECT seq FROM ' + BY_SEQ_STORE$1 +\n ' WHERE doc_id=? AND rev=?';\n\n tx.executeSql(sql, [docId, rev$$1], function (tx, res) {\n if (!res.rows.length) { // already deleted\n return checkDone();\n }\n var seq = res.rows.item(0).seq;\n seqs.push(seq);\n\n tx.executeSql(\n 'DELETE FROM ' + BY_SEQ_STORE$1 + ' WHERE seq=?', [seq], checkDone);\n });\n });\n}\n\nfunction websqlError(callback) {\n return function (event) {\n guardedConsole('error', 'WebSQL threw an error', event);\n // event may actually be a SQLError object, so report is as such\n var errorNameMatch = event && event.constructor.toString()\n .match(/function ([^(]+)/);\n var errorName = (errorNameMatch && errorNameMatch[1]) || event.type;\n var errorReason = event.target || event.message;\n callback(createError(WSQ_ERROR, errorReason, errorName));\n };\n}\n\nfunction getSize(opts) {\n if ('size' in opts) {\n // triggers immediate popup in iOS, fixes #2347\n // e.g. 5000001 asks for 5 MB, 10000001 asks for 10 MB,\n return opts.size * 1000000;\n }\n // In iOS, doesn't matter as long as it's <= 5000000.\n // Except that if you request too much, our tests fail\n // because of the native \"do you accept?\" popup.\n // In Android <=4.3, this value is actually used as an\n // honest-to-god ceiling for data, so we need to\n // set it to a decently high number.\n var isAndroid = typeof navigator !== 'undefined' &&\n /Android/.test(navigator.userAgent);\n return isAndroid ? 5000000 : 1; // in PhantomJS, if you use 0 it will crash\n}\n\nfunction websqlBulkDocs(dbOpts, req, opts, api, db, websqlChanges, callback) {\n var newEdits = opts.new_edits;\n var userDocs = req.docs;\n\n // Parse the docs, give them a sequence number for the result\n var docInfos = userDocs.map(function (doc) {\n if (doc._id && isLocalId(doc._id)) {\n return doc;\n }\n var newDoc = parseDoc(doc, newEdits);\n return newDoc;\n });\n\n var docInfoErrors = docInfos.filter(function (docInfo) {\n return docInfo.error;\n });\n if (docInfoErrors.length) {\n return callback(docInfoErrors[0]);\n }\n\n var tx;\n var results = new Array(docInfos.length);\n var fetchedDocs = new ExportedMap();\n\n var preconditionErrored;\n function complete() {\n if (preconditionErrored) {\n return callback(preconditionErrored);\n }\n websqlChanges.notify(api._name);\n callback(null, results);\n }\n\n function verifyAttachment(digest, callback) {\n var sql = 'SELECT count(*) as cnt FROM ' + ATTACH_STORE$1 +\n ' WHERE digest=?';\n tx.executeSql(sql, [digest], function (tx, result) {\n if (result.rows.item(0).cnt === 0) {\n var err = createError(MISSING_STUB,\n 'unknown stub attachment with digest ' +\n digest);\n callback(err);\n } else {\n callback();\n }\n });\n }\n\n function verifyAttachments(finish) {\n var digests = [];\n docInfos.forEach(function (docInfo) {\n if (docInfo.data && docInfo.data._attachments) {\n Object.keys(docInfo.data._attachments).forEach(function (filename) {\n var att = docInfo.data._attachments[filename];\n if (att.stub) {\n digests.push(att.digest);\n }\n });\n }\n });\n if (!digests.length) {\n return finish();\n }\n var numDone = 0;\n var err;\n\n function checkDone() {\n if (++numDone === digests.length) {\n finish(err);\n }\n }\n digests.forEach(function (digest) {\n verifyAttachment(digest, function (attErr) {\n if (attErr && !err) {\n err = attErr;\n }\n checkDone();\n });\n });\n }\n\n function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted,\n isUpdate, delta, resultsIdx, callback) {\n\n function finish() {\n var data = docInfo.data;\n var deletedInt = newRevIsDeleted ? 1 : 0;\n\n var id = data._id;\n var rev = data._rev;\n var json = stringifyDoc(data);\n var sql = 'INSERT INTO ' + BY_SEQ_STORE$1 +\n ' (doc_id, rev, json, deleted) VALUES (?, ?, ?, ?);';\n var sqlArgs = [id, rev, json, deletedInt];\n\n // map seqs to attachment digests, which\n // we will need later during compaction\n function insertAttachmentMappings(seq, callback) {\n var attsAdded = 0;\n var attsToAdd = Object.keys(data._attachments || {});\n\n if (!attsToAdd.length) {\n return callback();\n }\n function checkDone() {\n if (++attsAdded === attsToAdd.length) {\n callback();\n }\n return false; // ack handling a constraint error\n }\n function add(att) {\n var sql = 'INSERT INTO ' + ATTACH_AND_SEQ_STORE$1 +\n ' (digest, seq) VALUES (?,?)';\n var sqlArgs = [data._attachments[att].digest, seq];\n tx.executeSql(sql, sqlArgs, checkDone, checkDone);\n // second callback is for a constaint error, which we ignore\n // because this docid/rev has already been associated with\n // the digest (e.g. when new_edits == false)\n }\n for (var i = 0; i < attsToAdd.length; i++) {\n add(attsToAdd[i]); // do in parallel\n }\n }\n\n tx.executeSql(sql, sqlArgs, function (tx, result) {\n var seq = result.insertId;\n insertAttachmentMappings(seq, function () {\n dataWritten(tx, seq);\n });\n }, function () {\n // constraint error, recover by updating instead (see #1638)\n var fetchSql = select('seq', BY_SEQ_STORE$1, null,\n 'doc_id=? AND rev=?');\n tx.executeSql(fetchSql, [id, rev], function (tx, res) {\n var seq = res.rows.item(0).seq;\n var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n ' SET json=?, deleted=? WHERE doc_id=? AND rev=?;';\n var sqlArgs = [json, deletedInt, id, rev];\n tx.executeSql(sql, sqlArgs, function (tx) {\n insertAttachmentMappings(seq, function () {\n dataWritten(tx, seq);\n });\n });\n });\n return false; // ack that we've handled the error\n });\n }\n\n function collectResults(attachmentErr) {\n if (!err) {\n if (attachmentErr) {\n err = attachmentErr;\n callback(err);\n } else if (recv === attachments.length) {\n finish();\n }\n }\n }\n\n var err = null;\n var recv = 0;\n\n docInfo.data._id = docInfo.metadata.id;\n docInfo.data._rev = docInfo.metadata.rev;\n var attachments = Object.keys(docInfo.data._attachments || {});\n\n\n if (newRevIsDeleted) {\n docInfo.data._deleted = true;\n }\n\n function attachmentSaved(err) {\n recv++;\n collectResults(err);\n }\n\n attachments.forEach(function (key) {\n var att = docInfo.data._attachments[key];\n if (!att.stub) {\n var data = att.data;\n delete att.data;\n att.revpos = parseInt(winningRev$$1, 10);\n var digest = att.digest;\n saveAttachment(digest, data, attachmentSaved);\n } else {\n recv++;\n collectResults();\n }\n });\n\n if (!attachments.length) {\n finish();\n }\n\n function dataWritten(tx, seq) {\n var id = docInfo.metadata.id;\n\n var revsToCompact = docInfo.stemmedRevs || [];\n if (isUpdate && api.auto_compaction) {\n revsToCompact = compactTree(docInfo.metadata).concat(revsToCompact);\n }\n if (revsToCompact.length) {\n compactRevs$1(revsToCompact, id, tx);\n }\n\n docInfo.metadata.seq = seq;\n var rev = docInfo.metadata.rev;\n delete docInfo.metadata.rev;\n\n var sql = isUpdate ?\n 'UPDATE ' + DOC_STORE$1 +\n ' SET json=?, max_seq=?, winningseq=' +\n '(SELECT seq FROM ' + BY_SEQ_STORE$1 +\n ' WHERE doc_id=' + DOC_STORE$1 + '.id AND rev=?) WHERE id=?'\n : 'INSERT INTO ' + DOC_STORE$1 +\n ' (id, winningseq, max_seq, json) VALUES (?,?,?,?);';\n var metadataStr = safeJsonStringify(docInfo.metadata);\n var params = isUpdate ?\n [metadataStr, seq, winningRev$$1, id] :\n [id, seq, seq, metadataStr];\n tx.executeSql(sql, params, function () {\n results[resultsIdx] = {\n ok: true,\n id: docInfo.metadata.id,\n rev: rev\n };\n fetchedDocs.set(id, docInfo.metadata);\n callback();\n });\n }\n }\n\n function websqlProcessDocs() {\n processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs, tx,\n results, writeDoc, opts);\n }\n\n function fetchExistingDocs(callback) {\n if (!docInfos.length) {\n return callback();\n }\n\n var numFetched = 0;\n\n function checkDone() {\n if (++numFetched === docInfos.length) {\n callback();\n }\n }\n\n docInfos.forEach(function (docInfo) {\n if (docInfo._id && isLocalId(docInfo._id)) {\n return checkDone(); // skip local docs\n }\n var id = docInfo.metadata.id;\n tx.executeSql('SELECT json FROM ' + DOC_STORE$1 +\n ' WHERE id = ?', [id], function (tx, result) {\n if (result.rows.length) {\n var metadata = safeJsonParse(result.rows.item(0).json);\n fetchedDocs.set(id, metadata);\n }\n checkDone();\n });\n });\n }\n\n function saveAttachment(digest, data, callback) {\n var sql = 'SELECT digest FROM ' + ATTACH_STORE$1 + ' WHERE digest=?';\n tx.executeSql(sql, [digest], function (tx, result) {\n if (result.rows.length) { // attachment already exists\n return callback();\n }\n // we could just insert before selecting and catch the error,\n // but my hunch is that it's cheaper not to serialize the blob\n // from JS to C if we don't have to (TODO: confirm this)\n sql = 'INSERT INTO ' + ATTACH_STORE$1 +\n ' (digest, body, escaped) VALUES (?,?,1)';\n tx.executeSql(sql, [digest, escapeBlob(data)], function () {\n callback();\n }, function () {\n // ignore constaint errors, means it already exists\n callback();\n return false; // ack we handled the error\n });\n });\n }\n\n preprocessAttachments(docInfos, 'binary', function (err) {\n if (err) {\n return callback(err);\n }\n db.transaction(function (txn) {\n tx = txn;\n verifyAttachments(function (err) {\n if (err) {\n preconditionErrored = err;\n } else {\n fetchExistingDocs(websqlProcessDocs);\n }\n });\n }, websqlError(callback), complete);\n });\n}\n\nvar cachedDatabases = new ExportedMap();\n\n// openDatabase passed in through opts (e.g. for node-websql)\nfunction openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}\n\nfunction openDBSafely(opts) {\n try {\n return {\n db: openDatabaseWithOpts(opts)\n };\n } catch (err) {\n return {\n error: err\n };\n }\n}\n\nfunction openDB(opts) {\n var cachedResult = cachedDatabases.get(opts.name);\n if (!cachedResult) {\n cachedResult = openDBSafely(opts);\n cachedDatabases.set(opts.name, cachedResult);\n }\n return cachedResult;\n}\n\nvar websqlChanges = new Changes();\n\nfunction fetchAttachmentsIfNecessary$1(doc, opts, api, txn, cb) {\n var attachments = Object.keys(doc._attachments || {});\n if (!attachments.length) {\n return cb && cb();\n }\n var numDone = 0;\n\n function checkDone() {\n if (++numDone === attachments.length && cb) {\n cb();\n }\n }\n\n function fetchAttachment(doc, att) {\n var attObj = doc._attachments[att];\n var attOpts = {binary: opts.binary, ctx: txn};\n api._getAttachment(doc._id, att, attObj, attOpts, function (_, data) {\n doc._attachments[att] = $inject_Object_assign(\n pick(attObj, ['digest', 'content_type']),\n { data: data }\n );\n checkDone();\n });\n }\n\n attachments.forEach(function (att) {\n if (opts.attachments && opts.include_docs) {\n fetchAttachment(doc, att);\n } else {\n doc._attachments[att].stub = true;\n checkDone();\n }\n });\n}\n\nvar POUCH_VERSION = 1;\n\n// these indexes cover the ground for most allDocs queries\nvar BY_SEQ_STORE_DELETED_INDEX_SQL =\n 'CREATE INDEX IF NOT EXISTS \\'by-seq-deleted-idx\\' ON ' +\n BY_SEQ_STORE$1 + ' (seq, deleted)';\nvar BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL =\n 'CREATE UNIQUE INDEX IF NOT EXISTS \\'by-seq-doc-id-rev\\' ON ' +\n BY_SEQ_STORE$1 + ' (doc_id, rev)';\nvar DOC_STORE_WINNINGSEQ_INDEX_SQL =\n 'CREATE INDEX IF NOT EXISTS \\'doc-winningseq-idx\\' ON ' +\n DOC_STORE$1 + ' (winningseq)';\nvar ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL =\n 'CREATE INDEX IF NOT EXISTS \\'attach-seq-seq-idx\\' ON ' +\n ATTACH_AND_SEQ_STORE$1 + ' (seq)';\nvar ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL =\n 'CREATE UNIQUE INDEX IF NOT EXISTS \\'attach-seq-digest-idx\\' ON ' +\n ATTACH_AND_SEQ_STORE$1 + ' (digest, seq)';\n\nvar DOC_STORE_AND_BY_SEQ_JOINER = BY_SEQ_STORE$1 +\n '.seq = ' + DOC_STORE$1 + '.winningseq';\n\nvar SELECT_DOCS = BY_SEQ_STORE$1 + '.seq AS seq, ' +\n BY_SEQ_STORE$1 + '.deleted AS deleted, ' +\n BY_SEQ_STORE$1 + '.json AS data, ' +\n BY_SEQ_STORE$1 + '.rev AS rev, ' +\n DOC_STORE$1 + '.json AS metadata';\n\nfunction WebSqlPouch(opts, callback) {\n var api = this;\n var instanceId = null;\n var size = getSize(opts);\n var idRequests = [];\n var encoding;\n\n api._name = opts.name;\n\n // extend the options here, because sqlite plugin has a ton of options\n // and they are constantly changing, so it's more prudent to allow anything\n var websqlOpts = $inject_Object_assign({}, opts, {\n version: POUCH_VERSION,\n description: opts.name,\n size: size\n });\n var openDBResult = openDB(websqlOpts);\n if (openDBResult.error) {\n return websqlError(callback)(openDBResult.error);\n }\n var db = openDBResult.db;\n if (typeof db.readTransaction !== 'function') {\n // doesn't exist in sqlite plugin\n db.readTransaction = db.transaction;\n }\n\n function dbCreated() {\n // note the db name in case the browser upgrades to idb\n if (hasLocalStorage()) {\n window.localStorage['_pouch__websqldb_' + api._name] = true;\n }\n callback(null, api);\n }\n\n // In this migration, we added the 'deleted' and 'local' columns to the\n // by-seq and doc store tables.\n // To preserve existing user data, we re-process all the existing JSON\n // and add these values.\n // Called migration2 because it corresponds to adapter version (db_version) #2\n function runMigration2(tx, callback) {\n // index used for the join in the allDocs query\n tx.executeSql(DOC_STORE_WINNINGSEQ_INDEX_SQL);\n\n tx.executeSql('ALTER TABLE ' + BY_SEQ_STORE$1 +\n ' ADD COLUMN deleted TINYINT(1) DEFAULT 0', [], function () {\n tx.executeSql(BY_SEQ_STORE_DELETED_INDEX_SQL);\n tx.executeSql('ALTER TABLE ' + DOC_STORE$1 +\n ' ADD COLUMN local TINYINT(1) DEFAULT 0', [], function () {\n tx.executeSql('CREATE INDEX IF NOT EXISTS \\'doc-store-local-idx\\' ON ' +\n DOC_STORE$1 + ' (local, id)');\n\n var sql = 'SELECT ' + DOC_STORE$1 + '.winningseq AS seq, ' + DOC_STORE$1 +\n '.json AS metadata FROM ' + BY_SEQ_STORE$1 + ' JOIN ' + DOC_STORE$1 +\n ' ON ' + BY_SEQ_STORE$1 + '.seq = ' + DOC_STORE$1 + '.winningseq';\n\n tx.executeSql(sql, [], function (tx, result) {\n\n var deleted = [];\n var local = [];\n\n for (var i = 0; i < result.rows.length; i++) {\n var item = result.rows.item(i);\n var seq = item.seq;\n var metadata = JSON.parse(item.metadata);\n if (isDeleted(metadata)) {\n deleted.push(seq);\n }\n if (isLocalId(metadata.id)) {\n local.push(metadata.id);\n }\n }\n tx.executeSql('UPDATE ' + DOC_STORE$1 + 'SET local = 1 WHERE id IN ' +\n qMarks(local.length), local, function () {\n tx.executeSql('UPDATE ' + BY_SEQ_STORE$1 +\n ' SET deleted = 1 WHERE seq IN ' +\n qMarks(deleted.length), deleted, callback);\n });\n });\n });\n });\n }\n\n // in this migration, we make all the local docs unversioned\n function runMigration3(tx, callback) {\n var local = 'CREATE TABLE IF NOT EXISTS ' + LOCAL_STORE$1 +\n ' (id UNIQUE, rev, json)';\n tx.executeSql(local, [], function () {\n var sql = 'SELECT ' + DOC_STORE$1 + '.id AS id, ' +\n BY_SEQ_STORE$1 + '.json AS data ' +\n 'FROM ' + BY_SEQ_STORE$1 + ' JOIN ' +\n DOC_STORE$1 + ' ON ' + BY_SEQ_STORE$1 + '.seq = ' +\n DOC_STORE$1 + '.winningseq WHERE local = 1';\n tx.executeSql(sql, [], function (tx, res) {\n var rows = [];\n for (var i = 0; i < res.rows.length; i++) {\n rows.push(res.rows.item(i));\n }\n function doNext() {\n if (!rows.length) {\n return callback(tx);\n }\n var row = rows.shift();\n var rev$$1 = JSON.parse(row.data)._rev;\n tx.executeSql('INSERT INTO ' + LOCAL_STORE$1 +\n ' (id, rev, json) VALUES (?,?,?)',\n [row.id, rev$$1, row.data], function (tx) {\n tx.executeSql('DELETE FROM ' + DOC_STORE$1 + ' WHERE id=?',\n [row.id], function (tx) {\n tx.executeSql('DELETE FROM ' + BY_SEQ_STORE$1 + ' WHERE seq=?',\n [row.seq], function () {\n doNext();\n });\n });\n });\n }\n doNext();\n });\n });\n }\n\n // in this migration, we remove doc_id_rev and just use rev\n function runMigration4(tx, callback) {\n\n function updateRows(rows) {\n function doNext() {\n if (!rows.length) {\n return callback(tx);\n }\n var row = rows.shift();\n var doc_id_rev = parseHexString(row.hex, encoding);\n var idx = doc_id_rev.lastIndexOf('::');\n var doc_id = doc_id_rev.substring(0, idx);\n var rev$$1 = doc_id_rev.substring(idx + 2);\n var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n ' SET doc_id=?, rev=? WHERE doc_id_rev=?';\n tx.executeSql(sql, [doc_id, rev$$1, doc_id_rev], function () {\n doNext();\n });\n }\n doNext();\n }\n\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN doc_id';\n tx.executeSql(sql, [], function (tx) {\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN rev';\n tx.executeSql(sql, [], function (tx) {\n tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL, [], function (tx) {\n var sql = 'SELECT hex(doc_id_rev) as hex FROM ' + BY_SEQ_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var rows = [];\n for (var i = 0; i < res.rows.length; i++) {\n rows.push(res.rows.item(i));\n }\n updateRows(rows);\n });\n });\n });\n });\n }\n\n // in this migration, we add the attach_and_seq table\n // for issue #2818\n function runMigration5(tx, callback) {\n\n function migrateAttsAndSeqs(tx) {\n // need to actually populate the table. this is the expensive part,\n // so as an optimization, check first that this database even\n // contains attachments\n var sql = 'SELECT COUNT(*) AS cnt FROM ' + ATTACH_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var count = res.rows.item(0).cnt;\n if (!count) {\n return callback(tx);\n }\n\n var offset = 0;\n var pageSize = 10;\n function nextPage() {\n var sql = select(\n SELECT_DOCS + ', ' + DOC_STORE$1 + '.id AS id',\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n null,\n DOC_STORE$1 + '.id '\n );\n sql += ' LIMIT ' + pageSize + ' OFFSET ' + offset;\n offset += pageSize;\n tx.executeSql(sql, [], function (tx, res) {\n if (!res.rows.length) {\n return callback(tx);\n }\n var digestSeqs = {};\n function addDigestSeq(digest, seq) {\n // uniq digest/seq pairs, just in case there are dups\n var seqs = digestSeqs[digest] = (digestSeqs[digest] || []);\n if (seqs.indexOf(seq) === -1) {\n seqs.push(seq);\n }\n }\n for (var i = 0; i < res.rows.length; i++) {\n var row = res.rows.item(i);\n var doc = unstringifyDoc(row.data, row.id, row.rev);\n var atts = Object.keys(doc._attachments || {});\n for (var j = 0; j < atts.length; j++) {\n var att = doc._attachments[atts[j]];\n addDigestSeq(att.digest, row.seq);\n }\n }\n var digestSeqPairs = [];\n Object.keys(digestSeqs).forEach(function (digest) {\n var seqs = digestSeqs[digest];\n seqs.forEach(function (seq) {\n digestSeqPairs.push([digest, seq]);\n });\n });\n if (!digestSeqPairs.length) {\n return nextPage();\n }\n var numDone = 0;\n digestSeqPairs.forEach(function (pair) {\n var sql = 'INSERT INTO ' + ATTACH_AND_SEQ_STORE$1 +\n ' (digest, seq) VALUES (?,?)';\n tx.executeSql(sql, pair, function () {\n if (++numDone === digestSeqPairs.length) {\n nextPage();\n }\n });\n });\n });\n }\n nextPage();\n });\n }\n\n var attachAndRev = 'CREATE TABLE IF NOT EXISTS ' +\n ATTACH_AND_SEQ_STORE$1 + ' (digest, seq INTEGER)';\n tx.executeSql(attachAndRev, [], function (tx) {\n tx.executeSql(\n ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL, [], function (tx) {\n tx.executeSql(\n ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL, [],\n migrateAttsAndSeqs);\n });\n });\n }\n\n // in this migration, we use escapeBlob() and unescapeBlob()\n // instead of reading out the binary as HEX, which is slow\n function runMigration6(tx, callback) {\n var sql = 'ALTER TABLE ' + ATTACH_STORE$1 +\n ' ADD COLUMN escaped TINYINT(1) DEFAULT 0';\n tx.executeSql(sql, [], callback);\n }\n\n // issue #3136, in this migration we need a \"latest seq\" as well\n // as the \"winning seq\" in the doc store\n function runMigration7(tx, callback) {\n var sql = 'ALTER TABLE ' + DOC_STORE$1 +\n ' ADD COLUMN max_seq INTEGER';\n tx.executeSql(sql, [], function (tx) {\n var sql = 'UPDATE ' + DOC_STORE$1 + ' SET max_seq=(SELECT MAX(seq) FROM ' +\n BY_SEQ_STORE$1 + ' WHERE doc_id=id)';\n tx.executeSql(sql, [], function (tx) {\n // add unique index after filling, else we'll get a constraint\n // error when we do the ALTER TABLE\n var sql =\n 'CREATE UNIQUE INDEX IF NOT EXISTS \\'doc-max-seq-idx\\' ON ' +\n DOC_STORE$1 + ' (max_seq)';\n tx.executeSql(sql, [], callback);\n });\n });\n }\n\n function checkEncoding(tx, cb) {\n // UTF-8 on chrome/android, UTF-16 on safari < 7.1\n tx.executeSql('SELECT HEX(\"a\") AS hex', [], function (tx, res) {\n var hex = res.rows.item(0).hex;\n encoding = hex.length === 2 ? 'UTF-8' : 'UTF-16';\n cb();\n }\n );\n }\n\n function onGetInstanceId() {\n while (idRequests.length > 0) {\n var idCallback = idRequests.pop();\n idCallback(null, instanceId);\n }\n }\n\n function onGetVersion(tx, dbVersion) {\n if (dbVersion === 0) {\n // initial schema\n\n var meta = 'CREATE TABLE IF NOT EXISTS ' + META_STORE$1 +\n ' (dbid, db_version INTEGER)';\n var attach = 'CREATE TABLE IF NOT EXISTS ' + ATTACH_STORE$1 +\n ' (digest UNIQUE, escaped TINYINT(1), body BLOB)';\n var attachAndRev = 'CREATE TABLE IF NOT EXISTS ' +\n ATTACH_AND_SEQ_STORE$1 + ' (digest, seq INTEGER)';\n // TODO: migrate winningseq to INTEGER\n var doc = 'CREATE TABLE IF NOT EXISTS ' + DOC_STORE$1 +\n ' (id unique, json, winningseq, max_seq INTEGER UNIQUE)';\n var seq = 'CREATE TABLE IF NOT EXISTS ' + BY_SEQ_STORE$1 +\n ' (seq INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' +\n 'json, deleted TINYINT(1), doc_id, rev)';\n var local = 'CREATE TABLE IF NOT EXISTS ' + LOCAL_STORE$1 +\n ' (id UNIQUE, rev, json)';\n\n // creates\n tx.executeSql(attach);\n tx.executeSql(local);\n tx.executeSql(attachAndRev, [], function () {\n tx.executeSql(ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL);\n tx.executeSql(ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL);\n });\n tx.executeSql(doc, [], function () {\n tx.executeSql(DOC_STORE_WINNINGSEQ_INDEX_SQL);\n tx.executeSql(seq, [], function () {\n tx.executeSql(BY_SEQ_STORE_DELETED_INDEX_SQL);\n tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL);\n tx.executeSql(meta, [], function () {\n // mark the db version, and new dbid\n var initSeq = 'INSERT INTO ' + META_STORE$1 +\n ' (db_version, dbid) VALUES (?,?)';\n instanceId = uuid();\n var initSeqArgs = [ADAPTER_VERSION$1, instanceId];\n tx.executeSql(initSeq, initSeqArgs, function () {\n onGetInstanceId();\n });\n });\n });\n });\n } else { // version > 0\n\n var setupDone = function () {\n var migrated = dbVersion < ADAPTER_VERSION$1;\n if (migrated) {\n // update the db version within this transaction\n tx.executeSql('UPDATE ' + META_STORE$1 + ' SET db_version = ' +\n ADAPTER_VERSION$1);\n }\n // notify db.id() callers\n var sql = 'SELECT dbid FROM ' + META_STORE$1;\n tx.executeSql(sql, [], function (tx, result) {\n instanceId = result.rows.item(0).dbid;\n onGetInstanceId();\n });\n };\n\n // would love to use promises here, but then websql\n // ends the transaction early\n var tasks = [\n runMigration2,\n runMigration3,\n runMigration4,\n runMigration5,\n runMigration6,\n runMigration7,\n setupDone\n ];\n\n // run each migration sequentially\n var i = dbVersion;\n var nextMigration = function (tx) {\n tasks[i - 1](tx, nextMigration);\n i++;\n };\n nextMigration(tx);\n }\n }\n\n function setup() {\n db.transaction(function (tx) {\n // first check the encoding\n checkEncoding(tx, function () {\n // then get the version\n fetchVersion(tx);\n });\n }, websqlError(callback), dbCreated);\n }\n\n function fetchVersion(tx) {\n var sql = 'SELECT sql FROM sqlite_master WHERE tbl_name = ' + META_STORE$1;\n tx.executeSql(sql, [], function (tx, result) {\n if (!result.rows.length) {\n // database hasn't even been created yet (version 0)\n onGetVersion(tx, 0);\n } else if (!/db_version/.test(result.rows.item(0).sql)) {\n // table was created, but without the new db_version column,\n // so add it.\n tx.executeSql('ALTER TABLE ' + META_STORE$1 +\n ' ADD COLUMN db_version INTEGER', [], function () {\n // before version 2, this column didn't even exist\n onGetVersion(tx, 1);\n });\n } else { // column exists, we can safely get it\n tx.executeSql('SELECT db_version FROM ' + META_STORE$1,\n [], function (tx, result) {\n var dbVersion = result.rows.item(0).db_version;\n onGetVersion(tx, dbVersion);\n });\n }\n });\n }\n\n setup();\n\n function getMaxSeq(tx, callback) {\n var sql = 'SELECT MAX(seq) AS seq FROM ' + BY_SEQ_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var updateSeq = res.rows.item(0).seq || 0;\n callback(updateSeq);\n });\n }\n\n function countDocs(tx, callback) {\n // count the total rows\n var sql = select(\n 'COUNT(' + DOC_STORE$1 + '.id) AS \\'num\\'',\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n BY_SEQ_STORE$1 + '.deleted=0');\n\n tx.executeSql(sql, [], function (tx, result) {\n callback(result.rows.item(0).num);\n });\n }\n\n api._remote = false;\n api.type = function () {\n return 'websql';\n };\n\n api._id = toPromise(function (callback) {\n callback(null, instanceId);\n });\n\n api._info = function (callback) {\n var seq;\n var docCount;\n db.readTransaction(function (tx) {\n getMaxSeq(tx, function (theSeq) {\n seq = theSeq;\n });\n countDocs(tx, function (theDocCount) {\n docCount = theDocCount;\n });\n }, websqlError(callback), function () {\n callback(null, {\n doc_count: docCount,\n update_seq: seq,\n websql_encoding: encoding\n });\n });\n };\n\n api._bulkDocs = function (req, reqOpts, callback) {\n websqlBulkDocs(opts, req, reqOpts, api, db, websqlChanges, callback);\n };\n\n function latest$$1(tx, id, rev$$1, callback, finish) {\n var sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n DOC_STORE$1 + '.id=?');\n var sqlArgs = [id];\n\n tx.executeSql(sql, sqlArgs, function (a, results) {\n if (!results.rows.length) {\n var err = createError(MISSING_DOC, 'missing');\n return finish(err);\n }\n var item = results.rows.item(0);\n var metadata = safeJsonParse(item.metadata);\n callback(latest(rev$$1, metadata));\n });\n }\n\n api._get = function (id, opts, callback) {\n var doc;\n var metadata;\n var tx = opts.ctx;\n if (!tx) {\n return db.readTransaction(function (txn) {\n api._get(id, $inject_Object_assign({ctx: txn}, opts), callback);\n });\n }\n\n function finish(err) {\n callback(err, {doc: doc, metadata: metadata, ctx: tx});\n }\n\n var sql;\n var sqlArgs;\n\n if (!opts.rev) {\n sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n DOC_STORE$1 + '.id=?');\n sqlArgs = [id];\n } else if (opts.latest) {\n latest$$1(tx, id, opts.rev, function (latestRev) {\n opts.latest = false;\n opts.rev = latestRev;\n api._get(id, opts, callback);\n }, finish);\n return;\n } else {\n sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE$1 + '.id=' + BY_SEQ_STORE$1 + '.doc_id',\n [BY_SEQ_STORE$1 + '.doc_id=?', BY_SEQ_STORE$1 + '.rev=?']);\n sqlArgs = [id, opts.rev];\n }\n\n tx.executeSql(sql, sqlArgs, function (a, results) {\n if (!results.rows.length) {\n var missingErr = createError(MISSING_DOC, 'missing');\n return finish(missingErr);\n }\n var item = results.rows.item(0);\n metadata = safeJsonParse(item.metadata);\n if (item.deleted && !opts.rev) {\n var deletedErr = createError(MISSING_DOC, 'deleted');\n return finish(deletedErr);\n }\n doc = unstringifyDoc(item.data, metadata.id, item.rev);\n finish();\n });\n };\n\n api._allDocs = function (opts, callback) {\n var results = [];\n var totalRows;\n var updateSeq;\n\n var start = 'startkey' in opts ? opts.startkey : false;\n var end = 'endkey' in opts ? opts.endkey : false;\n var key = 'key' in opts ? opts.key : false;\n var keys = 'keys' in opts ? opts.keys : false;\n var descending = 'descending' in opts ? opts.descending : false;\n var limit = 'limit' in opts ? opts.limit : -1;\n var offset = 'skip' in opts ? opts.skip : 0;\n var inclusiveEnd = opts.inclusive_end !== false;\n \n var sqlArgs = [];\n var criteria = [];\n\n if (keys) {\n var destinctKeys = [];\n var bindingStr = \"\";\n keys.forEach(function (key) {\n if (destinctKeys.indexOf(key) === -1) {\n destinctKeys.push(key);\n bindingStr += '?,';\n }\n });\n bindingStr = bindingStr.substring(0, bindingStr.length - 1); // keys is never empty\n criteria.push(DOC_STORE$1 + '.id IN (' + bindingStr + ')');\n sqlArgs = sqlArgs.concat(destinctKeys);\n } else if (key !== false) {\n criteria.push(DOC_STORE$1 + '.id = ?');\n sqlArgs.push(key);\n } else if (start !== false || end !== false) {\n if (start !== false) {\n criteria.push(DOC_STORE$1 + '.id ' + (descending ? '<=' : '>=') + ' ?');\n sqlArgs.push(start);\n }\n if (end !== false) {\n var comparator = descending ? '>' : '<';\n if (inclusiveEnd) {\n comparator += '=';\n }\n criteria.push(DOC_STORE$1 + '.id ' + comparator + ' ?');\n sqlArgs.push(end);\n }\n if (key !== false) {\n criteria.push(DOC_STORE$1 + '.id = ?');\n sqlArgs.push(key);\n }\n }\n\n if (!keys) {\n // report deleted if keys are specified\n criteria.push(BY_SEQ_STORE$1 + '.deleted = 0');\n }\n\n db.readTransaction(function (tx) {\n // count the docs in parallel to other operations\n countDocs(tx, function (docCount) {\n totalRows = docCount;\n });\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n // get max sequence in parallel to other operations\n getMaxSeq(tx, function (theSeq) {\n updateSeq = theSeq;\n });\n }\n\n if (limit === 0) {\n return;\n }\n\n // do a single query to fetch the documents\n var sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n criteria,\n DOC_STORE$1 + '.id ' + (descending ? 'DESC' : 'ASC')\n );\n sql += ' LIMIT ' + limit + ' OFFSET ' + offset;\n\n tx.executeSql(sql, sqlArgs, function (tx, result) {\n for (var i = 0, l = result.rows.length; i < l; i++) {\n var item = result.rows.item(i);\n var metadata = safeJsonParse(item.metadata);\n var id = metadata.id;\n var data = unstringifyDoc(item.data, id, item.rev);\n var winningRev$$1 = data._rev;\n var doc = {\n id: id,\n key: id,\n value: {rev: winningRev$$1}\n };\n if (opts.include_docs) {\n doc.doc = data;\n doc.doc._rev = winningRev$$1;\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n doc.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary$1(doc.doc, opts, api, tx);\n }\n if (item.deleted) {\n if (keys) {\n doc.value.deleted = true;\n doc.doc = null;\n } else {\n // propably should not happen\n continue;\n }\n }\n if (!keys) {\n results.push(doc);\n } else {\n var index = keys.indexOf(id, index);\n do {\n results[index] = doc;\n index = keys.indexOf(id, index + 1);\n } while (index > -1 && index < keys.length);\n }\n }\n if (keys) {\n keys.forEach(function (key, index) {\n if (!results[index]) {\n results[index] = {key: key, error: 'not_found'};\n }\n });\n }\n });\n }, websqlError(callback), function () {\n var returnVal = {\n total_rows: totalRows,\n offset: opts.skip,\n rows: results\n };\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n returnVal.update_seq = updateSeq;\n }\n callback(null, returnVal);\n });\n };\n\n api._changes = function (opts) {\n opts = clone(opts);\n\n if (opts.continuous) {\n var id = api._name + ':' + uuid();\n websqlChanges.addListener(api._name, id, api, opts);\n websqlChanges.notify(api._name);\n return {\n cancel: function () {\n websqlChanges.removeListener(api._name, id);\n }\n };\n }\n\n var descending = opts.descending;\n\n // Ignore the `since` parameter when `descending` is true\n opts.since = opts.since && !descending ? opts.since : 0;\n\n var limit = 'limit' in opts ? opts.limit : -1;\n if (limit === 0) {\n limit = 1; // per CouchDB _changes spec\n }\n\n var returnDocs;\n if ('return_docs' in opts) {\n returnDocs = opts.return_docs;\n } else if ('returnDocs' in opts) {\n // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release\n returnDocs = opts.returnDocs;\n } else {\n returnDocs = true;\n }\n var results = [];\n var numResults = 0;\n\n function fetchChanges() {\n\n var selectStmt =\n DOC_STORE$1 + '.json AS metadata, ' +\n DOC_STORE$1 + '.max_seq AS maxSeq, ' +\n BY_SEQ_STORE$1 + '.json AS winningDoc, ' +\n BY_SEQ_STORE$1 + '.rev AS winningRev ';\n\n var from = DOC_STORE$1 + ' JOIN ' + BY_SEQ_STORE$1;\n\n var joiner = DOC_STORE$1 + '.id=' + BY_SEQ_STORE$1 + '.doc_id' +\n ' AND ' + DOC_STORE$1 + '.winningseq=' + BY_SEQ_STORE$1 + '.seq';\n\n var criteria = ['maxSeq > ?'];\n var sqlArgs = [opts.since];\n\n if (opts.doc_ids) {\n criteria.push(DOC_STORE$1 + '.id IN ' + qMarks(opts.doc_ids.length));\n sqlArgs = sqlArgs.concat(opts.doc_ids);\n }\n\n var orderBy = 'maxSeq ' + (descending ? 'DESC' : 'ASC');\n\n var sql = select(selectStmt, from, joiner, criteria, orderBy);\n\n var filter = filterChange(opts);\n if (!opts.view && !opts.filter) {\n // we can just limit in the query\n sql += ' LIMIT ' + limit;\n }\n\n var lastSeq = opts.since || 0;\n db.readTransaction(function (tx) {\n tx.executeSql(sql, sqlArgs, function (tx, result) {\n function reportChange(change) {\n return function () {\n opts.onChange(change);\n };\n }\n for (var i = 0, l = result.rows.length; i < l; i++) {\n var item = result.rows.item(i);\n var metadata = safeJsonParse(item.metadata);\n lastSeq = item.maxSeq;\n\n var doc = unstringifyDoc(item.winningDoc, metadata.id,\n item.winningRev);\n var change = opts.processChange(doc, metadata, opts);\n change.seq = item.maxSeq;\n\n var filtered = filter(change);\n if (typeof filtered === 'object') {\n return opts.complete(filtered);\n }\n\n if (filtered) {\n numResults++;\n if (returnDocs) {\n results.push(change);\n }\n // process the attachment immediately\n // for the benefit of live listeners\n if (opts.attachments && opts.include_docs) {\n fetchAttachmentsIfNecessary$1(doc, opts, api, tx,\n reportChange(change));\n } else {\n reportChange(change)();\n }\n }\n if (numResults === limit) {\n break;\n }\n }\n });\n }, websqlError(opts.complete), function () {\n if (!opts.continuous) {\n opts.complete(null, {\n results: results,\n last_seq: lastSeq\n });\n }\n });\n }\n\n fetchChanges();\n };\n\n api._close = function (callback) {\n //WebSQL databases do not need to be closed\n callback();\n };\n\n api._getAttachment = function (docId, attachId, attachment, opts, callback) {\n var res;\n var tx = opts.ctx;\n var digest = attachment.digest;\n var type = attachment.content_type;\n var sql = 'SELECT escaped, ' +\n 'CASE WHEN escaped = 1 THEN body ELSE HEX(body) END AS body FROM ' +\n ATTACH_STORE$1 + ' WHERE digest=?';\n tx.executeSql(sql, [digest], function (tx, result) {\n // websql has a bug where \\u0000 causes early truncation in strings\n // and blobs. to work around this, we used to use the hex() function,\n // but that's not performant. after migration 6, we remove \\u0000\n // and add it back in afterwards\n var item = result.rows.item(0);\n var data = item.escaped ? unescapeBlob(item.body) :\n parseHexString(item.body, encoding);\n if (opts.binary) {\n res = binStringToBluffer(data, type);\n } else {\n res = thisBtoa(data);\n }\n callback(null, res);\n });\n };\n\n api._getRevisionTree = function (docId, callback) {\n db.readTransaction(function (tx) {\n var sql = 'SELECT json AS metadata FROM ' + DOC_STORE$1 + ' WHERE id = ?';\n tx.executeSql(sql, [docId], function (tx, result) {\n if (!result.rows.length) {\n callback(createError(MISSING_DOC));\n } else {\n var data = safeJsonParse(result.rows.item(0).metadata);\n callback(null, data.rev_tree);\n }\n });\n });\n };\n\n api._doCompaction = function (docId, revs, callback) {\n if (!revs.length) {\n return callback();\n }\n db.transaction(function (tx) {\n\n // update doc store\n var sql = 'SELECT json AS metadata FROM ' + DOC_STORE$1 + ' WHERE id = ?';\n tx.executeSql(sql, [docId], function (tx, result) {\n var metadata = safeJsonParse(result.rows.item(0).metadata);\n traverseRevTree(metadata.rev_tree, function (isLeaf, pos,\n revHash, ctx, opts) {\n var rev$$1 = pos + '-' + revHash;\n if (revs.indexOf(rev$$1) !== -1) {\n opts.status = 'missing';\n }\n });\n\n var sql = 'UPDATE ' + DOC_STORE$1 + ' SET json = ? WHERE id = ?';\n tx.executeSql(sql, [safeJsonStringify(metadata), docId]);\n });\n\n compactRevs$1(revs, docId, tx);\n }, websqlError(callback), function () {\n callback();\n });\n };\n\n api._getLocal = function (id, callback) {\n db.readTransaction(function (tx) {\n var sql = 'SELECT json, rev FROM ' + LOCAL_STORE$1 + ' WHERE id=?';\n tx.executeSql(sql, [id], function (tx, res) {\n if (res.rows.length) {\n var item = res.rows.item(0);\n var doc = unstringifyDoc(item.json, id, item.rev);\n callback(null, doc);\n } else {\n callback(createError(MISSING_DOC));\n }\n });\n });\n };\n\n api._putLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n delete doc._revisions; // ignore this, trust the rev\n var oldRev = doc._rev;\n var id = doc._id;\n var newRev;\n if (!oldRev) {\n newRev = doc._rev = '0-1';\n } else {\n newRev = doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1);\n }\n var json = stringifyDoc(doc);\n\n var ret;\n function putLocal(tx) {\n var sql;\n var values;\n if (oldRev) {\n sql = 'UPDATE ' + LOCAL_STORE$1 + ' SET rev=?, json=? ' +\n 'WHERE id=? AND rev=?';\n values = [newRev, json, id, oldRev];\n } else {\n sql = 'INSERT INTO ' + LOCAL_STORE$1 + ' (id, rev, json) VALUES (?,?,?)';\n values = [id, newRev, json];\n }\n tx.executeSql(sql, values, function (tx, res) {\n if (res.rowsAffected) {\n ret = {ok: true, id: id, rev: newRev};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n } else {\n callback(createError(REV_CONFLICT));\n }\n }, function () {\n callback(createError(REV_CONFLICT));\n return false; // ack that we handled the error\n });\n }\n\n if (opts.ctx) {\n putLocal(opts.ctx);\n } else {\n db.transaction(putLocal, websqlError(callback), function () {\n if (ret) {\n callback(null, ret);\n }\n });\n }\n };\n\n api._removeLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var ret;\n\n function removeLocal(tx) {\n var sql = 'DELETE FROM ' + LOCAL_STORE$1 + ' WHERE id=? AND rev=?';\n var params = [doc._id, doc._rev];\n tx.executeSql(sql, params, function (tx, res) {\n if (!res.rowsAffected) {\n return callback(createError(MISSING_DOC));\n }\n ret = {ok: true, id: doc._id, rev: '0-0'};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n });\n }\n\n if (opts.ctx) {\n removeLocal(opts.ctx);\n } else {\n db.transaction(removeLocal, websqlError(callback), function () {\n if (ret) {\n callback(null, ret);\n }\n });\n }\n };\n\n api._destroy = function (opts, callback) {\n websqlChanges.removeAllListeners(api._name);\n db.transaction(function (tx) {\n var stores = [DOC_STORE$1, BY_SEQ_STORE$1, ATTACH_STORE$1, META_STORE$1,\n LOCAL_STORE$1, ATTACH_AND_SEQ_STORE$1];\n stores.forEach(function (store) {\n tx.executeSql('DROP TABLE IF EXISTS ' + store, []);\n });\n }, websqlError(callback), function () {\n if (hasLocalStorage()) {\n delete window.localStorage['_pouch__websqldb_' + api._name];\n delete window.localStorage[api._name];\n }\n callback(null, {'ok': true});\n });\n };\n}\n\nfunction canOpenTestDB() {\n try {\n openDatabase('_pouch_validate_websql', 1, '', 1);\n return true;\n } catch (err) {\n return false;\n }\n}\n\n// WKWebView had a bug where WebSQL would throw a DOM Exception 18\n// (see https://bugs.webkit.org/show_bug.cgi?id=137760 and\n// https://github.com/pouchdb/pouchdb/issues/5079)\n// This has been fixed in latest WebKit, so we try to detect it here.\nfunction isValidWebSQL() {\n // WKWebView UA:\n // Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X)\n // AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13C75\n // Chrome for iOS UA:\n // Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en)\n // AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60\n // Mobile/9B206 Safari/7534.48.3\n // Firefox for iOS UA:\n // Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4\n // (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4\n\n // indexedDB is null on some UIWebViews and undefined in others\n // see: https://bugs.webkit.org/show_bug.cgi?id=137034\n if (typeof indexedDB === 'undefined' || indexedDB === null ||\n !/iP(hone|od|ad)/.test(navigator.userAgent)) {\n // definitely not WKWebView, avoid creating an unnecessary database\n return true;\n }\n // Cache the result in LocalStorage. Reason we do this is because if we\n // call openDatabase() too many times, Safari craps out in SauceLabs and\n // starts throwing DOM Exception 14s.\n var hasLS = hasLocalStorage();\n // Include user agent in the hash, so that if Safari is upgraded, we don't\n // continually think it's broken.\n var localStorageKey = '_pouch__websqldb_valid_' + navigator.userAgent;\n if (hasLS && localStorage[localStorageKey]) {\n return localStorage[localStorageKey] === '1';\n }\n var openedTestDB = canOpenTestDB();\n if (hasLS) {\n localStorage[localStorageKey] = openedTestDB ? '1' : '0';\n }\n return openedTestDB;\n}\n\nfunction valid() {\n if (typeof openDatabase !== 'function') {\n return false;\n }\n return isValidWebSQL();\n}\n\nfunction openDB$2(name, version, description, size) {\n // Traditional WebSQL API\n return openDatabase(name, version, description, size);\n}\n\nfunction WebSQLPouch(opts, callback) {\n var msg = 'WebSQL is deprecated and will be removed in future releases of PouchDB. ' +\n 'Please migrate to IndexedDB: https://pouchdb.com/2018/01/23/pouchdb-6.4.2.html';\n guardedConsole('warn', msg);\n var _opts = $inject_Object_assign({\n websql: openDB$2\n }, opts);\n\n WebSqlPouch.call(this, _opts, callback);\n}\n\nWebSQLPouch.valid = valid;\n\nWebSQLPouch.use_prefix = true;\n\nfunction WebSqlPouch$1 (PouchDB) {\n PouchDB.adapter('websql', WebSQLPouch, true);\n}\n\n/* global fetch */\n/* global Headers */\nfunction wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new PouchPromise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n PouchPromise.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n })[\"catch\"](function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n}\n\nfunction fetchRequest(options, callback) {\n var wrappedPromise, timer, response;\n\n var headers = new Headers();\n\n var fetchOptions = {\n method: options.method,\n credentials: 'include',\n headers: headers\n };\n\n if (options.json) {\n headers.set('Accept', 'application/json');\n headers.set('Content-Type', options.headers['Content-Type'] ||\n 'application/json');\n }\n\n if (options.body &&\n options.processData &&\n typeof options.body !== 'string') {\n fetchOptions.body = JSON.stringify(options.body);\n } else if ('body' in options) {\n fetchOptions.body = options.body;\n } else {\n fetchOptions.body = null;\n }\n\n Object.keys(options.headers).forEach(function (key) {\n if (options.headers.hasOwnProperty(key)) {\n headers.set(key, options.headers[key]);\n }\n });\n\n wrappedPromise = wrappedFetch(options.url, fetchOptions);\n\n if (options.timeout > 0) {\n timer = setTimeout(function () {\n wrappedPromise.reject(new Error('Load timeout for resource: ' +\n options.url));\n }, options.timeout);\n }\n\n wrappedPromise.promise.then(function (fetchResponse) {\n response = {\n statusCode: fetchResponse.status\n };\n\n if (options.timeout > 0) {\n clearTimeout(timer);\n }\n\n if (response.statusCode >= 200 && response.statusCode < 300) {\n return options.binary ? fetchResponse.blob() : fetchResponse.text();\n }\n\n return fetchResponse.json();\n }).then(function (result) {\n if (response.statusCode >= 200 && response.statusCode < 300) {\n callback(null, response, result);\n } else {\n result.status = response.statusCode;\n callback(result);\n }\n })[\"catch\"](function (error) {\n if (!error) {\n // this happens when the listener is canceled\n error = new Error('canceled');\n }\n callback(error);\n });\n\n return {abort: wrappedPromise.reject};\n}\n\nfunction xhRequest(options, callback) {\n\n var xhr, timer;\n var timedout = false;\n\n var abortReq = function () {\n xhr.abort();\n cleanUp();\n };\n\n var timeoutReq = function () {\n timedout = true;\n xhr.abort();\n cleanUp();\n };\n\n var ret = {abort: abortReq};\n\n var cleanUp = function () {\n clearTimeout(timer);\n ret.abort = function () {};\n if (xhr) {\n xhr.onprogress = undefined;\n if (xhr.upload) {\n xhr.upload.onprogress = undefined;\n }\n xhr.onreadystatechange = undefined;\n xhr = undefined;\n }\n };\n\n if (options.xhr) {\n xhr = new options.xhr();\n } else {\n xhr = new XMLHttpRequest();\n }\n\n try {\n xhr.open(options.method, options.url);\n } catch (exception) {\n return callback(new Error(exception.name || 'Url is invalid'));\n }\n\n xhr.withCredentials = ('withCredentials' in options) ?\n options.withCredentials : true;\n\n if (options.method === 'GET') {\n delete options.headers['Content-Type'];\n } else if (options.json) {\n options.headers.Accept = 'application/json';\n options.headers['Content-Type'] = options.headers['Content-Type'] ||\n 'application/json';\n if (options.body &&\n options.processData &&\n typeof options.body !== \"string\") {\n options.body = JSON.stringify(options.body);\n }\n }\n\n if (options.binary) {\n xhr.responseType = 'arraybuffer';\n }\n\n if (!('body' in options)) {\n options.body = null;\n }\n\n for (var key in options.headers) {\n if (options.headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, options.headers[key]);\n }\n }\n\n if (options.timeout > 0) {\n timer = setTimeout(timeoutReq, options.timeout);\n xhr.onprogress = function () {\n clearTimeout(timer);\n if (xhr.readyState !== 4) {\n timer = setTimeout(timeoutReq, options.timeout);\n }\n };\n if (typeof xhr.upload !== 'undefined') { // does not exist in ie9\n xhr.upload.onprogress = xhr.onprogress;\n }\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState !== 4) {\n return;\n }\n\n var response = {\n statusCode: xhr.status\n };\n\n if (xhr.status >= 200 && xhr.status < 300) {\n var data;\n if (options.binary) {\n data = createBlob([xhr.response || ''], {\n type: xhr.getResponseHeader('Content-Type')\n });\n } else {\n data = xhr.responseText;\n }\n callback(null, response, data);\n } else {\n var err = {};\n if (timedout) {\n err = new Error('ETIMEDOUT');\n err.code = 'ETIMEDOUT';\n } else if (typeof xhr.response === 'string' && xhr.response !== '') {\n try {\n err = JSON.parse(xhr.response);\n } catch (e) {}\n }\n\n err.status = xhr.status;\n\n callback(err);\n }\n cleanUp();\n };\n\n if (options.body && (options.body instanceof Blob)) {\n readAsArrayBuffer(options.body, function (arrayBuffer) {\n xhr.send(arrayBuffer);\n });\n } else {\n xhr.send(options.body);\n }\n\n return ret;\n}\n\nfunction testXhr() {\n try {\n new XMLHttpRequest();\n return true;\n } catch (err) {\n return false;\n }\n}\n\nvar hasXhr = testXhr();\n\nfunction ajax(options, callback) {\n if (!false && (hasXhr || options.xhr)) {\n return xhRequest(options, callback);\n } else {\n return fetchRequest(options, callback);\n }\n}\n\n// the blob already has a type; do nothing\n\nfunction defaultBody() {\n return '';\n}\n\nfunction ajaxCore(options, callback) {\n\n options = clone(options);\n\n var defaultOptions = {\n method : \"GET\",\n headers: {},\n json: true,\n processData: true,\n timeout: 10000,\n cache: false\n };\n\n options = $inject_Object_assign(defaultOptions, options);\n\n function onSuccess(obj, resp, cb) {\n if (!options.binary && options.json && typeof obj === 'string') {\n /* istanbul ignore next */\n try {\n obj = JSON.parse(obj);\n } catch (e) {\n // Probably a malformed JSON from server\n return cb(e);\n }\n }\n if (Array.isArray(obj)) {\n obj = obj.map(function (v) {\n if (v.error || v.missing) {\n return generateErrorFromResponse(v);\n } else {\n return v;\n }\n });\n }\n if (options.binary) {\n \n }\n cb(null, obj, resp);\n }\n\n if (options.json) {\n if (!options.binary) {\n options.headers.Accept = 'application/json';\n }\n options.headers['Content-Type'] = options.headers['Content-Type'] ||\n 'application/json';\n }\n\n if (options.binary) {\n options.encoding = null;\n options.json = false;\n }\n\n if (!options.processData) {\n options.json = false;\n }\n\n return ajax(options, function (err, response, body) {\n\n if (err) {\n return callback(generateErrorFromResponse(err));\n }\n\n var error;\n var content_type = response.headers && response.headers['content-type'];\n var data = body || defaultBody();\n\n // CouchDB doesn't always return the right content-type for JSON data, so\n // we check for ^{ and }$ (ignoring leading/trailing whitespace)\n if (!options.binary && (options.json || !options.processData) &&\n typeof data !== 'object' &&\n (/json/.test(content_type) ||\n (/^[\\s]*\\{/.test(data) && /\\}[\\s]*$/.test(data)))) {\n try {\n data = JSON.parse(data.toString());\n } catch (e) {}\n }\n\n if (response.statusCode >= 200 && response.statusCode < 300) {\n onSuccess(data, response, callback);\n } else {\n error = generateErrorFromResponse(data);\n error.status = response.statusCode;\n callback(error);\n }\n });\n}\n\nfunction ajax$1(opts, callback) {\n\n // cache-buster, specifically designed to work around IE's aggressive caching\n // see http://www.dashbay.com/2011/05/internet-explorer-caches-ajax/\n // Also Safari caches POSTs, so we need to cache-bust those too.\n var ua = (navigator && navigator.userAgent) ?\n navigator.userAgent.toLowerCase() : '';\n\n var isSafari = ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1;\n var isIE = ua.indexOf('msie') !== -1;\n var isTrident = ua.indexOf('trident') !== -1;\n var isEdge = ua.indexOf('edge') !== -1;\n\n // it appears the new version of safari also caches GETs,\n // see https://github.com/pouchdb/pouchdb/issues/5010\n var shouldCacheBust = (isSafari ||\n ((isIE || isTrident || isEdge) && opts.method === 'GET'));\n\n var cache = 'cache' in opts ? opts.cache : true;\n\n var isBlobUrl = /^blob:/.test(opts.url); // don't append nonces for blob URLs\n\n if (!isBlobUrl && (shouldCacheBust || !cache)) {\n var hasArgs = opts.url.indexOf('?') !== -1;\n opts.url += (hasArgs ? '&' : '?') + '_nonce=' + Date.now();\n }\n\n return ajaxCore(opts, callback);\n}\n\n// dead simple promise pool, inspired by https://github.com/timdp/es6-promise-pool\n// but much smaller in code size. limits the number of concurrent promises that are executed\n\n\nfunction pool(promiseFactories, limit) {\n return new PouchPromise(function (resolve, reject) {\n var running = 0;\n var current = 0;\n var done = 0;\n var len = promiseFactories.length;\n var err;\n\n function runNext() {\n running++;\n promiseFactories[current++]().then(onSuccess, onError);\n }\n\n function doNext() {\n if (++done === len) {\n /* istanbul ignore if */\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n } else {\n runNextBatch();\n }\n }\n\n function onSuccess() {\n running--;\n doNext();\n }\n\n /* istanbul ignore next */\n function onError(thisErr) {\n running--;\n err = err || thisErr;\n doNext();\n }\n\n function runNextBatch() {\n while (running < limit && current < len) {\n runNext();\n }\n }\n\n runNextBatch();\n });\n}\n\nvar CHANGES_BATCH_SIZE = 25;\nvar MAX_SIMULTANEOUS_REVS = 50;\nvar CHANGES_TIMEOUT_BUFFER = 5000;\nvar DEFAULT_HEARTBEAT = 10000;\n\nvar supportsBulkGetMap = {};\n\nfunction readAttachmentsAsBlobOrBuffer(row) {\n var doc = row.doc || row.ok;\n var atts = doc._attachments;\n if (!atts) {\n return;\n }\n Object.keys(atts).forEach(function (filename) {\n var att = atts[filename];\n att.data = b64ToBluffer(att.data, att.content_type);\n });\n}\n\nfunction encodeDocId(id) {\n if (/^_design/.test(id)) {\n return '_design/' + encodeURIComponent(id.slice(8));\n }\n if (/^_local/.test(id)) {\n return '_local/' + encodeURIComponent(id.slice(7));\n }\n return encodeURIComponent(id);\n}\n\nfunction preprocessAttachments$2(doc) {\n if (!doc._attachments || !Object.keys(doc._attachments)) {\n return PouchPromise.resolve();\n }\n\n return PouchPromise.all(Object.keys(doc._attachments).map(function (key) {\n var attachment = doc._attachments[key];\n if (attachment.data && typeof attachment.data !== 'string') {\n return new PouchPromise(function (resolve) {\n blobToBase64(attachment.data, resolve);\n }).then(function (b64) {\n attachment.data = b64;\n });\n }\n }));\n}\n\nfunction hasUrlPrefix(opts) {\n if (!opts.prefix) {\n return false;\n }\n\n var protocol = parseUri(opts.prefix).protocol;\n\n return protocol === 'http' || protocol === 'https';\n}\n\n// Get all the information you possibly can about the URI given by name and\n// return it as a suitable object.\nfunction getHost(name, opts) {\n\n // encode db name if opts.prefix is a url (#5574)\n if (hasUrlPrefix(opts)) {\n var dbName = opts.name.substr(opts.prefix.length);\n name = opts.prefix + encodeURIComponent(dbName);\n }\n\n // Prase the URI into all its little bits\n var uri = parseUri(name);\n\n // Store the user and password as a separate auth object\n if (uri.user || uri.password) {\n uri.auth = {username: uri.user, password: uri.password};\n }\n\n // Split the path part of the URI into parts using '/' as the delimiter\n // after removing any leading '/' and any trailing '/'\n var parts = uri.path.replace(/(^\\/|\\/$)/g, '').split('/');\n\n // Store the first part as the database name and remove it from the parts\n // array\n uri.db = parts.pop();\n // Prevent double encoding of URI component\n if (uri.db.indexOf('%') === -1) {\n uri.db = encodeURIComponent(uri.db);\n }\n\n // Restore the path by joining all the remaining parts (all the parts\n // except for the database name) with '/'s\n uri.path = parts.join('/');\n\n return uri;\n}\n\n// Generate a URL with the host data given by opts and the given path\nfunction genDBUrl(opts, path) {\n return genUrl(opts, opts.db + '/' + path);\n}\n\n// Generate a URL with the host data given by opts and the given path\nfunction genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}\n\nfunction paramsToStr(params) {\n return '?' + Object.keys(params).map(function (k) {\n return k + '=' + encodeURIComponent(params[k]);\n }).join('&');\n}\n\n// Implements the PouchDB API for dealing with CouchDB instances over HTTP\nfunction HttpPouch(opts, callback) {\n\n // The functions that will be publicly available for HttpPouch\n var api = this;\n\n var host = getHost(opts.name, opts);\n var dbUrl = genDBUrl(host, '');\n\n opts = clone(opts);\n var ajaxOpts = opts.ajax || {};\n\n if (opts.auth || host.auth) {\n var nAuth = opts.auth || host.auth;\n var str = nAuth.username + ':' + nAuth.password;\n var token = thisBtoa(unescape(encodeURIComponent(str)));\n ajaxOpts.headers = ajaxOpts.headers || {};\n ajaxOpts.headers.Authorization = 'Basic ' + token;\n }\n\n // Not strictly necessary, but we do this because numerous tests\n // rely on swapping ajax in and out.\n api._ajax = ajax$1;\n\n function ajax(userOpts, options, callback) {\n var reqAjax = (userOpts || {}).ajax || {};\n var reqOpts = $inject_Object_assign(clone(ajaxOpts), reqAjax, options);\n var defaultHeaders = clone(ajaxOpts.headers || {});\n reqOpts.headers = $inject_Object_assign(defaultHeaders, reqAjax.headers,\n options.headers || {});\n /* istanbul ignore if */\n if (api.constructor.listeners('debug').length) {\n api.constructor.emit('debug', ['http', reqOpts.method, reqOpts.url]);\n }\n return api._ajax(reqOpts, callback);\n }\n\n function ajaxPromise(userOpts, opts) {\n return new PouchPromise(function (resolve, reject) {\n ajax(userOpts, opts, function (err, res) {\n /* istanbul ignore if */\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }\n\n function adapterFun$$1(name, fun) {\n return adapterFun(name, getArguments(function (args) {\n setup().then(function () {\n return fun.apply(this, args);\n })[\"catch\"](function (e) {\n var callback = args.pop();\n callback(e);\n });\n }));\n }\n\n var setupPromise;\n\n function setup() {\n // TODO: Remove `skipSetup` in favor of `skip_setup` in a future release\n if (opts.skipSetup || opts.skip_setup) {\n return PouchPromise.resolve();\n }\n\n // If there is a setup in process or previous successful setup\n // done then we will use that\n // If previous setups have been rejected we will try again\n if (setupPromise) {\n return setupPromise;\n }\n\n var checkExists = {method: 'GET', url: dbUrl};\n setupPromise = ajaxPromise({}, checkExists)[\"catch\"](function (err) {\n if (err && err.status && err.status === 404) {\n // Doesnt exist, create it\n explainError(404, 'PouchDB is just detecting if the remote exists.');\n return ajaxPromise({}, {method: 'PUT', url: dbUrl});\n } else {\n return PouchPromise.reject(err);\n }\n })[\"catch\"](function (err) {\n // If we try to create a database that already exists, skipped in\n // istanbul since its catching a race condition.\n /* istanbul ignore if */\n if (err && err.status && err.status === 412) {\n return true;\n }\n return PouchPromise.reject(err);\n });\n\n setupPromise[\"catch\"](function () {\n setupPromise = null;\n });\n\n return setupPromise;\n }\n\n nextTick(function () {\n callback(null, api);\n });\n\n api._remote = true;\n /* istanbul ignore next */\n api.type = function () {\n return 'http';\n };\n\n api.id = adapterFun$$1('id', function (callback) {\n ajax({}, {method: 'GET', url: genUrl(host, '')}, function (err, result) {\n var uuid$$1 = (result && result.uuid) ?\n (result.uuid + host.db) : genDBUrl(host, '');\n callback(null, uuid$$1);\n });\n });\n\n api.request = adapterFun$$1('request', function (options, callback) {\n options.url = genDBUrl(host, options.url);\n ajax({}, options, callback);\n });\n\n // Sends a POST request to the host calling the couchdb _compact function\n // version: The version of CouchDB it is running\n api.compact = adapterFun$$1('compact', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = clone(opts);\n ajax(opts, {\n url: genDBUrl(host, '_compact'),\n method: 'POST'\n }, function () {\n function ping() {\n api.info(function (err, res) {\n // CouchDB may send a \"compact_running:true\" if it's\n // already compacting. PouchDB Server doesn't.\n /* istanbul ignore else */\n if (res && !res.compact_running) {\n callback(null, {ok: true});\n } else {\n setTimeout(ping, opts.interval || 200);\n }\n });\n }\n // Ping the http if it's finished compaction\n ping();\n });\n });\n\n api.bulkGet = adapterFun('bulkGet', function (opts, callback) {\n var self = this;\n\n function doBulkGet(cb) {\n var params = {};\n if (opts.revs) {\n params.revs = true;\n }\n if (opts.attachments) {\n /* istanbul ignore next */\n params.attachments = true;\n }\n if (opts.latest) {\n params.latest = true;\n }\n ajax(opts, {\n url: genDBUrl(host, '_bulk_get' + paramsToStr(params)),\n method: 'POST',\n body: { docs: opts.docs}\n }, function (err, result) {\n if (!err && opts.attachments && opts.binary) {\n result.results.forEach(function (res) {\n res.docs.forEach(readAttachmentsAsBlobOrBuffer);\n });\n }\n cb(err, result);\n });\n }\n\n /* istanbul ignore next */\n function doBulkGetShim() {\n // avoid \"url too long error\" by splitting up into multiple requests\n var batchSize = MAX_SIMULTANEOUS_REVS;\n var numBatches = Math.ceil(opts.docs.length / batchSize);\n var numDone = 0;\n var results = new Array(numBatches);\n\n function onResult(batchNum) {\n return function (err, res) {\n // err is impossible because shim returns a list of errs in that case\n results[batchNum] = res.results;\n if (++numDone === numBatches) {\n callback(null, {results: flatten(results)});\n }\n };\n }\n\n for (var i = 0; i < numBatches; i++) {\n var subOpts = pick(opts, ['revs', 'attachments', 'binary', 'latest']);\n subOpts.ajax = ajaxOpts;\n subOpts.docs = opts.docs.slice(i * batchSize,\n Math.min(opts.docs.length, (i + 1) * batchSize));\n bulkGet(self, subOpts, onResult(i));\n }\n }\n\n // mark the whole database as either supporting or not supporting _bulk_get\n var dbUrl = genUrl(host, '');\n var supportsBulkGet = supportsBulkGetMap[dbUrl];\n\n /* istanbul ignore next */\n if (typeof supportsBulkGet !== 'boolean') {\n // check if this database supports _bulk_get\n doBulkGet(function (err, res) {\n if (err) {\n supportsBulkGetMap[dbUrl] = false;\n explainError(\n err.status,\n 'PouchDB is just detecting if the remote ' +\n 'supports the _bulk_get API.'\n );\n doBulkGetShim();\n } else {\n supportsBulkGetMap[dbUrl] = true;\n callback(null, res);\n }\n });\n } else if (supportsBulkGet) {\n doBulkGet(callback);\n } else {\n doBulkGetShim();\n }\n });\n\n // Calls GET on the host, which gets back a JSON string containing\n // couchdb: A welcome string\n // version: The version of CouchDB it is running\n api._info = function (callback) {\n setup().then(function () {\n ajax({}, {\n method: 'GET',\n url: genDBUrl(host, '')\n }, function (err, res) {\n /* istanbul ignore next */\n if (err) {\n return callback(err);\n }\n res.host = genDBUrl(host, '');\n callback(null, res);\n });\n })[\"catch\"](callback);\n };\n\n // Get the document with the given id from the database given by host.\n // The id could be solely the _id in the database, or it may be a\n // _design/ID or _local/ID path\n api.get = adapterFun$$1('get', function (id, opts, callback) {\n // If no options were given, set the callback to the second parameter\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = clone(opts);\n\n // List of parameters to add to the GET request\n var params = {};\n\n if (opts.revs) {\n params.revs = true;\n }\n\n if (opts.revs_info) {\n params.revs_info = true;\n }\n\n if (opts.latest) {\n params.latest = true;\n }\n\n if (opts.open_revs) {\n if (opts.open_revs !== \"all\") {\n opts.open_revs = JSON.stringify(opts.open_revs);\n }\n params.open_revs = opts.open_revs;\n }\n\n if (opts.rev) {\n params.rev = opts.rev;\n }\n\n if (opts.conflicts) {\n params.conflicts = opts.conflicts;\n }\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n params.update_seq = opts.update_seq;\n }\n\n id = encodeDocId(id);\n\n // Set the options for the ajax call\n var options = {\n method: 'GET',\n url: genDBUrl(host, id + paramsToStr(params))\n };\n\n function fetchAttachments(doc) {\n var atts = doc._attachments;\n var filenames = atts && Object.keys(atts);\n if (!atts || !filenames.length) {\n return;\n }\n // we fetch these manually in separate XHRs, because\n // Sync Gateway would normally send it back as multipart/mixed,\n // which we cannot parse. Also, this is more efficient than\n // receiving attachments as base64-encoded strings.\n function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }\n\n var promiseFactories = filenames.map(function (filename) {\n return function () {\n return fetch(filename);\n };\n });\n\n // This limits the number of parallel xhr requests to 5 any time\n // to avoid issues with maximum browser request limits\n return pool(promiseFactories, 5);\n }\n\n function fetchAllAttachments(docOrDocs) {\n if (Array.isArray(docOrDocs)) {\n return PouchPromise.all(docOrDocs.map(function (doc) {\n if (doc.ok) {\n return fetchAttachments(doc.ok);\n }\n }));\n }\n return fetchAttachments(docOrDocs);\n }\n\n ajaxPromise(opts, options).then(function (res) {\n return PouchPromise.resolve().then(function () {\n if (opts.attachments) {\n return fetchAllAttachments(res);\n }\n }).then(function () {\n callback(null, res);\n });\n })[\"catch\"](function (e) {\n e.docId = id;\n callback(e);\n });\n });\n\n // Delete the document given by doc from the database given by host.\n api.remove = adapterFun$$1('remove',\n function (docOrId, optsOrRev, opts, callback) {\n var doc;\n if (typeof optsOrRev === 'string') {\n // id, rev, opts, callback style\n doc = {\n _id: docOrId,\n _rev: optsOrRev\n };\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n } else {\n // doc, opts, callback style\n doc = docOrId;\n if (typeof optsOrRev === 'function') {\n callback = optsOrRev;\n opts = {};\n } else {\n callback = opts;\n opts = optsOrRev;\n }\n }\n\n var rev$$1 = (doc._rev || opts.rev);\n\n // Delete the document\n ajax(opts, {\n method: 'DELETE',\n url: genDBUrl(host, encodeDocId(doc._id)) + '?rev=' + rev$$1\n }, callback);\n });\n\n function encodeAttachmentId(attachmentId) {\n return attachmentId.split(\"/\").map(encodeURIComponent).join(\"/\");\n }\n\n // Get the attachment\n api.getAttachment =\n adapterFun$$1('getAttachment', function (docId, attachmentId, opts,\n callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var params = opts.rev ? ('?rev=' + opts.rev) : '';\n var url = genDBUrl(host, encodeDocId(docId)) + '/' +\n encodeAttachmentId(attachmentId) + params;\n ajax(opts, {\n method: 'GET',\n url: url,\n binary: true\n }, callback);\n });\n\n // Remove the attachment given by the id and rev\n api.removeAttachment =\n adapterFun$$1('removeAttachment', function (docId, attachmentId, rev$$1,\n callback) {\n\n var url = genDBUrl(host, encodeDocId(docId) + '/' +\n encodeAttachmentId(attachmentId)) + '?rev=' + rev$$1;\n\n ajax({}, {\n method: 'DELETE',\n url: url\n }, callback);\n });\n\n // Add the attachment given by blob and its contentType property\n // to the document with the given id, the revision given by rev, and\n // add it to the database given by host.\n api.putAttachment =\n adapterFun$$1('putAttachment', function (docId, attachmentId, rev$$1, blob,\n type, callback) {\n if (typeof type === 'function') {\n callback = type;\n type = blob;\n blob = rev$$1;\n rev$$1 = null;\n }\n var id = encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId);\n var url = genDBUrl(host, id);\n if (rev$$1) {\n url += '?rev=' + rev$$1;\n }\n\n if (typeof blob === 'string') {\n // input is assumed to be a base64 string\n var binary;\n try {\n binary = thisAtob(blob);\n } catch (err) {\n return callback(createError(BAD_ARG,\n 'Attachment is not a valid base64 string'));\n }\n blob = binary ? binStringToBluffer(binary, type) : '';\n }\n\n var opts = {\n headers: {'Content-Type': type},\n method: 'PUT',\n url: url,\n processData: false,\n body: blob,\n timeout: ajaxOpts.timeout || 60000\n };\n // Add the attachment\n ajax({}, opts, callback);\n });\n\n // Update/create multiple documents given by req in the database\n // given by host.\n api._bulkDocs = function (req, opts, callback) {\n // If new_edits=false then it prevents the database from creating\n // new revision numbers for the documents. Instead it just uses\n // the old ones. This is used in database replication.\n req.new_edits = opts.new_edits;\n\n setup().then(function () {\n return PouchPromise.all(req.docs.map(preprocessAttachments$2));\n }).then(function () {\n // Update/create the documents\n ajax(opts, {\n method: 'POST',\n url: genDBUrl(host, '_bulk_docs'),\n timeout: opts.timeout,\n body: req\n }, function (err, results) {\n if (err) {\n return callback(err);\n }\n results.forEach(function (result) {\n result.ok = true; // smooths out cloudant not adding this\n });\n callback(null, results);\n });\n })[\"catch\"](callback);\n };\n\n\n // Update/create document\n api._put = function (doc, opts, callback) {\n setup().then(function () {\n return preprocessAttachments$2(doc);\n }).then(function () {\n // Update/create the document\n ajax(opts, {\n method: 'PUT',\n url: genDBUrl(host, encodeDocId(doc._id)),\n body: doc\n }, function (err, result) {\n if (err) {\n err.docId = doc && doc._id;\n return callback(err);\n }\n callback(null, result);\n });\n })[\"catch\"](callback);\n };\n\n\n // Get a listing of the documents in the database given\n // by host and ordered by increasing id.\n api.allDocs = adapterFun$$1('allDocs', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = clone(opts);\n\n // List of parameters to add to the GET request\n var params = {};\n var body;\n var method = 'GET';\n\n if (opts.conflicts) {\n params.conflicts = true;\n }\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n params.update_seq = true;\n }\n\n if (opts.descending) {\n params.descending = true;\n }\n\n if (opts.include_docs) {\n params.include_docs = true;\n }\n\n // added in CouchDB 1.6.0\n if (opts.attachments) {\n params.attachments = true;\n }\n\n if (opts.key) {\n params.key = JSON.stringify(opts.key);\n }\n\n if (opts.start_key) {\n opts.startkey = opts.start_key;\n }\n\n if (opts.startkey) {\n params.startkey = JSON.stringify(opts.startkey);\n }\n\n if (opts.end_key) {\n opts.endkey = opts.end_key;\n }\n\n if (opts.endkey) {\n params.endkey = JSON.stringify(opts.endkey);\n }\n\n if (typeof opts.inclusive_end !== 'undefined') {\n params.inclusive_end = !!opts.inclusive_end;\n }\n\n if (typeof opts.limit !== 'undefined') {\n params.limit = opts.limit;\n }\n\n if (typeof opts.skip !== 'undefined') {\n params.skip = opts.skip;\n }\n\n var paramStr = paramsToStr(params);\n\n if (typeof opts.keys !== 'undefined') {\n method = 'POST';\n body = {keys: opts.keys};\n }\n\n // Get the document listing\n ajaxPromise(opts, {\n method: method,\n url: genDBUrl(host, '_all_docs' + paramStr),\n body: body\n }).then(function (res) {\n if (opts.include_docs && opts.attachments && opts.binary) {\n res.rows.forEach(readAttachmentsAsBlobOrBuffer);\n }\n callback(null, res);\n })[\"catch\"](callback);\n });\n\n // Get a list of changes made to documents in the database given by host.\n // TODO According to the README, there should be two other methods here,\n // api.changes.addListener and api.changes.removeListener.\n api._changes = function (opts) {\n\n // We internally page the results of a changes request, this means\n // if there is a large set of changes to be returned we can start\n // processing them quicker instead of waiting on the entire\n // set of changes to return and attempting to process them at once\n var batchSize = 'batch_size' in opts ? opts.batch_size : CHANGES_BATCH_SIZE;\n\n opts = clone(opts);\n\n if (opts.continuous && !('heartbeat' in opts)) {\n opts.heartbeat = DEFAULT_HEARTBEAT;\n }\n\n var requestTimeout = ('timeout' in opts) ? opts.timeout :\n ('timeout' in ajaxOpts) ? ajaxOpts.timeout :\n 30 * 1000;\n\n // ensure CHANGES_TIMEOUT_BUFFER applies\n if ('timeout' in opts && opts.timeout &&\n (requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) {\n requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER;\n }\n\n if ('heartbeat' in opts && opts.heartbeat &&\n (requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) {\n requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER;\n }\n\n var params = {};\n if ('timeout' in opts && opts.timeout) {\n params.timeout = opts.timeout;\n }\n\n var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false;\n var returnDocs;\n if ('return_docs' in opts) {\n returnDocs = opts.return_docs;\n } else if ('returnDocs' in opts) {\n // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release\n returnDocs = opts.returnDocs;\n } else {\n returnDocs = true;\n }\n //\n var leftToFetch = limit;\n\n if (opts.style) {\n params.style = opts.style;\n }\n\n if (opts.include_docs || opts.filter && typeof opts.filter === 'function') {\n params.include_docs = true;\n }\n\n if (opts.attachments) {\n params.attachments = true;\n }\n\n if (opts.continuous) {\n params.feed = 'longpoll';\n }\n\n if (opts.seq_interval) {\n params.seq_interval = opts.seq_interval;\n }\n\n if (opts.conflicts) {\n params.conflicts = true;\n }\n\n if (opts.descending) {\n params.descending = true;\n }\n \n /* istanbul ignore if */\n if (opts.update_seq) {\n params.update_seq = true;\n }\n\n if ('heartbeat' in opts) {\n // If the heartbeat value is false, it disables the default heartbeat\n if (opts.heartbeat) {\n params.heartbeat = opts.heartbeat;\n }\n }\n\n if (opts.filter && typeof opts.filter === 'string') {\n params.filter = opts.filter;\n }\n\n if (opts.view && typeof opts.view === 'string') {\n params.filter = '_view';\n params.view = opts.view;\n }\n\n // If opts.query_params exists, pass it through to the changes request.\n // These parameters may be used by the filter on the source database.\n if (opts.query_params && typeof opts.query_params === 'object') {\n for (var param_name in opts.query_params) {\n /* istanbul ignore else */\n if (opts.query_params.hasOwnProperty(param_name)) {\n params[param_name] = opts.query_params[param_name];\n }\n }\n }\n\n var method = 'GET';\n var body;\n\n if (opts.doc_ids) {\n // set this automagically for the user; it's annoying that couchdb\n // requires both a \"filter\" and a \"doc_ids\" param.\n params.filter = '_doc_ids';\n method = 'POST';\n body = {doc_ids: opts.doc_ids };\n }\n /* istanbul ignore next */\n else if (opts.selector) {\n // set this automagically for the user, similar to above\n params.filter = '_selector';\n method = 'POST';\n body = {selector: opts.selector };\n }\n\n var xhr;\n var lastFetchedSeq;\n\n // Get all the changes starting wtih the one immediately after the\n // sequence number given by since.\n var fetch = function (since, callback) {\n if (opts.aborted) {\n return;\n }\n params.since = since;\n // \"since\" can be any kind of json object in Coudant/CouchDB 2.x\n /* istanbul ignore next */\n if (typeof params.since === \"object\") {\n params.since = JSON.stringify(params.since);\n }\n\n if (opts.descending) {\n if (limit) {\n params.limit = leftToFetch;\n }\n } else {\n params.limit = (!limit || leftToFetch > batchSize) ?\n batchSize : leftToFetch;\n }\n\n // Set the options for the ajax call\n var xhrOpts = {\n method: method,\n url: genDBUrl(host, '_changes' + paramsToStr(params)),\n timeout: requestTimeout,\n body: body\n };\n lastFetchedSeq = since;\n\n /* istanbul ignore if */\n if (opts.aborted) {\n return;\n }\n\n // Get the changes\n setup().then(function () {\n xhr = ajax(opts, xhrOpts, callback);\n })[\"catch\"](callback);\n };\n\n // If opts.since exists, get all the changes from the sequence\n // number given by opts.since. Otherwise, get all the changes\n // from the sequence number 0.\n var results = {results: []};\n\n var fetched = function (err, res) {\n if (opts.aborted) {\n return;\n }\n var raw_results_length = 0;\n // If the result of the ajax call (res) contains changes (res.results)\n if (res && res.results) {\n raw_results_length = res.results.length;\n results.last_seq = res.last_seq;\n var pending = null;\n var lastSeq = null;\n // Attach 'pending' property if server supports it (CouchDB 2.0+)\n /* istanbul ignore if */\n if (typeof res.pending === 'number') {\n pending = res.pending;\n }\n if (typeof results.last_seq === 'string' || typeof results.last_seq === 'number') {\n lastSeq = results.last_seq;\n }\n // For each change\n var req = {};\n req.query = opts.query_params;\n res.results = res.results.filter(function (c) {\n leftToFetch--;\n var ret = filterChange(opts)(c);\n if (ret) {\n if (opts.include_docs && opts.attachments && opts.binary) {\n readAttachmentsAsBlobOrBuffer(c);\n }\n if (returnDocs) {\n results.results.push(c);\n }\n opts.onChange(c, pending, lastSeq);\n }\n return ret;\n });\n } else if (err) {\n // In case of an error, stop listening for changes and call\n // opts.complete\n opts.aborted = true;\n opts.complete(err);\n return;\n }\n\n // The changes feed may have timed out with no results\n // if so reuse last update sequence\n if (res && res.last_seq) {\n lastFetchedSeq = res.last_seq;\n }\n\n var finished = (limit && leftToFetch <= 0) ||\n (res && raw_results_length < batchSize) ||\n (opts.descending);\n\n if ((opts.continuous && !(limit && leftToFetch <= 0)) || !finished) {\n // Queue a call to fetch again with the newest sequence number\n nextTick(function () { fetch(lastFetchedSeq, fetched); });\n } else {\n // We're done, call the callback\n opts.complete(null, results);\n }\n };\n\n fetch(opts.since || 0, fetched);\n\n // Return a method to cancel this method from processing any more\n return {\n cancel: function () {\n opts.aborted = true;\n if (xhr) {\n xhr.abort();\n }\n }\n };\n };\n\n // Given a set of document/revision IDs (given by req), tets the subset of\n // those that do NOT correspond to revisions stored in the database.\n // See http://wiki.apache.org/couchdb/HttpPostRevsDiff\n api.revsDiff = adapterFun$$1('revsDiff', function (req, opts, callback) {\n // If no options were given, set the callback to be the second parameter\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n // Get the missing document/revision IDs\n ajax(opts, {\n method: 'POST',\n url: genDBUrl(host, '_revs_diff'),\n body: req\n }, callback);\n });\n\n api._close = function (callback) {\n callback();\n };\n\n api._destroy = function (options, callback) {\n ajax(options, {\n url: genDBUrl(host, ''),\n method: 'DELETE'\n }, function (err, resp) {\n if (err && err.status && err.status !== 404) {\n return callback(err);\n }\n callback(null, resp);\n });\n };\n}\n\n// HttpPouch is a valid adapter.\nHttpPouch.valid = function () {\n return true;\n};\n\nfunction HttpPouch$1 (PouchDB) {\n PouchDB.adapter('http', HttpPouch, false);\n PouchDB.adapter('https', HttpPouch, false);\n}\n\nfunction QueryParseError(message) {\n this.status = 400;\n this.name = 'query_parse_error';\n this.message = message;\n this.error = true;\n try {\n Error.captureStackTrace(this, QueryParseError);\n } catch (e) {}\n}\n\ninherits(QueryParseError, Error);\n\nfunction NotFoundError(message) {\n this.status = 404;\n this.name = 'not_found';\n this.message = message;\n this.error = true;\n try {\n Error.captureStackTrace(this, NotFoundError);\n } catch (e) {}\n}\n\ninherits(NotFoundError, Error);\n\nfunction BuiltInError(message) {\n this.status = 500;\n this.name = 'invalid_value';\n this.message = message;\n this.error = true;\n try {\n Error.captureStackTrace(this, BuiltInError);\n } catch (e) {}\n}\n\ninherits(BuiltInError, Error);\n\nfunction promisedCallback(promise, callback) {\n if (callback) {\n promise.then(function (res) {\n nextTick(function () {\n callback(null, res);\n });\n }, function (reason) {\n nextTick(function () {\n callback(reason);\n });\n });\n }\n return promise;\n}\n\nfunction callbackify(fun) {\n return getArguments(function (args) {\n var cb = args.pop();\n var promise = fun.apply(this, args);\n if (typeof cb === 'function') {\n promisedCallback(promise, cb);\n }\n return promise;\n });\n}\n\n// Promise finally util similar to Q.finally\nfunction fin(promise, finalPromiseFactory) {\n return promise.then(function (res) {\n return finalPromiseFactory().then(function () {\n return res;\n });\n }, function (reason) {\n return finalPromiseFactory().then(function () {\n throw reason;\n });\n });\n}\n\nfunction sequentialize(queue, promiseFactory) {\n return function () {\n var args = arguments;\n var that = this;\n return queue.add(function () {\n return promiseFactory.apply(that, args);\n });\n };\n}\n\n// uniq an array of strings, order not guaranteed\n// similar to underscore/lodash _.uniq\nfunction uniq(arr) {\n var theSet = new ExportedSet(arr);\n var result = new Array(theSet.size);\n var index = -1;\n theSet.forEach(function (value) {\n result[++index] = value;\n });\n return result;\n}\n\nfunction mapToKeysArray(map) {\n var result = new Array(map.size);\n var index = -1;\n map.forEach(function (value, key) {\n result[++index] = key;\n });\n return result;\n}\n\nfunction createBuiltInError(name) {\n var message = 'builtin ' + name +\n ' function requires map values to be numbers' +\n ' or number arrays';\n return new BuiltInError(message);\n}\n\nfunction sum(values) {\n var result = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n if (typeof num !== 'number') {\n if (Array.isArray(num)) {\n // lists of numbers are also allowed, sum them separately\n result = typeof result === 'number' ? [result] : result;\n for (var j = 0, jLen = num.length; j < jLen; j++) {\n var jNum = num[j];\n if (typeof jNum !== 'number') {\n throw createBuiltInError('_sum');\n } else if (typeof result[j] === 'undefined') {\n result.push(jNum);\n } else {\n result[j] += jNum;\n }\n }\n } else { // not array/number\n throw createBuiltInError('_sum');\n }\n } else if (typeof result === 'number') {\n result += num;\n } else { // add number to array\n result[0] += num;\n }\n }\n return result;\n}\n\nvar log = guardedConsole.bind(null, 'log');\nvar isArray = Array.isArray;\nvar toJSON = JSON.parse;\n\nfunction evalFunctionWithEval(func, emit) {\n return scopeEval(\n \"return (\" + func.replace(/;\\s*$/, \"\") + \");\",\n {\n emit: emit,\n sum: sum,\n log: log,\n isArray: isArray,\n toJSON: toJSON\n }\n );\n}\n\n/*\n * Simple task queue to sequentialize actions. Assumes\n * callbacks will eventually fire (once).\n */\n\n\nfunction TaskQueue$2() {\n this.promise = new PouchPromise(function (fulfill) {fulfill(); });\n}\nTaskQueue$2.prototype.add = function (promiseFactory) {\n this.promise = this.promise[\"catch\"](function () {\n // just recover\n }).then(function () {\n return promiseFactory();\n });\n return this.promise;\n};\nTaskQueue$2.prototype.finish = function () {\n return this.promise;\n};\n\nfunction stringify(input) {\n if (!input) {\n return 'undefined'; // backwards compat for empty reduce\n }\n // for backwards compat with mapreduce, functions/strings are stringified\n // as-is. everything else is JSON-stringified.\n switch (typeof input) {\n case 'function':\n // e.g. a mapreduce map\n return input.toString();\n case 'string':\n // e.g. a mapreduce built-in _reduce function\n return input.toString();\n default:\n // e.g. a JSON object in the case of mango queries\n return JSON.stringify(input);\n }\n}\n\n/* create a string signature for a view so we can cache it and uniq it */\nfunction createViewSignature(mapFun, reduceFun) {\n // the \"undefined\" part is for backwards compatibility\n return stringify(mapFun) + stringify(reduceFun) + 'undefined';\n}\n\nfunction createView(sourceDB, viewName, mapFun, reduceFun, temporary, localDocName) {\n var viewSignature = createViewSignature(mapFun, reduceFun);\n\n var cachedViews;\n if (!temporary) {\n // cache this to ensure we don't try to update the same view twice\n cachedViews = sourceDB._cachedViews = sourceDB._cachedViews || {};\n if (cachedViews[viewSignature]) {\n return cachedViews[viewSignature];\n }\n }\n\n var promiseForView = sourceDB.info().then(function (info) {\n\n var depDbName = info.db_name + '-mrview-' +\n (temporary ? 'temp' : stringMd5(viewSignature));\n\n // save the view name in the source db so it can be cleaned up if necessary\n // (e.g. when the _design doc is deleted, remove all associated view data)\n function diffFunction(doc) {\n doc.views = doc.views || {};\n var fullViewName = viewName;\n if (fullViewName.indexOf('/') === -1) {\n fullViewName = viewName + '/' + viewName;\n }\n var depDbs = doc.views[fullViewName] = doc.views[fullViewName] || {};\n /* istanbul ignore if */\n if (depDbs[depDbName]) {\n return; // no update necessary\n }\n depDbs[depDbName] = true;\n return doc;\n }\n return upsert(sourceDB, '_local/' + localDocName, diffFunction).then(function () {\n return sourceDB.registerDependentDatabase(depDbName).then(function (res) {\n var db = res.db;\n db.auto_compaction = true;\n var view = {\n name: depDbName,\n db: db,\n sourceDB: sourceDB,\n adapter: sourceDB.adapter,\n mapFun: mapFun,\n reduceFun: reduceFun\n };\n return view.db.get('_local/lastSeq')[\"catch\"](function (err) {\n /* istanbul ignore if */\n if (err.status !== 404) {\n throw err;\n }\n }).then(function (lastSeqDoc) {\n view.seq = lastSeqDoc ? lastSeqDoc.seq : 0;\n if (cachedViews) {\n view.db.once('destroyed', function () {\n delete cachedViews[viewSignature];\n });\n }\n return view;\n });\n });\n });\n });\n\n if (cachedViews) {\n cachedViews[viewSignature] = promiseForView;\n }\n return promiseForView;\n}\n\nvar persistentQueues = {};\nvar tempViewQueue = new TaskQueue$2();\nvar CHANGES_BATCH_SIZE$1 = 50;\n\nfunction parseViewName(name) {\n // can be either 'ddocname/viewname' or just 'viewname'\n // (where the ddoc name is the same)\n return name.indexOf('/') === -1 ? [name, name] : name.split('/');\n}\n\nfunction isGenOne(changes) {\n // only return true if the current change is 1-\n // and there are no other leafs\n return changes.length === 1 && /^1-/.test(changes[0].rev);\n}\n\nfunction emitError(db, e) {\n try {\n db.emit('error', e);\n } catch (err) {\n guardedConsole('error',\n 'The user\\'s map/reduce function threw an uncaught error.\\n' +\n 'You can debug this error by doing:\\n' +\n 'myDatabase.on(\\'error\\', function (err) { debugger; });\\n' +\n 'Please double-check your map/reduce function.');\n guardedConsole('error', e);\n }\n}\n\n/**\n * Returns an \"abstract\" mapreduce object of the form:\n *\n * {\n * query: queryFun,\n * viewCleanup: viewCleanupFun\n * }\n *\n * Arguments are:\n *\n * localDoc: string\n * This is for the local doc that gets saved in order to track the\n * \"dependent\" DBs and clean them up for viewCleanup. It should be\n * unique, so that indexer plugins don't collide with each other.\n * mapper: function (mapFunDef, emit)\n * Returns a map function based on the mapFunDef, which in the case of\n * normal map/reduce is just the de-stringified function, but may be\n * something else, such as an object in the case of pouchdb-find.\n * reducer: function (reduceFunDef)\n * Ditto, but for reducing. Modules don't have to support reducing\n * (e.g. pouchdb-find).\n * ddocValidator: function (ddoc, viewName)\n * Throws an error if the ddoc or viewName is not valid.\n * This could be a way to communicate to the user that the configuration for the\n * indexer is invalid.\n */\nfunction createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {\n\n function tryMap(db, fun, doc) {\n // emit an event if there was an error thrown by a map function.\n // putting try/catches in a single function also avoids deoptimizations.\n try {\n fun(doc);\n } catch (e) {\n emitError(db, e);\n }\n }\n\n function tryReduce(db, fun, keys, values, rereduce) {\n // same as above, but returning the result or an error. there are two separate\n // functions to avoid extra memory allocations since the tryCode() case is used\n // for custom map functions (common) vs this function, which is only used for\n // custom reduce functions (rare)\n try {\n return {output : fun(keys, values, rereduce)};\n } catch (e) {\n emitError(db, e);\n return {error: e};\n }\n }\n\n function sortByKeyThenValue(x, y) {\n var keyCompare = collate(x.key, y.key);\n return keyCompare !== 0 ? keyCompare : collate(x.value, y.value);\n }\n\n function sliceResults(results, limit, skip) {\n skip = skip || 0;\n if (typeof limit === 'number') {\n return results.slice(skip, limit + skip);\n } else if (skip > 0) {\n return results.slice(skip);\n }\n return results;\n }\n\n function rowToDocId(row) {\n var val = row.value;\n // Users can explicitly specify a joined doc _id, or it\n // defaults to the doc _id that emitted the key/value.\n var docId = (val && typeof val === 'object' && val._id) || row.id;\n return docId;\n }\n\n function readAttachmentsAsBlobOrBuffer(res) {\n res.rows.forEach(function (row) {\n var atts = row.doc && row.doc._attachments;\n if (!atts) {\n return;\n }\n Object.keys(atts).forEach(function (filename) {\n var att = atts[filename];\n atts[filename].data = b64ToBluffer(att.data, att.content_type);\n });\n });\n }\n\n function postprocessAttachments(opts) {\n return function (res) {\n if (opts.include_docs && opts.attachments && opts.binary) {\n readAttachmentsAsBlobOrBuffer(res);\n }\n return res;\n };\n }\n\n function addHttpParam(paramName, opts, params, asJson) {\n // add an http param from opts to params, optionally json-encoded\n var val = opts[paramName];\n if (typeof val !== 'undefined') {\n if (asJson) {\n val = encodeURIComponent(JSON.stringify(val));\n }\n params.push(paramName + '=' + val);\n }\n }\n\n function coerceInteger(integerCandidate) {\n if (typeof integerCandidate !== 'undefined') {\n var asNumber = Number(integerCandidate);\n // prevents e.g. '1foo' or '1.1' being coerced to 1\n if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) {\n return asNumber;\n } else {\n return integerCandidate;\n }\n }\n }\n\n function coerceOptions(opts) {\n opts.group_level = coerceInteger(opts.group_level);\n opts.limit = coerceInteger(opts.limit);\n opts.skip = coerceInteger(opts.skip);\n return opts;\n }\n\n function checkPositiveInteger(number) {\n if (number) {\n if (typeof number !== 'number') {\n return new QueryParseError('Invalid value for integer: \"' +\n number + '\"');\n }\n if (number < 0) {\n return new QueryParseError('Invalid value for positive integer: ' +\n '\"' + number + '\"');\n }\n }\n }\n\n function checkQueryParseError(options, fun) {\n var startkeyName = options.descending ? 'endkey' : 'startkey';\n var endkeyName = options.descending ? 'startkey' : 'endkey';\n\n if (typeof options[startkeyName] !== 'undefined' &&\n typeof options[endkeyName] !== 'undefined' &&\n collate(options[startkeyName], options[endkeyName]) > 0) {\n throw new QueryParseError('No rows can match your key range, ' +\n 'reverse your start_key and end_key or set {descending : true}');\n } else if (fun.reduce && options.reduce !== false) {\n if (options.include_docs) {\n throw new QueryParseError('{include_docs:true} is invalid for reduce');\n } else if (options.keys && options.keys.length > 1 &&\n !options.group && !options.group_level) {\n throw new QueryParseError('Multi-key fetches for reduce views must use ' +\n '{group: true}');\n }\n }\n ['group_level', 'limit', 'skip'].forEach(function (optionName) {\n var error = checkPositiveInteger(options[optionName]);\n if (error) {\n throw error;\n }\n });\n }\n\n function httpQuery(db, fun, opts) {\n // List of parameters to add to the PUT request\n var params = [];\n var body;\n var method = 'GET';\n\n // If opts.reduce exists and is defined, then add it to the list\n // of parameters.\n // If reduce=false then the results are that of only the map function\n // not the final result of map and reduce.\n addHttpParam('reduce', opts, params);\n addHttpParam('include_docs', opts, params);\n addHttpParam('attachments', opts, params);\n addHttpParam('limit', opts, params);\n addHttpParam('descending', opts, params);\n addHttpParam('group', opts, params);\n addHttpParam('group_level', opts, params);\n addHttpParam('skip', opts, params);\n addHttpParam('stale', opts, params);\n addHttpParam('conflicts', opts, params);\n addHttpParam('startkey', opts, params, true);\n addHttpParam('start_key', opts, params, true);\n addHttpParam('endkey', opts, params, true);\n addHttpParam('end_key', opts, params, true);\n addHttpParam('inclusive_end', opts, params);\n addHttpParam('key', opts, params, true);\n addHttpParam('update_seq', opts, params);\n\n // Format the list of parameters into a valid URI query string\n params = params.join('&');\n params = params === '' ? '' : '?' + params;\n\n // If keys are supplied, issue a POST to circumvent GET query string limits\n // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options\n if (typeof opts.keys !== 'undefined') {\n var MAX_URL_LENGTH = 2000;\n // according to http://stackoverflow.com/a/417184/680742,\n // the de facto URL length limit is 2000 characters\n\n var keysAsString =\n 'keys=' + encodeURIComponent(JSON.stringify(opts.keys));\n if (keysAsString.length + params.length + 1 <= MAX_URL_LENGTH) {\n // If the keys are short enough, do a GET. we do this to work around\n // Safari not understanding 304s on POSTs (see pouchdb/pouchdb#1239)\n params += (params[0] === '?' ? '&' : '?') + keysAsString;\n } else {\n method = 'POST';\n if (typeof fun === 'string') {\n body = {keys: opts.keys};\n } else { // fun is {map : mapfun}, so append to this\n fun.keys = opts.keys;\n }\n }\n }\n\n // We are referencing a query defined in the design doc\n if (typeof fun === 'string') {\n var parts = parseViewName(fun);\n return db.request({\n method: method,\n url: '_design/' + parts[0] + '/_view/' + parts[1] + params,\n body: body\n }).then(\n /* istanbul ignore next */\n function (result) {\n // fail the entire request if the result contains an error\n result.rows.forEach(function (row) {\n if (row.value && row.value.error && row.value.error === \"builtin_reduce_error\") {\n throw new Error(row.reason);\n }\n });\n\n return result;\n })\n .then(postprocessAttachments(opts));\n }\n\n // We are using a temporary view, terrible for performance, good for testing\n body = body || {};\n Object.keys(fun).forEach(function (key) {\n if (Array.isArray(fun[key])) {\n body[key] = fun[key];\n } else {\n body[key] = fun[key].toString();\n }\n });\n return db.request({\n method: 'POST',\n url: '_temp_view' + params,\n body: body\n }).then(postprocessAttachments(opts));\n }\n\n // custom adapters can define their own api._query\n // and override the default behavior\n /* istanbul ignore next */\n function customQuery(db, fun, opts) {\n return new PouchPromise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }\n\n // custom adapters can define their own api._viewCleanup\n // and override the default behavior\n /* istanbul ignore next */\n function customViewCleanup(db) {\n return new PouchPromise(function (resolve, reject) {\n db._viewCleanup(function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }\n\n function defaultsTo(value) {\n return function (reason) {\n /* istanbul ignore else */\n if (reason.status === 404) {\n return value;\n } else {\n throw reason;\n }\n };\n }\n\n // returns a promise for a list of docs to update, based on the input docId.\n // the order doesn't matter, because post-3.2.0, bulkDocs\n // is an atomic operation in all three adapters.\n function getDocsToPersist(docId, view, docIdsToChangesAndEmits) {\n var metaDocId = '_local/doc_' + docId;\n var defaultMetaDoc = {_id: metaDocId, keys: []};\n var docData = docIdsToChangesAndEmits.get(docId);\n var indexableKeysToKeyValues = docData[0];\n var changes = docData[1];\n\n function getMetaDoc() {\n if (isGenOne(changes)) {\n // generation 1, so we can safely assume initial state\n // for performance reasons (avoids unnecessary GETs)\n return PouchPromise.resolve(defaultMetaDoc);\n }\n return view.db.get(metaDocId)[\"catch\"](defaultsTo(defaultMetaDoc));\n }\n\n function getKeyValueDocs(metaDoc) {\n if (!metaDoc.keys.length) {\n // no keys, no need for a lookup\n return PouchPromise.resolve({rows: []});\n }\n return view.db.allDocs({\n keys: metaDoc.keys,\n include_docs: true\n });\n }\n\n function processKeyValueDocs(metaDoc, kvDocsRes) {\n var kvDocs = [];\n var oldKeys = new ExportedSet();\n\n for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) {\n var row = kvDocsRes.rows[i];\n var doc = row.doc;\n if (!doc) { // deleted\n continue;\n }\n kvDocs.push(doc);\n oldKeys.add(doc._id);\n doc._deleted = !indexableKeysToKeyValues.has(doc._id);\n if (!doc._deleted) {\n var keyValue = indexableKeysToKeyValues.get(doc._id);\n if ('value' in keyValue) {\n doc.value = keyValue.value;\n }\n }\n }\n var newKeys = mapToKeysArray(indexableKeysToKeyValues);\n newKeys.forEach(function (key) {\n if (!oldKeys.has(key)) {\n // new doc\n var kvDoc = {\n _id: key\n };\n var keyValue = indexableKeysToKeyValues.get(key);\n if ('value' in keyValue) {\n kvDoc.value = keyValue.value;\n }\n kvDocs.push(kvDoc);\n }\n });\n metaDoc.keys = uniq(newKeys.concat(metaDoc.keys));\n kvDocs.push(metaDoc);\n\n return kvDocs;\n }\n\n return getMetaDoc().then(function (metaDoc) {\n return getKeyValueDocs(metaDoc).then(function (kvDocsRes) {\n return processKeyValueDocs(metaDoc, kvDocsRes);\n });\n });\n }\n\n // updates all emitted key/value docs and metaDocs in the mrview database\n // for the given batch of documents from the source database\n function saveKeyValues(view, docIdsToChangesAndEmits, seq) {\n var seqDocId = '_local/lastSeq';\n return view.db.get(seqDocId)[\n \"catch\"](defaultsTo({_id: seqDocId, seq: 0}))\n .then(function (lastSeqDoc) {\n var docIds = mapToKeysArray(docIdsToChangesAndEmits);\n return PouchPromise.all(docIds.map(function (docId) {\n return getDocsToPersist(docId, view, docIdsToChangesAndEmits);\n })).then(function (listOfDocsToPersist) {\n var docsToPersist = flatten(listOfDocsToPersist);\n lastSeqDoc.seq = seq;\n docsToPersist.push(lastSeqDoc);\n // write all docs in a single operation, update the seq once\n return view.db.bulkDocs({docs : docsToPersist});\n });\n });\n }\n\n function getQueue(view) {\n var viewName = typeof view === 'string' ? view : view.name;\n var queue = persistentQueues[viewName];\n if (!queue) {\n queue = persistentQueues[viewName] = new TaskQueue$2();\n }\n return queue;\n }\n\n function updateView(view) {\n return sequentialize(getQueue(view), function () {\n return updateViewInQueue(view);\n })();\n }\n\n function updateViewInQueue(view) {\n // bind the emit function once\n var mapResults;\n var doc;\n\n function emit(key, value) {\n var output = {id: doc._id, key: normalizeKey(key)};\n // Don't explicitly store the value unless it's defined and non-null.\n // This saves on storage space, because often people don't use it.\n if (typeof value !== 'undefined' && value !== null) {\n output.value = normalizeKey(value);\n }\n mapResults.push(output);\n }\n\n var mapFun = mapper(view.mapFun, emit);\n\n var currentSeq = view.seq || 0;\n\n function processChange(docIdsToChangesAndEmits, seq) {\n return function () {\n return saveKeyValues(view, docIdsToChangesAndEmits, seq);\n };\n }\n\n var queue = new TaskQueue$2();\n\n function processNextBatch() {\n return view.sourceDB.changes({\n conflicts: true,\n include_docs: true,\n style: 'all_docs',\n since: currentSeq,\n limit: CHANGES_BATCH_SIZE$1\n }).then(processBatch);\n }\n\n function processBatch(response) {\n var results = response.results;\n if (!results.length) {\n return;\n }\n var docIdsToChangesAndEmits = createDocIdsToChangesAndEmits(results);\n queue.add(processChange(docIdsToChangesAndEmits, currentSeq));\n if (results.length < CHANGES_BATCH_SIZE$1) {\n return;\n }\n return processNextBatch();\n }\n\n function createDocIdsToChangesAndEmits(results) {\n var docIdsToChangesAndEmits = new ExportedMap();\n for (var i = 0, len = results.length; i < len; i++) {\n var change = results[i];\n if (change.doc._id[0] !== '_') {\n mapResults = [];\n doc = change.doc;\n\n if (!doc._deleted) {\n tryMap(view.sourceDB, mapFun, doc);\n }\n mapResults.sort(sortByKeyThenValue);\n\n var indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults);\n docIdsToChangesAndEmits.set(change.doc._id, [\n indexableKeysToKeyValues,\n change.changes\n ]);\n }\n currentSeq = change.seq;\n }\n return docIdsToChangesAndEmits;\n }\n\n function createIndexableKeysToKeyValues(mapResults) {\n var indexableKeysToKeyValues = new ExportedMap();\n var lastKey;\n for (var i = 0, len = mapResults.length; i < len; i++) {\n var emittedKeyValue = mapResults[i];\n var complexKey = [emittedKeyValue.key, emittedKeyValue.id];\n if (i > 0 && collate(emittedKeyValue.key, lastKey) === 0) {\n complexKey.push(i); // dup key+id, so make it unique\n }\n indexableKeysToKeyValues.set(toIndexableString(complexKey), emittedKeyValue);\n lastKey = emittedKeyValue.key;\n }\n return indexableKeysToKeyValues;\n }\n\n return processNextBatch().then(function () {\n return queue.finish();\n }).then(function () {\n view.seq = currentSeq;\n });\n }\n\n function reduceView(view, results, options) {\n if (options.group_level === 0) {\n delete options.group_level;\n }\n\n var shouldGroup = options.group || options.group_level;\n\n var reduceFun = reducer(view.reduceFun);\n\n var groups = [];\n var lvl = isNaN(options.group_level) ? Number.POSITIVE_INFINITY :\n options.group_level;\n results.forEach(function (e) {\n var last = groups[groups.length - 1];\n var groupKey = shouldGroup ? e.key : null;\n\n // only set group_level for array keys\n if (shouldGroup && Array.isArray(groupKey)) {\n groupKey = groupKey.slice(0, lvl);\n }\n\n if (last && collate(last.groupKey, groupKey) === 0) {\n last.keys.push([e.key, e.id]);\n last.values.push(e.value);\n return;\n }\n groups.push({\n keys: [[e.key, e.id]],\n values: [e.value],\n groupKey: groupKey\n });\n });\n results = [];\n for (var i = 0, len = groups.length; i < len; i++) {\n var e = groups[i];\n var reduceTry = tryReduce(view.sourceDB, reduceFun, e.keys, e.values, false);\n if (reduceTry.error && reduceTry.error instanceof BuiltInError) {\n // CouchDB returns an error if a built-in errors out\n throw reduceTry.error;\n }\n results.push({\n // CouchDB just sets the value to null if a non-built-in errors out\n value: reduceTry.error ? null : reduceTry.output,\n key: e.groupKey\n });\n }\n // no total_rows/offset when reducing\n return {rows: sliceResults(results, options.limit, options.skip)};\n }\n\n function queryView(view, opts) {\n return sequentialize(getQueue(view), function () {\n return queryViewInQueue(view, opts);\n })();\n }\n\n function queryViewInQueue(view, opts) {\n var totalRows;\n var shouldReduce = view.reduceFun && opts.reduce !== false;\n var skip = opts.skip || 0;\n if (typeof opts.keys !== 'undefined' && !opts.keys.length) {\n // equivalent query\n opts.limit = 0;\n delete opts.keys;\n }\n\n function fetchFromView(viewOpts) {\n viewOpts.include_docs = true;\n return view.db.allDocs(viewOpts).then(function (res) {\n totalRows = res.total_rows;\n return res.rows.map(function (result) {\n\n // implicit migration - in older versions of PouchDB,\n // we explicitly stored the doc as {id: ..., key: ..., value: ...}\n // this is tested in a migration test\n /* istanbul ignore next */\n if ('value' in result.doc && typeof result.doc.value === 'object' &&\n result.doc.value !== null) {\n var keys = Object.keys(result.doc.value).sort();\n // this detection method is not perfect, but it's unlikely the user\n // emitted a value which was an object with these 3 exact keys\n var expectedKeys = ['id', 'key', 'value'];\n if (!(keys < expectedKeys || keys > expectedKeys)) {\n return result.doc.value;\n }\n }\n\n var parsedKeyAndDocId = parseIndexableString(result.doc._id);\n return {\n key: parsedKeyAndDocId[0],\n id: parsedKeyAndDocId[1],\n value: ('value' in result.doc ? result.doc.value : null)\n };\n });\n });\n }\n\n function onMapResultsReady(rows) {\n var finalResults;\n if (shouldReduce) {\n finalResults = reduceView(view, rows, opts);\n } else {\n finalResults = {\n total_rows: totalRows,\n offset: skip,\n rows: rows\n };\n }\n /* istanbul ignore if */\n if (opts.update_seq) {\n finalResults.update_seq = view.seq;\n }\n if (opts.include_docs) {\n var docIds = uniq(rows.map(rowToDocId));\n\n return view.sourceDB.allDocs({\n keys: docIds,\n include_docs: true,\n conflicts: opts.conflicts,\n attachments: opts.attachments,\n binary: opts.binary\n }).then(function (allDocsRes) {\n var docIdsToDocs = new ExportedMap();\n allDocsRes.rows.forEach(function (row) {\n docIdsToDocs.set(row.id, row.doc);\n });\n rows.forEach(function (row) {\n var docId = rowToDocId(row);\n var doc = docIdsToDocs.get(docId);\n if (doc) {\n row.doc = doc;\n }\n });\n return finalResults;\n });\n } else {\n return finalResults;\n }\n }\n\n if (typeof opts.keys !== 'undefined') {\n var keys = opts.keys;\n var fetchPromises = keys.map(function (key) {\n var viewOpts = {\n startkey : toIndexableString([key]),\n endkey : toIndexableString([key, {}])\n };\n /* istanbul ignore if */\n if (opts.update_seq) {\n viewOpts.update_seq = true;\n }\n return fetchFromView(viewOpts);\n });\n return PouchPromise.all(fetchPromises).then(flatten).then(onMapResultsReady);\n } else { // normal query, no 'keys'\n var viewOpts = {\n descending : opts.descending\n };\n /* istanbul ignore if */\n if (opts.update_seq) {\n viewOpts.update_seq = true;\n }\n var startkey;\n var endkey;\n if ('start_key' in opts) {\n startkey = opts.start_key;\n }\n if ('startkey' in opts) {\n startkey = opts.startkey;\n }\n if ('end_key' in opts) {\n endkey = opts.end_key;\n }\n if ('endkey' in opts) {\n endkey = opts.endkey;\n }\n if (typeof startkey !== 'undefined') {\n viewOpts.startkey = opts.descending ?\n toIndexableString([startkey, {}]) :\n toIndexableString([startkey]);\n }\n if (typeof endkey !== 'undefined') {\n var inclusiveEnd = opts.inclusive_end !== false;\n if (opts.descending) {\n inclusiveEnd = !inclusiveEnd;\n }\n\n viewOpts.endkey = toIndexableString(\n inclusiveEnd ? [endkey, {}] : [endkey]);\n }\n if (typeof opts.key !== 'undefined') {\n var keyStart = toIndexableString([opts.key]);\n var keyEnd = toIndexableString([opts.key, {}]);\n if (viewOpts.descending) {\n viewOpts.endkey = keyStart;\n viewOpts.startkey = keyEnd;\n } else {\n viewOpts.startkey = keyStart;\n viewOpts.endkey = keyEnd;\n }\n }\n if (!shouldReduce) {\n if (typeof opts.limit === 'number') {\n viewOpts.limit = opts.limit;\n }\n viewOpts.skip = skip;\n }\n return fetchFromView(viewOpts).then(onMapResultsReady);\n }\n }\n\n function httpViewCleanup(db) {\n return db.request({\n method: 'POST',\n url: '_view_cleanup'\n });\n }\n\n function localViewCleanup(db) {\n return db.get('_local/' + localDocName).then(function (metaDoc) {\n var docsToViews = new ExportedMap();\n Object.keys(metaDoc.views).forEach(function (fullViewName) {\n var parts = parseViewName(fullViewName);\n var designDocName = '_design/' + parts[0];\n var viewName = parts[1];\n var views = docsToViews.get(designDocName);\n if (!views) {\n views = new ExportedSet();\n docsToViews.set(designDocName, views);\n }\n views.add(viewName);\n });\n var opts = {\n keys : mapToKeysArray(docsToViews),\n include_docs : true\n };\n return db.allDocs(opts).then(function (res) {\n var viewsToStatus = {};\n res.rows.forEach(function (row) {\n var ddocName = row.key.substring(8); // cuts off '_design/'\n docsToViews.get(row.key).forEach(function (viewName) {\n var fullViewName = ddocName + '/' + viewName;\n /* istanbul ignore if */\n if (!metaDoc.views[fullViewName]) {\n // new format, without slashes, to support PouchDB 2.2.0\n // migration test in pouchdb's browser.migration.js verifies this\n fullViewName = viewName;\n }\n var viewDBNames = Object.keys(metaDoc.views[fullViewName]);\n // design doc deleted, or view function nonexistent\n var statusIsGood = row.doc && row.doc.views &&\n row.doc.views[viewName];\n viewDBNames.forEach(function (viewDBName) {\n viewsToStatus[viewDBName] =\n viewsToStatus[viewDBName] || statusIsGood;\n });\n });\n });\n var dbsToDelete = Object.keys(viewsToStatus).filter(\n function (viewDBName) { return !viewsToStatus[viewDBName]; });\n var destroyPromises = dbsToDelete.map(function (viewDBName) {\n return sequentialize(getQueue(viewDBName), function () {\n return new db.constructor(viewDBName, db.__opts).destroy();\n })();\n });\n return PouchPromise.all(destroyPromises).then(function () {\n return {ok: true};\n });\n });\n }, defaultsTo({ok: true}));\n }\n\n function queryPromised(db, fun, opts) {\n /* istanbul ignore next */\n if (typeof db._query === 'function') {\n return customQuery(db, fun, opts);\n }\n if (isRemote(db)) {\n return httpQuery(db, fun, opts);\n }\n \n if (typeof fun !== 'string') {\n // temp_view\n checkQueryParseError(opts, fun);\n\n tempViewQueue.add(function () {\n var createViewPromise = createView(\n /* sourceDB */ db,\n /* viewName */ 'temp_view/temp_view',\n /* mapFun */ fun.map,\n /* reduceFun */ fun.reduce,\n /* temporary */ true,\n /* localDocName */ localDocName);\n return createViewPromise.then(function (view) {\n return fin(updateView(view).then(function () {\n return queryView(view, opts);\n }), function () {\n return view.db.destroy();\n });\n });\n });\n return tempViewQueue.finish();\n } else {\n // persistent view\n var fullViewName = fun;\n var parts = parseViewName(fullViewName);\n var designDocName = parts[0];\n var viewName = parts[1];\n return db.get('_design/' + designDocName).then(function (doc) {\n var fun = doc.views && doc.views[viewName];\n\n if (!fun) {\n // basic validator; it's assumed that every subclass would want this\n throw new NotFoundError('ddoc ' + doc._id + ' has no view named ' +\n viewName);\n }\n\n ddocValidator(doc, viewName);\n checkQueryParseError(opts, fun);\n\n var createViewPromise = createView(\n /* sourceDB */ db,\n /* viewName */ fullViewName,\n /* mapFun */ fun.map,\n /* reduceFun */ fun.reduce,\n /* temporary */ false,\n /* localDocName */ localDocName);\n return createViewPromise.then(function (view) {\n if (opts.stale === 'ok' || opts.stale === 'update_after') {\n if (opts.stale === 'update_after') {\n nextTick(function () {\n updateView(view);\n });\n }\n return queryView(view, opts);\n } else { // stale not ok\n return updateView(view).then(function () {\n return queryView(view, opts);\n });\n }\n });\n });\n }\n }\n\n function abstractQuery(fun, opts, callback) {\n var db = this;\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = opts ? coerceOptions(opts) : {};\n\n if (typeof fun === 'function') {\n fun = {map : fun};\n }\n\n var promise = PouchPromise.resolve().then(function () {\n return queryPromised(db, fun, opts);\n });\n promisedCallback(promise, callback);\n return promise;\n }\n\n var abstractViewCleanup = callbackify(function () {\n var db = this;\n /* istanbul ignore next */\n if (typeof db._viewCleanup === 'function') {\n return customViewCleanup(db);\n }\n if (isRemote(db)) {\n return httpViewCleanup(db);\n }\n return localViewCleanup(db);\n });\n\n return {\n query: abstractQuery,\n viewCleanup: abstractViewCleanup\n };\n}\n\nvar builtInReduce = {\n _sum: function (keys, values) {\n return sum(values);\n },\n\n _count: function (keys, values) {\n return values.length;\n },\n\n _stats: function (keys, values) {\n // no need to implement rereduce=true, because Pouch\n // will never call it\n function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }\n return {\n sum : sum(values),\n min : Math.min.apply(null, values),\n max : Math.max.apply(null, values),\n count : values.length,\n sumsqr : sumsqr(values)\n };\n }\n};\n\nfunction getBuiltIn(reduceFunString) {\n if (/^_sum/.test(reduceFunString)) {\n return builtInReduce._sum;\n } else if (/^_count/.test(reduceFunString)) {\n return builtInReduce._count;\n } else if (/^_stats/.test(reduceFunString)) {\n return builtInReduce._stats;\n } else if (/^_/.test(reduceFunString)) {\n throw new Error(reduceFunString + ' is not a supported reduce function.');\n }\n}\n\nfunction mapper(mapFun, emit) {\n // for temp_views one can use emit(doc, emit), see #38\n if (typeof mapFun === \"function\" && mapFun.length === 2) {\n var origMap = mapFun;\n return function (doc) {\n return origMap(doc, emit);\n };\n } else {\n return evalFunctionWithEval(mapFun.toString(), emit);\n }\n}\n\nfunction reducer(reduceFun) {\n var reduceFunString = reduceFun.toString();\n var builtIn = getBuiltIn(reduceFunString);\n if (builtIn) {\n return builtIn;\n } else {\n return evalFunctionWithEval(reduceFunString);\n }\n}\n\nfunction ddocValidator(ddoc, viewName) {\n var fun = ddoc.views && ddoc.views[viewName];\n if (typeof fun.map !== 'string') {\n throw new NotFoundError('ddoc ' + ddoc._id + ' has no string view named ' +\n viewName + ', instead found object of type: ' + typeof fun.map);\n }\n}\n\nvar localDocName = 'mrviews';\nvar abstract = createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator);\n\nfunction query(fun, opts, callback) {\n return abstract.query.call(this, fun, opts, callback);\n}\n\nfunction viewCleanup(callback) {\n return abstract.viewCleanup.call(this, callback);\n}\n\nvar mapreduce = {\n query: query,\n viewCleanup: viewCleanup\n};\n\nfunction isGenOne$1(rev$$1) {\n return /^1-/.test(rev$$1);\n}\n\nfunction fileHasChanged(localDoc, remoteDoc, filename) {\n return !localDoc._attachments ||\n !localDoc._attachments[filename] ||\n localDoc._attachments[filename].digest !== remoteDoc._attachments[filename].digest;\n}\n\nfunction getDocAttachments(db, doc) {\n var filenames = Object.keys(doc._attachments);\n return PouchPromise.all(filenames.map(function (filename) {\n return db.getAttachment(doc._id, filename, {rev: doc._rev});\n }));\n}\n\nfunction getDocAttachmentsFromTargetOrSource(target, src, doc) {\n var doCheckForLocalAttachments = isRemote(src) && !isRemote(target);\n var filenames = Object.keys(doc._attachments);\n\n if (!doCheckForLocalAttachments) {\n return getDocAttachments(src, doc);\n }\n\n return target.get(doc._id).then(function (localDoc) {\n return PouchPromise.all(filenames.map(function (filename) {\n if (fileHasChanged(localDoc, doc, filename)) {\n return src.getAttachment(doc._id, filename);\n }\n\n return target.getAttachment(localDoc._id, filename);\n }));\n })[\"catch\"](function (error) {\n /* istanbul ignore if */\n if (error.status !== 404) {\n throw error;\n }\n\n return getDocAttachments(src, doc);\n });\n}\n\nfunction createBulkGetOpts(diffs) {\n var requests = [];\n Object.keys(diffs).forEach(function (id) {\n var missingRevs = diffs[id].missing;\n missingRevs.forEach(function (missingRev) {\n requests.push({\n id: id,\n rev: missingRev\n });\n });\n });\n\n return {\n docs: requests,\n revs: true,\n latest: true\n };\n}\n\n//\n// Fetch all the documents from the src as described in the \"diffs\",\n// which is a mapping of docs IDs to revisions. If the state ever\n// changes to \"cancelled\", then the returned promise will be rejected.\n// Else it will be resolved with a list of fetched documents.\n//\nfunction getDocs(src, target, diffs, state) {\n diffs = clone(diffs); // we do not need to modify this\n\n var resultDocs = [],\n ok = true;\n\n function getAllDocs() {\n\n var bulkGetOpts = createBulkGetOpts(diffs);\n\n if (!bulkGetOpts.docs.length) { // optimization: skip empty requests\n return;\n }\n\n return src.bulkGet(bulkGetOpts).then(function (bulkGetResponse) {\n /* istanbul ignore if */\n if (state.cancelled) {\n throw new Error('cancelled');\n }\n return PouchPromise.all(bulkGetResponse.results.map(function (bulkGetInfo) {\n return PouchPromise.all(bulkGetInfo.docs.map(function (doc) {\n var remoteDoc = doc.ok;\n\n if (doc.error) {\n // when AUTO_COMPACTION is set, docs can be returned which look\n // like this: {\"missing\":\"1-7c3ac256b693c462af8442f992b83696\"}\n ok = false;\n }\n\n if (!remoteDoc || !remoteDoc._attachments) {\n return remoteDoc;\n }\n\n return getDocAttachmentsFromTargetOrSource(target, src, remoteDoc)\n .then(function (attachments) {\n var filenames = Object.keys(remoteDoc._attachments);\n attachments\n .forEach(function (attachment, i) {\n var att = remoteDoc._attachments[filenames[i]];\n delete att.stub;\n delete att.length;\n att.data = attachment;\n });\n\n return remoteDoc;\n });\n }));\n }))\n\n .then(function (results) {\n resultDocs = resultDocs.concat(flatten(results).filter(Boolean));\n });\n });\n }\n\n function hasAttachments(doc) {\n return doc._attachments && Object.keys(doc._attachments).length > 0;\n }\n\n function hasConflicts(doc) {\n return doc._conflicts && doc._conflicts.length > 0;\n }\n\n function fetchRevisionOneDocs(ids) {\n // Optimization: fetch gen-1 docs and attachments in\n // a single request using _all_docs\n return src.allDocs({\n keys: ids,\n include_docs: true,\n conflicts: true\n }).then(function (res) {\n if (state.cancelled) {\n throw new Error('cancelled');\n }\n res.rows.forEach(function (row) {\n if (row.deleted || !row.doc || !isGenOne$1(row.value.rev) ||\n hasAttachments(row.doc) || hasConflicts(row.doc)) {\n // if any of these conditions apply, we need to fetch using get()\n return;\n }\n\n // strip _conflicts array to appease CSG (#5793)\n /* istanbul ignore if */\n if (row.doc._conflicts) {\n delete row.doc._conflicts;\n }\n\n // the doc we got back from allDocs() is sufficient\n resultDocs.push(row.doc);\n delete diffs[row.id];\n });\n });\n }\n\n function getRevisionOneDocs() {\n // filter out the generation 1 docs and get them\n // leaving the non-generation one docs to be got otherwise\n var ids = Object.keys(diffs).filter(function (id) {\n var missing = diffs[id].missing;\n return missing.length === 1 && isGenOne$1(missing[0]);\n });\n if (ids.length > 0) {\n return fetchRevisionOneDocs(ids);\n }\n }\n\n function returnResult() {\n return { ok:ok, docs:resultDocs };\n }\n\n return PouchPromise.resolve()\n .then(getRevisionOneDocs)\n .then(getAllDocs)\n .then(returnResult);\n}\n\nvar CHECKPOINT_VERSION = 1;\nvar REPLICATOR = \"pouchdb\";\n// This is an arbitrary number to limit the\n// amount of replication history we save in the checkpoint.\n// If we save too much, the checkpoing docs will become very big,\n// if we save fewer, we'll run a greater risk of having to\n// read all the changes from 0 when checkpoint PUTs fail\n// CouchDB 2.0 has a more involved history pruning,\n// but let's go for the simple version for now.\nvar CHECKPOINT_HISTORY_SIZE = 5;\nvar LOWEST_SEQ = 0;\n\nfunction updateCheckpoint(db, id, checkpoint, session, returnValue) {\n return db.get(id)[\"catch\"](function (err) {\n if (err.status === 404) {\n if (db.adapter === 'http' || db.adapter === 'https') {\n explainError(\n 404, 'PouchDB is just checking if a remote checkpoint exists.'\n );\n }\n return {\n session_id: session,\n _id: id,\n history: [],\n replicator: REPLICATOR,\n version: CHECKPOINT_VERSION\n };\n }\n throw err;\n }).then(function (doc) {\n if (returnValue.cancelled) {\n return;\n }\n\n // if the checkpoint has not changed, do not update\n if (doc.last_seq === checkpoint) {\n return;\n }\n\n // Filter out current entry for this replication\n doc.history = (doc.history || []).filter(function (item) {\n return item.session_id !== session;\n });\n\n // Add the latest checkpoint to history\n doc.history.unshift({\n last_seq: checkpoint,\n session_id: session\n });\n\n // Just take the last pieces in history, to\n // avoid really big checkpoint docs.\n // see comment on history size above\n doc.history = doc.history.slice(0, CHECKPOINT_HISTORY_SIZE);\n\n doc.version = CHECKPOINT_VERSION;\n doc.replicator = REPLICATOR;\n\n doc.session_id = session;\n doc.last_seq = checkpoint;\n\n return db.put(doc)[\"catch\"](function (err) {\n if (err.status === 409) {\n // retry; someone is trying to write a checkpoint simultaneously\n return updateCheckpoint(db, id, checkpoint, session, returnValue);\n }\n throw err;\n });\n });\n}\n\nfunction Checkpointer(src, target, id, returnValue, opts) {\n this.src = src;\n this.target = target;\n this.id = id;\n this.returnValue = returnValue;\n this.opts = opts || {};\n}\n\nCheckpointer.prototype.writeCheckpoint = function (checkpoint, session) {\n var self = this;\n return this.updateTarget(checkpoint, session).then(function () {\n return self.updateSource(checkpoint, session);\n });\n};\n\nCheckpointer.prototype.updateTarget = function (checkpoint, session) {\n if (this.opts.writeTargetCheckpoint) {\n return updateCheckpoint(this.target, this.id, checkpoint,\n session, this.returnValue);\n } else {\n return PouchPromise.resolve(true);\n }\n};\n\nCheckpointer.prototype.updateSource = function (checkpoint, session) {\n if (this.opts.writeSourceCheckpoint) {\n var self = this;\n return updateCheckpoint(this.src, this.id, checkpoint,\n session, this.returnValue)[\n \"catch\"](function (err) {\n if (isForbiddenError(err)) {\n self.opts.writeSourceCheckpoint = false;\n return true;\n }\n throw err;\n });\n } else {\n return PouchPromise.resolve(true);\n }\n};\n\nvar comparisons = {\n \"undefined\": function (targetDoc, sourceDoc) {\n // This is the previous comparison function\n if (collate(targetDoc.last_seq, sourceDoc.last_seq) === 0) {\n return sourceDoc.last_seq;\n }\n /* istanbul ignore next */\n return 0;\n },\n \"1\": function (targetDoc, sourceDoc) {\n // This is the comparison function ported from CouchDB\n return compareReplicationLogs(sourceDoc, targetDoc).last_seq;\n }\n};\n\nCheckpointer.prototype.getCheckpoint = function () {\n var self = this;\n\n if (self.opts && self.opts.writeSourceCheckpoint && !self.opts.writeTargetCheckpoint) {\n return self.src.get(self.id).then(function (sourceDoc) {\n return sourceDoc.last_seq || LOWEST_SEQ;\n })[\"catch\"](function (err) {\n /* istanbul ignore if */\n if (err.status !== 404) {\n throw err;\n }\n return LOWEST_SEQ;\n });\n }\n\n return self.target.get(self.id).then(function (targetDoc) {\n if (self.opts && self.opts.writeTargetCheckpoint && !self.opts.writeSourceCheckpoint) {\n return targetDoc.last_seq || LOWEST_SEQ;\n }\n\n return self.src.get(self.id).then(function (sourceDoc) {\n // Since we can't migrate an old version doc to a new one\n // (no session id), we just go with the lowest seq in this case\n /* istanbul ignore if */\n if (targetDoc.version !== sourceDoc.version) {\n return LOWEST_SEQ;\n }\n\n var version;\n if (targetDoc.version) {\n version = targetDoc.version.toString();\n } else {\n version = \"undefined\";\n }\n\n if (version in comparisons) {\n return comparisons[version](targetDoc, sourceDoc);\n }\n /* istanbul ignore next */\n return LOWEST_SEQ;\n }, function (err) {\n if (err.status === 404 && targetDoc.last_seq) {\n return self.src.put({\n _id: self.id,\n last_seq: LOWEST_SEQ\n }).then(function () {\n return LOWEST_SEQ;\n }, function (err) {\n if (isForbiddenError(err)) {\n self.opts.writeSourceCheckpoint = false;\n return targetDoc.last_seq;\n }\n /* istanbul ignore next */\n return LOWEST_SEQ;\n });\n }\n throw err;\n });\n })[\"catch\"](function (err) {\n if (err.status !== 404) {\n throw err;\n }\n return LOWEST_SEQ;\n });\n};\n// This checkpoint comparison is ported from CouchDBs source\n// they come from here:\n// https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906\n\nfunction compareReplicationLogs(srcDoc, tgtDoc) {\n if (srcDoc.session_id === tgtDoc.session_id) {\n return {\n last_seq: srcDoc.last_seq,\n history: srcDoc.history\n };\n }\n\n return compareReplicationHistory(srcDoc.history, tgtDoc.history);\n}\n\nfunction compareReplicationHistory(sourceHistory, targetHistory) {\n // the erlang loop via function arguments is not so easy to repeat in JS\n // therefore, doing this as recursion\n var S = sourceHistory[0];\n var sourceRest = sourceHistory.slice(1);\n var T = targetHistory[0];\n var targetRest = targetHistory.slice(1);\n\n if (!S || targetHistory.length === 0) {\n return {\n last_seq: LOWEST_SEQ,\n history: []\n };\n }\n\n var sourceId = S.session_id;\n /* istanbul ignore if */\n if (hasSessionId(sourceId, targetHistory)) {\n return {\n last_seq: S.last_seq,\n history: sourceHistory\n };\n }\n\n var targetId = T.session_id;\n if (hasSessionId(targetId, sourceRest)) {\n return {\n last_seq: T.last_seq,\n history: targetRest\n };\n }\n\n return compareReplicationHistory(sourceRest, targetRest);\n}\n\nfunction hasSessionId(sessionId, history) {\n var props = history[0];\n var rest = history.slice(1);\n\n if (!sessionId || history.length === 0) {\n return false;\n }\n\n if (sessionId === props.session_id) {\n return true;\n }\n\n return hasSessionId(sessionId, rest);\n}\n\nfunction isForbiddenError(err) {\n return typeof err.status === 'number' && Math.floor(err.status / 100) === 4;\n}\n\nvar STARTING_BACK_OFF = 0;\n\nfunction backOff(opts, returnValue, error, callback) {\n if (opts.retry === false) {\n returnValue.emit('error', error);\n returnValue.removeAllListeners();\n return;\n }\n if (typeof opts.back_off_function !== 'function') {\n opts.back_off_function = defaultBackOff;\n }\n returnValue.emit('requestError', error);\n if (returnValue.state === 'active' || returnValue.state === 'pending') {\n returnValue.emit('paused', error);\n returnValue.state = 'stopped';\n var backOffSet = function backoffTimeSet() {\n opts.current_back_off = STARTING_BACK_OFF;\n };\n var removeBackOffSetter = function removeBackOffTimeSet() {\n returnValue.removeListener('active', backOffSet);\n };\n returnValue.once('paused', removeBackOffSetter);\n returnValue.once('active', backOffSet);\n }\n\n opts.current_back_off = opts.current_back_off || STARTING_BACK_OFF;\n opts.current_back_off = opts.back_off_function(opts.current_back_off);\n setTimeout(callback, opts.current_back_off);\n}\n\nfunction sortObjectPropertiesByKey(queryParams) {\n return Object.keys(queryParams).sort(collate).reduce(function (result, key) {\n result[key] = queryParams[key];\n return result;\n }, {});\n}\n\n// Generate a unique id particular to this replication.\n// Not guaranteed to align perfectly with CouchDB's rep ids.\nfunction generateReplicationId(src, target, opts) {\n var docIds = opts.doc_ids ? opts.doc_ids.sort(collate) : '';\n var filterFun = opts.filter ? opts.filter.toString() : '';\n var queryParams = '';\n var filterViewName = '';\n var selector = '';\n\n // possibility for checkpoints to be lost here as behaviour of\n // JSON.stringify is not stable (see #6226)\n /* istanbul ignore if */\n if (opts.selector) {\n selector = JSON.stringify(opts.selector);\n }\n\n if (opts.filter && opts.query_params) {\n queryParams = JSON.stringify(sortObjectPropertiesByKey(opts.query_params));\n }\n\n if (opts.filter && opts.filter === '_view') {\n filterViewName = opts.view.toString();\n }\n\n return PouchPromise.all([src.id(), target.id()]).then(function (res) {\n var queryData = res[0] + res[1] + filterFun + filterViewName +\n queryParams + docIds + selector;\n return new PouchPromise(function (resolve) {\n binaryMd5(queryData, resolve);\n });\n }).then(function (md5sum) {\n // can't use straight-up md5 alphabet, because\n // the char '/' is interpreted as being for attachments,\n // and + is also not url-safe\n md5sum = md5sum.replace(/\\//g, '.').replace(/\\+/g, '_');\n return '_local/' + md5sum;\n });\n}\n\nfunction replicate(src, target, opts, returnValue, result) {\n var batches = []; // list of batches to be processed\n var currentBatch; // the batch currently being processed\n var pendingBatch = {\n seq: 0,\n changes: [],\n docs: []\n }; // next batch, not yet ready to be processed\n var writingCheckpoint = false; // true while checkpoint is being written\n var changesCompleted = false; // true when all changes received\n var replicationCompleted = false; // true when replication has completed\n var last_seq = 0;\n var continuous = opts.continuous || opts.live || false;\n var batch_size = opts.batch_size || 100;\n var batches_limit = opts.batches_limit || 10;\n var changesPending = false; // true while src.changes is running\n var doc_ids = opts.doc_ids;\n var selector = opts.selector;\n var repId;\n var checkpointer;\n var changedDocs = [];\n // Like couchdb, every replication gets a unique session id\n var session = uuid();\n var seq_interval = opts.seq_interval;\n\n result = result || {\n ok: true,\n start_time: new Date(),\n docs_read: 0,\n docs_written: 0,\n doc_write_failures: 0,\n errors: []\n };\n\n var changesOpts = {};\n returnValue.ready(src, target);\n\n function initCheckpointer() {\n if (checkpointer) {\n return PouchPromise.resolve();\n }\n return generateReplicationId(src, target, opts).then(function (res) {\n repId = res;\n\n var checkpointOpts = {};\n if (opts.checkpoint === false) {\n checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: false };\n } else if (opts.checkpoint === 'source') {\n checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: false };\n } else if (opts.checkpoint === 'target') {\n checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: true };\n } else {\n checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: true };\n }\n\n checkpointer = new Checkpointer(src, target, repId, returnValue, checkpointOpts);\n });\n }\n\n function writeDocs() {\n changedDocs = [];\n\n if (currentBatch.docs.length === 0) {\n return;\n }\n var docs = currentBatch.docs;\n var bulkOpts = {timeout: opts.timeout};\n return target.bulkDocs({docs: docs, new_edits: false}, bulkOpts).then(function (res) {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n throw new Error('cancelled');\n }\n\n // `res` doesn't include full documents (which live in `docs`), so we create a map of \n // (id -> error), and check for errors while iterating over `docs`\n var errorsById = Object.create(null);\n res.forEach(function (res) {\n if (res.error) {\n errorsById[res.id] = res;\n }\n });\n\n var errorsNo = Object.keys(errorsById).length;\n result.doc_write_failures += errorsNo;\n result.docs_written += docs.length - errorsNo;\n\n docs.forEach(function (doc) {\n var error = errorsById[doc._id];\n if (error) {\n result.errors.push(error);\n // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)\n var errorName = (error.name || '').toLowerCase();\n if (errorName === 'unauthorized' || errorName === 'forbidden') {\n returnValue.emit('denied', clone(error));\n } else {\n throw error;\n }\n } else {\n changedDocs.push(doc);\n }\n });\n\n }, function (err) {\n result.doc_write_failures += docs.length;\n throw err;\n });\n }\n\n function finishBatch() {\n if (currentBatch.error) {\n throw new Error('There was a problem getting docs.');\n }\n result.last_seq = last_seq = currentBatch.seq;\n var outResult = clone(result);\n if (changedDocs.length) {\n outResult.docs = changedDocs;\n // Attach 'pending' property if server supports it (CouchDB 2.0+)\n /* istanbul ignore if */\n if (typeof currentBatch.pending === 'number') {\n outResult.pending = currentBatch.pending;\n delete currentBatch.pending;\n }\n returnValue.emit('change', outResult);\n }\n writingCheckpoint = true;\n return checkpointer.writeCheckpoint(currentBatch.seq,\n session).then(function () {\n writingCheckpoint = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n throw new Error('cancelled');\n }\n currentBatch = undefined;\n getChanges();\n })[\"catch\"](function (err) {\n onCheckpointError(err);\n throw err;\n });\n }\n\n function getDiffs() {\n var diff = {};\n currentBatch.changes.forEach(function (change) {\n // Couchbase Sync Gateway emits these, but we can ignore them\n /* istanbul ignore if */\n if (change.id === \"_user/\") {\n return;\n }\n diff[change.id] = change.changes.map(function (x) {\n return x.rev;\n });\n });\n return target.revsDiff(diff).then(function (diffs) {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n throw new Error('cancelled');\n }\n // currentBatch.diffs elements are deleted as the documents are written\n currentBatch.diffs = diffs;\n });\n }\n\n function getBatchDocs() {\n return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) {\n currentBatch.error = !got.ok;\n got.docs.forEach(function (doc) {\n delete currentBatch.diffs[doc._id];\n result.docs_read++;\n currentBatch.docs.push(doc);\n });\n });\n }\n\n function startNextBatch() {\n if (returnValue.cancelled || currentBatch) {\n return;\n }\n if (batches.length === 0) {\n processPendingBatch(true);\n return;\n }\n currentBatch = batches.shift();\n getDiffs()\n .then(getBatchDocs)\n .then(writeDocs)\n .then(finishBatch)\n .then(startNextBatch)[\n \"catch\"](function (err) {\n abortReplication('batch processing terminated with error', err);\n });\n }\n\n\n function processPendingBatch(immediate) {\n if (pendingBatch.changes.length === 0) {\n if (batches.length === 0 && !currentBatch) {\n if ((continuous && changesOpts.live) || changesCompleted) {\n returnValue.state = 'pending';\n returnValue.emit('paused');\n }\n if (changesCompleted) {\n completeReplication();\n }\n }\n return;\n }\n if (\n immediate ||\n changesCompleted ||\n pendingBatch.changes.length >= batch_size\n ) {\n batches.push(pendingBatch);\n pendingBatch = {\n seq: 0,\n changes: [],\n docs: []\n };\n if (returnValue.state === 'pending' || returnValue.state === 'stopped') {\n returnValue.state = 'active';\n returnValue.emit('active');\n }\n startNextBatch();\n }\n }\n\n\n function abortReplication(reason, err) {\n if (replicationCompleted) {\n return;\n }\n if (!err.message) {\n err.message = reason;\n }\n result.ok = false;\n result.status = 'aborting';\n batches = [];\n pendingBatch = {\n seq: 0,\n changes: [],\n docs: []\n };\n completeReplication(err);\n }\n\n\n function completeReplication(fatalError) {\n if (replicationCompleted) {\n return;\n }\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n result.status = 'cancelled';\n if (writingCheckpoint) {\n return;\n }\n }\n result.status = result.status || 'complete';\n result.end_time = new Date();\n result.last_seq = last_seq;\n replicationCompleted = true;\n\n if (fatalError) {\n // need to extend the error because Firefox considers \".result\" read-only\n fatalError = createError(fatalError);\n fatalError.result = result;\n\n // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)\n var errorName = (fatalError.name || '').toLowerCase();\n if (errorName === 'unauthorized' || errorName === 'forbidden') {\n returnValue.emit('error', fatalError);\n returnValue.removeAllListeners();\n } else {\n backOff(opts, returnValue, fatalError, function () {\n replicate(src, target, opts, returnValue);\n });\n }\n } else {\n returnValue.emit('complete', result);\n returnValue.removeAllListeners();\n }\n }\n\n\n function onChange(change, pending, lastSeq) {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n return completeReplication();\n }\n // Attach 'pending' property if server supports it (CouchDB 2.0+)\n /* istanbul ignore if */\n if (typeof pending === 'number') {\n pendingBatch.pending = pending;\n }\n\n var filter = filterChange(opts)(change);\n if (!filter) {\n return;\n }\n pendingBatch.seq = change.seq || lastSeq;\n pendingBatch.changes.push(change);\n processPendingBatch(batches.length === 0 && changesOpts.live);\n }\n\n\n function onChangesComplete(changes) {\n changesPending = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n return completeReplication();\n }\n\n // if no results were returned then we're done,\n // else fetch more\n if (changes.results.length > 0) {\n changesOpts.since = changes.last_seq;\n getChanges();\n processPendingBatch(true);\n } else {\n\n var complete = function () {\n if (continuous) {\n changesOpts.live = true;\n getChanges();\n } else {\n changesCompleted = true;\n }\n processPendingBatch(true);\n };\n\n // update the checkpoint so we start from the right seq next time\n if (!currentBatch && changes.results.length === 0) {\n writingCheckpoint = true;\n checkpointer.writeCheckpoint(changes.last_seq,\n session).then(function () {\n writingCheckpoint = false;\n result.last_seq = last_seq = changes.last_seq;\n complete();\n })[\n \"catch\"](onCheckpointError);\n } else {\n complete();\n }\n }\n }\n\n\n function onChangesError(err) {\n changesPending = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n return completeReplication();\n }\n abortReplication('changes rejected', err);\n }\n\n\n function getChanges() {\n if (!(\n !changesPending &&\n !changesCompleted &&\n batches.length < batches_limit\n )) {\n return;\n }\n changesPending = true;\n function abortChanges() {\n changes.cancel();\n }\n function removeListener() {\n returnValue.removeListener('cancel', abortChanges);\n }\n\n if (returnValue._changes) { // remove old changes() and listeners\n returnValue.removeListener('cancel', returnValue._abortChanges);\n returnValue._changes.cancel();\n }\n returnValue.once('cancel', abortChanges);\n\n var changes = src.changes(changesOpts)\n .on('change', onChange);\n changes.then(removeListener, removeListener);\n changes.then(onChangesComplete)[\n \"catch\"](onChangesError);\n\n if (opts.retry) {\n // save for later so we can cancel if necessary\n returnValue._changes = changes;\n returnValue._abortChanges = abortChanges;\n }\n }\n\n\n function startChanges() {\n initCheckpointer().then(function () {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n return;\n }\n return checkpointer.getCheckpoint().then(function (checkpoint) {\n last_seq = checkpoint;\n changesOpts = {\n since: last_seq,\n limit: batch_size,\n batch_size: batch_size,\n style: 'all_docs',\n doc_ids: doc_ids,\n selector: selector,\n return_docs: true // required so we know when we're done\n };\n if (seq_interval !== false) {\n changesOpts.seq_interval = seq_interval || batch_size;\n }\n if (opts.filter) {\n if (typeof opts.filter !== 'string') {\n // required for the client-side filter in onChange\n changesOpts.include_docs = true;\n } else { // ddoc filter\n changesOpts.filter = opts.filter;\n }\n }\n if ('heartbeat' in opts) {\n changesOpts.heartbeat = opts.heartbeat;\n }\n if ('timeout' in opts) {\n changesOpts.timeout = opts.timeout;\n }\n if (opts.query_params) {\n changesOpts.query_params = opts.query_params;\n }\n if (opts.view) {\n changesOpts.view = opts.view;\n }\n getChanges();\n });\n })[\"catch\"](function (err) {\n abortReplication('getCheckpoint rejected with ', err);\n });\n }\n\n /* istanbul ignore next */\n function onCheckpointError(err) {\n writingCheckpoint = false;\n abortReplication('writeCheckpoint completed with error', err);\n }\n\n /* istanbul ignore if */\n if (returnValue.cancelled) { // cancelled immediately\n completeReplication();\n return;\n }\n\n if (!returnValue._addedListeners) {\n returnValue.once('cancel', completeReplication);\n\n if (typeof opts.complete === 'function') {\n returnValue.once('error', opts.complete);\n returnValue.once('complete', function (result) {\n opts.complete(null, result);\n });\n }\n returnValue._addedListeners = true;\n }\n\n if (typeof opts.since === 'undefined') {\n startChanges();\n } else {\n initCheckpointer().then(function () {\n writingCheckpoint = true;\n return checkpointer.writeCheckpoint(opts.since, session);\n }).then(function () {\n writingCheckpoint = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n return;\n }\n last_seq = opts.since;\n startChanges();\n })[\"catch\"](onCheckpointError);\n }\n}\n\n// We create a basic promise so the caller can cancel the replication possibly\n// before we have actually started listening to changes etc\ninherits(Replication, events.EventEmitter);\nfunction Replication() {\n events.EventEmitter.call(this);\n this.cancelled = false;\n this.state = 'pending';\n var self = this;\n var promise = new PouchPromise(function (fulfill, reject) {\n self.once('complete', fulfill);\n self.once('error', reject);\n });\n self.then = function (resolve, reject) {\n return promise.then(resolve, reject);\n };\n self[\"catch\"] = function (reject) {\n return promise[\"catch\"](reject);\n };\n // As we allow error handling via \"error\" event as well,\n // put a stub in here so that rejecting never throws UnhandledError.\n self[\"catch\"](function () {});\n}\n\nReplication.prototype.cancel = function () {\n this.cancelled = true;\n this.state = 'cancelled';\n this.emit('cancel');\n};\n\nReplication.prototype.ready = function (src, target) {\n var self = this;\n if (self._readyCalled) {\n return;\n }\n self._readyCalled = true;\n\n function onDestroy() {\n self.cancel();\n }\n src.once('destroyed', onDestroy);\n target.once('destroyed', onDestroy);\n function cleanup() {\n src.removeListener('destroyed', onDestroy);\n target.removeListener('destroyed', onDestroy);\n }\n self.once('complete', cleanup);\n};\n\nfunction toPouch(db, opts) {\n var PouchConstructor = opts.PouchConstructor;\n if (typeof db === 'string') {\n return new PouchConstructor(db, opts);\n } else {\n return db;\n }\n}\n\nfunction replicateWrapper(src, target, opts, callback) {\n\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n if (typeof opts === 'undefined') {\n opts = {};\n }\n\n if (opts.doc_ids && !Array.isArray(opts.doc_ids)) {\n throw createError(BAD_REQUEST,\n \"`doc_ids` filter parameter is not a list.\");\n }\n\n opts.complete = callback;\n opts = clone(opts);\n opts.continuous = opts.continuous || opts.live;\n opts.retry = ('retry' in opts) ? opts.retry : false;\n /*jshint validthis:true */\n opts.PouchConstructor = opts.PouchConstructor || this;\n var replicateRet = new Replication(opts);\n var srcPouch = toPouch(src, opts);\n var targetPouch = toPouch(target, opts);\n replicate(srcPouch, targetPouch, opts, replicateRet);\n return replicateRet;\n}\n\ninherits(Sync, events.EventEmitter);\nfunction sync$1(src, target, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n if (typeof opts === 'undefined') {\n opts = {};\n }\n opts = clone(opts);\n /*jshint validthis:true */\n opts.PouchConstructor = opts.PouchConstructor || this;\n src = toPouch(src, opts);\n target = toPouch(target, opts);\n return new Sync(src, target, opts, callback);\n}\n\nfunction Sync(src, target, opts, callback) {\n var self = this;\n this.canceled = false;\n\n var optsPush = opts.push ? $inject_Object_assign({}, opts, opts.push) : opts;\n var optsPull = opts.pull ? $inject_Object_assign({}, opts, opts.pull) : opts;\n\n this.push = replicateWrapper(src, target, optsPush);\n this.pull = replicateWrapper(target, src, optsPull);\n\n this.pushPaused = true;\n this.pullPaused = true;\n\n function pullChange(change) {\n self.emit('change', {\n direction: 'pull',\n change: change\n });\n }\n function pushChange(change) {\n self.emit('change', {\n direction: 'push',\n change: change\n });\n }\n function pushDenied(doc) {\n self.emit('denied', {\n direction: 'push',\n doc: doc\n });\n }\n function pullDenied(doc) {\n self.emit('denied', {\n direction: 'pull',\n doc: doc\n });\n }\n function pushPaused() {\n self.pushPaused = true;\n /* istanbul ignore if */\n if (self.pullPaused) {\n self.emit('paused');\n }\n }\n function pullPaused() {\n self.pullPaused = true;\n /* istanbul ignore if */\n if (self.pushPaused) {\n self.emit('paused');\n }\n }\n function pushActive() {\n self.pushPaused = false;\n /* istanbul ignore if */\n if (self.pullPaused) {\n self.emit('active', {\n direction: 'push'\n });\n }\n }\n function pullActive() {\n self.pullPaused = false;\n /* istanbul ignore if */\n if (self.pushPaused) {\n self.emit('active', {\n direction: 'pull'\n });\n }\n }\n\n var removed = {};\n\n function removeAll(type) { // type is 'push' or 'pull'\n return function (event, func) {\n var isChange = event === 'change' &&\n (func === pullChange || func === pushChange);\n var isDenied = event === 'denied' &&\n (func === pullDenied || func === pushDenied);\n var isPaused = event === 'paused' &&\n (func === pullPaused || func === pushPaused);\n var isActive = event === 'active' &&\n (func === pullActive || func === pushActive);\n\n if (isChange || isDenied || isPaused || isActive) {\n if (!(event in removed)) {\n removed[event] = {};\n }\n removed[event][type] = true;\n if (Object.keys(removed[event]).length === 2) {\n // both push and pull have asked to be removed\n self.removeAllListeners(event);\n }\n }\n };\n }\n\n if (opts.live) {\n this.push.on('complete', self.pull.cancel.bind(self.pull));\n this.pull.on('complete', self.push.cancel.bind(self.push));\n }\n\n function addOneListener(ee, event, listener) {\n if (ee.listeners(event).indexOf(listener) == -1) {\n ee.on(event, listener);\n }\n }\n\n this.on('newListener', function (event) {\n if (event === 'change') {\n addOneListener(self.pull, 'change', pullChange);\n addOneListener(self.push, 'change', pushChange);\n } else if (event === 'denied') {\n addOneListener(self.pull, 'denied', pullDenied);\n addOneListener(self.push, 'denied', pushDenied);\n } else if (event === 'active') {\n addOneListener(self.pull, 'active', pullActive);\n addOneListener(self.push, 'active', pushActive);\n } else if (event === 'paused') {\n addOneListener(self.pull, 'paused', pullPaused);\n addOneListener(self.push, 'paused', pushPaused);\n }\n });\n\n this.on('removeListener', function (event) {\n if (event === 'change') {\n self.pull.removeListener('change', pullChange);\n self.push.removeListener('change', pushChange);\n } else if (event === 'denied') {\n self.pull.removeListener('denied', pullDenied);\n self.push.removeListener('denied', pushDenied);\n } else if (event === 'active') {\n self.pull.removeListener('active', pullActive);\n self.push.removeListener('active', pushActive);\n } else if (event === 'paused') {\n self.pull.removeListener('paused', pullPaused);\n self.push.removeListener('paused', pushPaused);\n }\n });\n\n this.pull.on('removeListener', removeAll('pull'));\n this.push.on('removeListener', removeAll('push'));\n\n var promise = PouchPromise.all([\n this.push,\n this.pull\n ]).then(function (resp) {\n var out = {\n push: resp[0],\n pull: resp[1]\n };\n self.emit('complete', out);\n if (callback) {\n callback(null, out);\n }\n self.removeAllListeners();\n return out;\n }, function (err) {\n self.cancel();\n if (callback) {\n // if there's a callback, then the callback can receive\n // the error event\n callback(err);\n } else {\n // if there's no callback, then we're safe to emit an error\n // event, which would otherwise throw an unhandled error\n // due to 'error' being a special event in EventEmitters\n self.emit('error', err);\n }\n self.removeAllListeners();\n if (callback) {\n // no sense throwing if we're already emitting an 'error' event\n throw err;\n }\n });\n\n this.then = function (success, err) {\n return promise.then(success, err);\n };\n\n this[\"catch\"] = function (err) {\n return promise[\"catch\"](err);\n };\n}\n\nSync.prototype.cancel = function () {\n if (!this.canceled) {\n this.canceled = true;\n this.push.cancel();\n this.pull.cancel();\n }\n};\n\nfunction replication(PouchDB) {\n PouchDB.replicate = replicateWrapper;\n PouchDB.sync = sync$1;\n\n Object.defineProperty(PouchDB.prototype, 'replicate', {\n get: function () {\n var self = this;\n if (typeof this.replicateMethods === 'undefined') {\n this.replicateMethods = {\n from: function (other, opts, callback) {\n return self.constructor.replicate(other, self, opts, callback);\n },\n to: function (other, opts, callback) {\n return self.constructor.replicate(self, other, opts, callback);\n }\n };\n }\n return this.replicateMethods;\n }\n });\n\n PouchDB.prototype.sync = function (dbName, opts, callback) {\n return this.constructor.sync(this, dbName, opts, callback);\n };\n}\n\nPouchDB.plugin(IDBPouch)\n .plugin(WebSqlPouch$1)\n .plugin(HttpPouch$1)\n .plugin(mapreduce)\n .plugin(replication);\n\n// Pull from src because pouchdb-node/pouchdb-browser themselves\n// are aggressively optimized and jsnext:main would normally give us this\n// aggressive bundle.\n\nmodule.exports = PouchDB;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"1\":1,\"10\":10,\"11\":11,\"16\":16,\"2\":2,\"4\":4,\"5\":5,\"6\":6,\"7\":7}]},{},[17])(17)\n});\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n/***/ }),\n/* 23 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__events__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_routie__ = __webpack_require__(24);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_routie___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_routie__);\n\n\n\n$(window).on(__WEBPACK_IMPORTED_MODULE_0__events___default.a.AJAX + ' ' + __WEBPACK_IMPORTED_MODULE_0__events___default.a.LOADED, function () {\n __WEBPACK_IMPORTED_MODULE_1_routie___default()({\n 'navigation': function navigation() {\n $('#NavbarCollapse').addClass('in');\n },\n 'carousel:id:num': function carouselIdNum(id, num) {\n $('#Carousel' + id).carousel(num);\n }\n });\n});\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar path = __webpack_require__(25);\n\nvar methods = ['get', 'post', 'put', 'patch', 'delete', 'del', 'all'];\n\nvar __slice = [].slice;\n\nmodule.exports = function (map) {\n var args, root, _map, cb;\n args = __slice.call(arguments, 1);\n\n if (typeof args[args.length - 1] === \"function\") cb = args.pop();\n\n root = path.join.apply(path, args);\n _map = {};\n methods.forEach(function (m) {\n _map[m] = function (subpath) {\n var args = __slice.call(arguments);\n args.length < 2 ? args.unshift(root) : args[0] = root + args[0];\n return map[m].apply(map, args);\n }\n });\n if (cb) cb(_map);\n return _map;\n};\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(26)))\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! smooth-scroll v14.2.0 | (c) 2018 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */\n!(function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function(){return t(e)}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):\"object\"==typeof exports?module.exports=t(e):e.SmoothScroll=t(e)})(\"undefined\"!=typeof global?global:\"undefined\"!=typeof window?window:this,(function(e){\"use strict\";var t={ignore:\"[data-scroll-ignore]\",header:null,topOnEmptyHash:!0,speed:500,clip:!0,offset:0,easing:\"easeInOutCubic\",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},n=function(){return\"querySelector\"in document&&\"addEventListener\"in e&&\"requestAnimationFrame\"in e&&\"closest\"in e.Element.prototype},o=function(){for(var e={},t=0;t<arguments.length;t++)!(function(t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(arguments[t]);return e},r=function(t){return!!(\"matchMedia\"in e&&e.matchMedia(\"(prefers-reduced-motion)\").matches)},a=function(t){return parseInt(e.getComputedStyle(t).height,10)},i=function(e){var t;try{t=decodeURIComponent(e)}catch(n){t=e}return t},c=function(e){\"#\"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,r=-1,a=\"\",i=n.charCodeAt(0);++r<o;){if(0===(t=n.charCodeAt(r)))throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");t>=1&&t<=31||127==t||0===r&&t>=48&&t<=57||1===r&&t>=48&&t<=57&&45===i?a+=\"\\\\\"+t.toString(16)+\" \":a+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(r):\"\\\\\"+n.charAt(r)}var c;try{c=decodeURIComponent(\"#\"+a)}catch(e){c=\"#\"+a}return c},u=function(e,t){var n;return\"easeInQuad\"===e.easing&&(n=t*t),\"easeOutQuad\"===e.easing&&(n=t*(2-t)),\"easeInOutQuad\"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),\"easeInCubic\"===e.easing&&(n=t*t*t),\"easeOutCubic\"===e.easing&&(n=--t*t*t+1),\"easeInOutCubic\"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),\"easeInQuart\"===e.easing&&(n=t*t*t*t),\"easeOutQuart\"===e.easing&&(n=1- --t*t*t*t),\"easeInOutQuart\"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),\"easeInQuint\"===e.easing&&(n=t*t*t*t*t),\"easeOutQuint\"===e.easing&&(n=1+--t*t*t*t*t),\"easeInOutQuint\"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t},s=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},l=function(t,n,o,r){var a=0;if(t.offsetParent)do{a+=t.offsetTop,t=t.offsetParent}while(t);return a=Math.max(a-n-o,0),r&&(a=Math.min(a,s()-e.innerHeight)),a},d=function(e){return e?a(e)+e.offsetTop:0},f=function(e,t,n){t||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?\"#top\":\"#\"+e.id)},m=function(t,n,o){0===t&&document.body.focus(),o||(t.focus(),document.activeElement!==t&&(t.setAttribute(\"tabindex\",\"-1\"),t.focus(),t.style.outline=\"none\"),e.scrollTo(0,n))},h=function(t,n,o,r){if(n.emitEvents&&\"function\"==typeof e.CustomEvent){var a=new CustomEvent(t,{bubbles:!0,detail:{anchor:o,toggle:r}});document.dispatchEvent(a)}};return function(a,p){var g,v,y,S,E,b,O,I={};I.cancelScroll=function(e){cancelAnimationFrame(O),O=null,e||h(\"scrollCancel\",g)},I.animateScroll=function(n,r,a){var i=o(g||t,a||{}),c=\"[object Number]\"===Object.prototype.toString.call(n),p=c||!n.tagName?null:n;if(c||p){var v=e.pageYOffset;i.header&&!S&&(S=document.querySelector(i.header)),E||(E=d(S));var y,b,C,w=c?n:l(p,E,parseInt(\"function\"==typeof i.offset?i.offset(n,r):i.offset,10),i.clip),L=w-v,A=s(),H=0,q=function(t,o){var a=e.pageYOffset;if(t==o||a==o||(v<o&&e.innerHeight+a)>=A)return I.cancelScroll(!0),m(n,o,c),h(\"scrollStop\",i,n,r),y=null,O=null,!0},Q=function(t){y||(y=t),H+=t-y,b=H/parseInt(i.speed,10),b=b>1?1:b,C=v+L*u(i,b),e.scrollTo(0,Math.floor(C)),q(C,w)||(O=e.requestAnimationFrame(Q),y=t)};0===e.pageYOffset&&e.scrollTo(0,0),f(n,c,i),h(\"scrollStart\",i,n,r),I.cancelScroll(!0),e.requestAnimationFrame(Q)}};var C=function(t){if(!r()&&0===t.button&&!t.metaKey&&!t.ctrlKey&&\"closest\"in t.target&&(y=t.target.closest(a))&&\"a\"===y.tagName.toLowerCase()&&!t.target.closest(g.ignore)&&y.hostname===e.location.hostname&&y.pathname===e.location.pathname&&/#/.test(y.href)){var n=c(i(y.hash)),o=g.topOnEmptyHash&&\"#\"===n?document.documentElement:document.querySelector(n);o=o||\"#top\"!==n?o:document.documentElement,o&&(t.preventDefault(),I.animateScroll(o,y))}},w=function(e){if(history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(g)&&history.state.anchor){var t=document.querySelector(c(i(history.state.anchor)));t&&I.animateScroll(t,null,{updateURL:!1})}},L=function(e){b||(b=setTimeout((function(){b=null,E=d(S)}),66))};return I.destroy=function(){g&&(document.removeEventListener(\"click\",C,!1),e.removeEventListener(\"resize\",L,!1),e.removeEventListener(\"popstate\",w,!1),I.cancelScroll(),g=null,v=null,y=null,S=null,E=null,b=null,O=null)},I.init=function(r){if(!n())throw\"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.\";I.destroy(),g=o(t,r||{}),S=g.header?document.querySelector(g.header):null,E=d(S),document.addEventListener(\"click\",C,!1),S&&e.addEventListener(\"resize\",L,!1),g.updateURL&&g.popstate&&e.addEventListener(\"popstate\",w,!1)},I.init(p),I}}));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar map = {\n\t\"./icon-cfpb.png\": 29,\n\t\"./icon-lender.png\": 30,\n\t\"./logo.png\": 31\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) // check for number or string\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\treturn id;\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 28;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"../img/icon-cfpb.png\";\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"../img/icon-lender.png\";\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"../img/logo.png\";\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports) {\n\nfunction webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 32;\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// js/app.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"app/client/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bf4e87ea9ffc4b0f0978","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Util = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined; // eslint-disable-line no-undefined\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $(this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator;\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || '';\n }\n\n try {\n var $selector = $(document).find(selector);\n return $selector.length > 0 ? selector : null;\n } catch (err) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $(element).css('transition-duration');\n var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END);\n },\n // TODO: Remove in v5\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n }\n };\n setTransitionEndSupport();\n return Util;\n}($);\n//# sourceMappingURL=util.js.map\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = Util;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/exports-loader?Util!./node_modules/bootstrap/js/dist/util.js\n// module id = 1\n// module chunks = 0","/**\n * Add your global events here\n */\n\nmodule.exports = {\n AJAX: 'ajax-load',\n LOADED: 'load',\n};\n\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/_events.js","/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.14.3\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nvar longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\nvar timeoutDuration = 0;\nfor (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n timeoutDuration = 1;\n break;\n }\n}\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var css = getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\nvar isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nvar isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nfunction isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);\n}\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);\n}\n\nfunction getWindowSizes() {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};\n var width = sizes.width || element.clientWidth || result.right - result.left;\n var height = sizes.height || element.clientHeight || result.bottom - result.top;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth, 10);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && parent.nodeName === 'HTML') {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop, 10);\n var marginLeft = parseFloat(styles.marginLeft, 10);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return isFixed(getParentNode(element));\n}\n\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nfunction getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n var el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n // NOTE: 1 DOM access here\n\n var boundaries = { top: 0, left: 0 };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n boundaries.left += padding;\n boundaries.top += padding;\n boundaries.right -= padding;\n boundaries.bottom -= padding;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var styles = getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger onUpdate callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n // Avoid blurry text by using full pixel integers.\n // For pixel-perfect positioning, top/bottom prefers rounded\n // values, while left/right prefers floored values.\n var offsets = {\n left: Math.floor(popper.left),\n top: Math.round(popper.top),\n bottom: Math.round(popper.bottom),\n right: Math.floor(popper.right)\n };\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n top = -offsetParentRect.height + offsets.bottom;\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n left = -offsetParentRect.width + offsets.right;\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n var _data$offsets$arrow;\n\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-right` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.<br />\n * It will read the variation of the `placement` property.<br />\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unitless, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.<br />\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the height.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.<br />\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.<br />\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * An scenario exists where the reference itself is not within the boundaries.<br />\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper this makes sure the popper has always a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier, can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near eachothers\n * without leaving any gap between the two. Expecially useful when the arrow is\n * enabled and you want to assure it to point to its reference element.\n * It cares only about the first axis, you can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjuction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations).\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position,\n * the popper will never be placed outside of the defined boundaries\n * (except if keepTogether is enabled)\n */\n boundariesElement: 'viewport'\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define you own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the informations used by Popper.js\n * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements.\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overriden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass as 3rd argument an object with the same\n * structure of this object, example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.<br />\n * By default, is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated, this callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.<br />\n * By default, is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Create a new Popper.js instance\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedule an update, it will run on the next UI update available\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.<br />\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\nexport default Popper;\n//# sourceMappingURL=popper.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/popper.js/dist/esm/popper.js\n// module id = 3\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 4\n// module chunks = 0","/*! Hammer.JS - v2.0.7 - 2016-04-22\n * http://hammerjs.github.io/\n *\n * Copyright (c) 2016 Jorik Tangelder;\n * Licensed under the MIT license */\n(function(window, document, exportName, undefined) {\n 'use strict';\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = document.createElement('div');\n\nvar TYPE_FUNCTION = 'function';\n\nvar round = Math.round;\nvar abs = Math.abs;\nvar now = Date.now;\n\n/**\n * set a timeout with a given scope\n * @param {Function} fn\n * @param {Number} timeout\n * @param {Object} context\n * @returns {number}\n */\nfunction setTimeoutContext(fn, timeout, context) {\n return setTimeout(bindFn(fn, context), timeout);\n}\n\n/**\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\nfunction invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n return false;\n}\n\n/**\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n}\n\n/**\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\\n' + message + ' AT \\n';\n return function() {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '')\n .replace(/^\\s+at\\s+/gm, '')\n .replace(/^Object.<anonymous>\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n\n var log = window.console && (window.console.warn || window.console.log);\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n return method.apply(this, arguments);\n };\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\nif (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n };\n} else {\n assign = Object.assign;\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\nvar extend = deprecate(function extend(dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n while (i < keys.length) {\n if (!merge || (merge && dest[keys[i]] === undefined)) {\n dest[keys[i]] = src[keys[i]];\n }\n i++;\n }\n return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\nvar merge = deprecate(function merge(dest, src) {\n return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\nfunction inherit(child, base, properties) {\n var baseP = base.prototype,\n childP;\n\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign(childP, properties);\n }\n}\n\n/**\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n}\n\n/**\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\nfunction boolOrFn(val, args) {\n if (typeof val == TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n return val;\n}\n\n/**\n * use the val2 when val1 is undefined\n * @param {*} val1\n * @param {*} val2\n * @returns {*}\n */\nfunction ifUndefined(val1, val2) {\n return (val1 === undefined) ? val2 : val1;\n}\n\n/**\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction addEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.addEventListener(type, handler, false);\n });\n}\n\n/**\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction removeEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.removeEventListener(type, handler, false);\n });\n}\n\n/**\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n while (node) {\n if (node == parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}\n\n/**\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n return str.indexOf(find) > -1;\n}\n\n/**\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n\n/**\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n while (i < src.length) {\n if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\n return i;\n }\n i++;\n }\n return -1;\n }\n}\n\n/**\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\nfunction uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function sortUniqueArray(a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n}\n\n/**\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\nfunction prefixed(obj, property) {\n var prefix, prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n\n var i = 0;\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = (prefix) ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n i++;\n }\n return undefined;\n}\n\n/**\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n return _uniqueId++;\n}\n\n/**\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return (doc.defaultView || doc.parentWindow || window);\n}\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\n\nvar COMPUTE_INTERVAL = 25;\n\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\n\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\n\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\n\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\nfunction Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget;\n\n // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n this.domHandler = function(ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n\n}\n\nInput.prototype = {\n /**\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n handler: function() { },\n\n /**\n * bind the events\n */\n init: function() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n },\n\n /**\n * unbind the events\n */\n destroy: function() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n};\n\n/**\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\nfunction createInputInstance(manager) {\n var Type;\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n return new (Type)(manager, inputHandler);\n}\n\n/**\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\nfunction inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\n var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\n\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n }\n\n // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n input.eventType = eventType;\n\n // compute scale, rotation etc\n computeInputData(manager, input);\n\n // emit secret event\n manager.emit('hammer.input', input);\n\n manager.recognize(input);\n manager.session.prevInput = input;\n}\n\n/**\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\nfunction computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length;\n\n // store the first input to calculate the distance and direction\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n }\n\n // to compute scale and rotation we need to store the multiple touches\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput;\n var firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;\n\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n\n input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >\n session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);\n\n computeIntervalInputData(session, input);\n\n // find the correct target\n var target = manager.element;\n if (hasParent(input.srcEvent.target, target)) {\n target = input.srcEvent.target;\n }\n input.target = target;\n}\n\nfunction computeDeltaXY(session, input) {\n var center = input.center;\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\nfunction computeIntervalInputData(session, input) {\n var last = session.lastInterval || input,\n deltaTime = input.timeStamp - last.timeStamp,\n velocity, velocityX, velocityY, direction;\n\n if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n\n/**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\nfunction simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n\n/**\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\nfunction getCenter(pointers) {\n var pointersLength = pointers.length;\n\n // no need to loop when only one touch\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0, y = 0, i = 0;\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n}\n\n/**\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n\n/**\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\nfunction getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\n/**\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\nfunction getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n\n return Math.sqrt((x * x) + (y * y));\n}\n\n/**\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\nfunction getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\nfunction getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\nfunction getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\nvar MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\n\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n\n/**\n * Mouse events input\n * @constructor\n * @extends Input\n */\nfunction MouseInput() {\n this.evEl = MOUSE_ELEMENT_EVENTS;\n this.evWin = MOUSE_WINDOW_EVENTS;\n\n this.pressed = false; // mousedown state\n\n Input.apply(this, arguments);\n}\n\ninherit(MouseInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function MEhandler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type];\n\n // on start we want to have the left mouse button down\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n }\n\n // mouse must be down\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n }\n});\n\nvar POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n};\n\n// in IE10 the pointer types is defined as an enum\nvar IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n};\n\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\n\n// IE10 has prefixed support, and case-sensitive\nif (window.MSPointerEvent && !window.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n\n/**\n * Pointer events input\n * @constructor\n * @extends Input\n */\nfunction PointerEventInput() {\n this.evEl = POINTER_ELEMENT_EVENTS;\n this.evWin = POINTER_WINDOW_EVENTS;\n\n Input.apply(this, arguments);\n\n this.store = (this.manager.session.pointerEvents = []);\n}\n\ninherit(PointerEventInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function PEhandler(ev) {\n var store = this.store;\n var removePointer = false;\n\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n\n var isTouch = (pointerType == INPUT_TYPE_TOUCH);\n\n // get index of the event in the store\n var storeIndex = inArray(store, ev.pointerId, 'pointerId');\n\n // start and mouse must be down\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n }\n\n // it not found, so the pointer hasn't been down (so it's probably a hover)\n if (storeIndex < 0) {\n return;\n }\n\n // update the event in the store\n store[storeIndex] = ev;\n\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n }\n});\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Touch events input\n * @constructor\n * @extends Input\n */\nfunction SingleTouchInput() {\n this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n this.started = false;\n\n Input.apply(this, arguments);\n}\n\ninherit(SingleTouchInput, Input, {\n handler: function TEhandler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\n\n // should we handle the touch events?\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type);\n\n // when done, reset the started state\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n}\n\nvar TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\nfunction TouchInput() {\n this.evTarget = TOUCH_TARGET_EVENTS;\n this.targetIds = {};\n\n Input.apply(this, arguments);\n}\n\ninherit(TouchInput, Input, {\n handler: function MTEhandler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds;\n\n // when there is only one touch, the process can be simplified\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i,\n targetTouches,\n changedTouches = toArray(ev.changedTouches),\n changedTargetTouches = [],\n target = this.target;\n\n // get target touches from touches\n targetTouches = allTouches.filter(function(touch) {\n return hasParent(touch.target, target);\n });\n\n // collect touches\n if (type === INPUT_START) {\n i = 0;\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n }\n\n // filter changed touches to only contain touches that exist in the collected target ids\n i = 0;\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n }\n\n // cleanup removed touches\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [\n // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\n changedTargetTouches\n ];\n}\n\n/**\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction TouchMouseInput() {\n Input.apply(this, arguments);\n\n var handler = bindFn(this.handler, this);\n this.touch = new TouchInput(this.manager, handler);\n this.mouse = new MouseInput(this.manager, handler);\n\n this.primaryTouch = null;\n this.lastTouches = [];\n}\n\ninherit(TouchMouseInput, Input, {\n /**\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n handler: function TMEhandler(manager, inputEvent, inputData) {\n var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\n isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n }\n\n // when we're in a touch event, record touches to de-dupe synthetic mouse event\n if (isTouch) {\n recordTouches.call(this, inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(this, inputData)) {\n return;\n }\n\n this.callback(manager, inputEvent, inputData);\n },\n\n /**\n * remove the event listeners\n */\n destroy: function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n }\n});\n\nfunction recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n}\n\nfunction setLastTouch(eventData) {\n var touch = eventData.changedPointers[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {x: touch.clientX, y: touch.clientY};\n this.lastTouches.push(lastTouch);\n var lts = this.lastTouches;\n var removeLastTouch = function() {\n var i = lts.indexOf(lastTouch);\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n}\n\nfunction isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n return false;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\n\n// magical touchAction value\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\n/**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\nfunction TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n}\n\nTouchAction.prototype = {\n /**\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n set: function(value) {\n // find out the touch-action by the event handlers\n if (value == TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n this.actions = value.toLowerCase().trim();\n },\n\n /**\n * just re-set the touchAction value\n */\n update: function() {\n this.set(this.manager.options.touchAction);\n },\n\n /**\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n compute: function() {\n var actions = [];\n each(this.manager.recognizers, function(recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n },\n\n /**\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n preventDefaults: function(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection;\n\n // if the touch action did prevented once this session\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n //do not prevent defaults if this is a tap gesture\n\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone ||\n (hasPanY && direction & DIRECTION_HORIZONTAL) ||\n (hasPanX && direction & DIRECTION_VERTICAL)) {\n return this.preventSrc(srcEvent);\n }\n },\n\n /**\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n preventSrc: function(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n }\n};\n\n/**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\nfunction cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\n\n // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n }\n\n // pan-x OR pan-y\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n }\n\n // manipulation\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n}\n\nfunction getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n var touchMap = {};\n var cssSupports = window.CSS && window.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {\n\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n}\n\n/**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\nfunction Recognizer(options) {\n this.options = assign({}, this.defaults, options || {});\n\n this.id = uniqueId();\n\n this.manager = null;\n\n // default is enable true\n this.options.enable = ifUndefined(this.options.enable, true);\n\n this.state = STATE_POSSIBLE;\n\n this.simultaneous = {};\n this.requireFail = [];\n}\n\nRecognizer.prototype = {\n /**\n * @virtual\n * @type {Object}\n */\n defaults: {},\n\n /**\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n set: function(options) {\n assign(this.options, options);\n\n // also update the touchAction, in case something changed about the directions/enabled state\n this.manager && this.manager.touchAction.update();\n return this;\n },\n\n /**\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n recognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n return this;\n },\n\n /**\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRecognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n },\n\n /**\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n requireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n return this;\n },\n\n /**\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRequireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n return this;\n },\n\n /**\n * has require failures boolean\n * @returns {boolean}\n */\n hasRequireFailures: function() {\n return this.requireFail.length > 0;\n },\n\n /**\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n canRecognizeWith: function(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n },\n\n /**\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n emit: function(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n }\n\n // 'panstart' and 'panmove'\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n }\n\n // panend and pancancel\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n },\n\n /**\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n tryEmit: function(input) {\n if (this.canEmit()) {\n return this.emit(input);\n }\n // it's failing anyway\n this.state = STATE_FAILED;\n },\n\n /**\n * can we emit?\n * @returns {boolean}\n */\n canEmit: function() {\n var i = 0;\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n i++;\n }\n return true;\n },\n\n /**\n * update the recognizer\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign({}, inputData);\n\n // is is enabled and allow recognizing?\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n }\n\n // reset when we've reached the end\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone);\n\n // the recognizer has recognized a gesture\n // so trigger an event\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n },\n\n /**\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {Const} STATE\n */\n process: function(inputData) { }, // jshint ignore:line\n\n /**\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n getTouchAction: function() { },\n\n /**\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n reset: function() { }\n};\n\n/**\n * get a usable string, used as event postfix\n * @param {Const} state\n * @returns {String} state\n */\nfunction stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n return '';\n}\n\n/**\n * direction cons to string\n * @param {Const} direction\n * @returns {String}\n */\nfunction directionStr(direction) {\n if (direction == DIRECTION_DOWN) {\n return 'down';\n } else if (direction == DIRECTION_UP) {\n return 'up';\n } else if (direction == DIRECTION_LEFT) {\n return 'left';\n } else if (direction == DIRECTION_RIGHT) {\n return 'right';\n }\n return '';\n}\n\n/**\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n if (manager) {\n return manager.get(otherRecognizer);\n }\n return otherRecognizer;\n}\n\n/**\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\nfunction AttrRecognizer() {\n Recognizer.apply(this, arguments);\n}\n\ninherit(AttrRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof AttrRecognizer\n */\n defaults: {\n /**\n * @type {Number}\n * @default 1\n */\n pointers: 1\n },\n\n /**\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n attrTest: function(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n },\n\n /**\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n process: function(input) {\n var state = this.state;\n var eventType = input.eventType;\n\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input);\n\n // on cancel input and we've recognized before, return STATE_CANCELLED\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n return state | STATE_CHANGED;\n }\n return STATE_FAILED;\n }\n});\n\n/**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}\n\ninherit(PanRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PanRecognizer\n */\n defaults: {\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n },\n\n getTouchAction: function() {\n var direction = this.options.direction;\n var actions = [];\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n return actions;\n },\n\n directionTest: function(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY;\n\n // lock to axis?\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x != this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y != this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n },\n\n attrTest: function(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) &&\n (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\n },\n\n emit: function(input) {\n\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PinchRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(PinchRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'pinch',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n },\n\n emit: function(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\nfunction PressRecognizer() {\n Recognizer.apply(this, arguments);\n\n this._timer = null;\n this._input = null;\n}\n\ninherit(PressRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PressRecognizer\n */\n defaults: {\n event: 'press',\n pointers: 1,\n time: 251, // minimal time of the pointer to be pressed\n threshold: 9 // a minimal movement is ok, but keep it low\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_AUTO];\n },\n\n process: function(input) {\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n\n this._input = input;\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.time, this);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && (input.eventType & INPUT_END)) {\n this.manager.emit(this.options.event + 'up', input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction RotateRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(RotateRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof RotateRecognizer\n */\n defaults: {\n event: 'rotate',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n }\n});\n\n/**\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction SwipeRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(SwipeRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof SwipeRecognizer\n */\n defaults: {\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n },\n\n getTouchAction: function() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n },\n\n attrTest: function(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return this._super.attrTest.call(this, input) &&\n direction & input.offsetDirection &&\n input.distance > this.options.threshold &&\n input.maxPointers == this.options.pointers &&\n abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n },\n\n emit: function(input) {\n var direction = directionStr(input.offsetDirection);\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n }\n});\n\n/**\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\nfunction TapRecognizer() {\n Recognizer.apply(this, arguments);\n\n // previous time and center,\n // used for tap counting\n this.pTime = false;\n this.pCenter = false;\n\n this._timer = null;\n this._input = null;\n this.count = 0;\n}\n\ninherit(TapRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300, // max time between the multi-tap taps\n time: 250, // max time of the pointer to be down (like finger on the screen)\n threshold: 9, // a minimal movement is ok, but keep it low\n posThreshold: 10 // a multi-tap can be a bit off the initial position\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_MANIPULATION];\n },\n\n process: function(input) {\n var options = this.options;\n\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n\n this.reset();\n\n if ((input.eventType & INPUT_START) && (this.count === 0)) {\n return this.failTimeout();\n }\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType != INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input;\n\n // if tap count matches we have recognized it,\n // else it has began recognizing...\n var tapCount = this.count % options.taps;\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.interval, this);\n return STATE_BEGAN;\n }\n }\n }\n return STATE_FAILED;\n },\n\n failTimeout: function() {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_FAILED;\n }, this.options.interval, this);\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function() {\n if (this.state == STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Hammer(element, options) {\n options = options || {};\n options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\n return new Manager(element, options);\n}\n\n/**\n * @const {string}\n */\nHammer.VERSION = '2.0.7';\n\n/**\n * default settings\n * @namespace\n */\nHammer.defaults = {\n /**\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * @type {Array}\n */\n preset: [\n // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\n [RotateRecognizer, {enable: false}],\n [PinchRecognizer, {enable: false}, ['rotate']],\n [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],\n [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],\n [TapRecognizer],\n [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],\n [PressRecognizer]\n ],\n\n /**\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: 'none',\n\n /**\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: 'none',\n\n /**\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: 'none',\n\n /**\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: 'none',\n\n /**\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: 'none',\n\n /**\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: 'rgba(0,0,0,0)'\n }\n};\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n\n/**\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Manager(element, options) {\n this.options = assign({}, Hammer.defaults, options || {});\n\n this.options.inputTarget = this.options.inputTarget || element;\n\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n\n toggleCssProps(this, true);\n\n each(this.options.recognizers, function(item) {\n var recognizer = this.add(new (item[0])(item[1]));\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n}\n\nManager.prototype = {\n /**\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n set: function(options) {\n assign(this.options, options);\n\n // Options that need a little more setup\n if (options.touchAction) {\n this.touchAction.update();\n }\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n return this;\n },\n\n /**\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n stop: function(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n },\n\n /**\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n var session = this.session;\n if (session.stopped) {\n return;\n }\n\n // run the touch-action polyfill\n this.touchAction.preventDefaults(inputData);\n\n var recognizer;\n var recognizers = this.recognizers;\n\n // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n var curRecognizer = session.curRecognizer;\n\n // reset when the last recognizer is recognized\n // or when we're in a new session\n if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\n curRecognizer = session.curRecognizer = null;\n }\n\n var i = 0;\n while (i < recognizers.length) {\n recognizer = recognizers[i];\n\n // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer == curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) { // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n }\n\n // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n curRecognizer = session.curRecognizer = recognizer;\n }\n i++;\n }\n },\n\n /**\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n get: function(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event == recognizer) {\n return recognizers[i];\n }\n }\n return null;\n },\n\n /**\n * add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n add: function(recognizer) {\n if (invokeArrayArg(recognizer, 'add', this)) {\n return this;\n }\n\n // remove existing\n var existing = this.get(recognizer.options.event);\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n\n this.touchAction.update();\n return recognizer;\n },\n\n /**\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n remove: function(recognizer) {\n if (invokeArrayArg(recognizer, 'remove', this)) {\n return this;\n }\n\n recognizer = this.get(recognizer);\n\n // let's make sure this recognizer exists\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, recognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n },\n\n /**\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n on: function(events, handler) {\n if (events === undefined) {\n return;\n }\n if (handler === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n },\n\n /**\n * unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n off: function(events, handler) {\n if (events === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n },\n\n /**\n * emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n emit: function(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n }\n\n // no handlers, so skip it all\n var handlers = this.handlers[event] && this.handlers[event].slice();\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n data.preventDefault = function() {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n },\n\n /**\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n destroy: function() {\n this.element && toggleCssProps(this, false);\n\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n }\n};\n\n/**\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\nfunction toggleCssProps(manager, add) {\n var element = manager.element;\n if (!element.style) {\n return;\n }\n var prop;\n each(manager.options.cssProps, function(value, name) {\n prop = prefixed(element.style, name);\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || '';\n }\n });\n if (!add) {\n manager.oldCssProps = {};\n }\n}\n\n/**\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\nfunction triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent('Event');\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n}\n\nassign(Hammer, {\n INPUT_START: INPUT_START,\n INPUT_MOVE: INPUT_MOVE,\n INPUT_END: INPUT_END,\n INPUT_CANCEL: INPUT_CANCEL,\n\n STATE_POSSIBLE: STATE_POSSIBLE,\n STATE_BEGAN: STATE_BEGAN,\n STATE_CHANGED: STATE_CHANGED,\n STATE_ENDED: STATE_ENDED,\n STATE_RECOGNIZED: STATE_RECOGNIZED,\n STATE_CANCELLED: STATE_CANCELLED,\n STATE_FAILED: STATE_FAILED,\n\n DIRECTION_NONE: DIRECTION_NONE,\n DIRECTION_LEFT: DIRECTION_LEFT,\n DIRECTION_RIGHT: DIRECTION_RIGHT,\n DIRECTION_UP: DIRECTION_UP,\n DIRECTION_DOWN: DIRECTION_DOWN,\n DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\n DIRECTION_VERTICAL: DIRECTION_VERTICAL,\n DIRECTION_ALL: DIRECTION_ALL,\n\n Manager: Manager,\n Input: Input,\n TouchAction: TouchAction,\n\n TouchInput: TouchInput,\n MouseInput: MouseInput,\n PointerEventInput: PointerEventInput,\n TouchMouseInput: TouchMouseInput,\n SingleTouchInput: SingleTouchInput,\n\n Recognizer: Recognizer,\n AttrRecognizer: AttrRecognizer,\n Tap: TapRecognizer,\n Pan: PanRecognizer,\n Swipe: SwipeRecognizer,\n Pinch: PinchRecognizer,\n Rotate: RotateRecognizer,\n Press: PressRecognizer,\n\n on: addEventListeners,\n off: removeEventListeners,\n each: each,\n merge: merge,\n extend: extend,\n assign: assign,\n inherit: inherit,\n bindFn: bindFn,\n prefixed: prefixed\n});\n\n// this prevents errors when Hammer is loaded in the presence of an AMD\n// style loader but by script tag, not by the loader.\nvar freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line\nfreeGlobal.Hammer = Hammer;\n\nif (typeof define === 'function' && define.amd) {\n define(function() {\n return Hammer;\n });\n} else if (typeof module != 'undefined' && module.exports) {\n module.exports = Hammer;\n} else {\n window[exportName] = Hammer;\n}\n\n})(window, document, 'Hammer');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/hammerjs/hammer.js\n// module id = 5\n// module chunks = 0","import '../scss/app.scss';\n\n// import Bootstrap\nimport 'popper.js';\nimport 'bootstrap/js/dist/util';\nimport 'bootstrap/js/dist/alert';\nimport 'bootstrap/js/dist/button';\nimport 'bootstrap/js/dist/carousel';\nimport 'bootstrap/js/dist/collapse';\nimport 'bootstrap/js/dist/dropdown';\nimport 'bootstrap/js/dist/modal';\nimport 'bootstrap/js/dist/tooltip';\nimport 'bootstrap/js/dist/popover';\nimport 'bootstrap/js/dist/scrollspy';\nimport 'bootstrap/js/dist/tab';\n//\n\n//import Vue from 'vue/dist/vue.esm.js';\n\n// import Bootstrap-Vue\n/*import { Carousel } from 'bootstrap-vue/es/components';\nVue.use(Carousel);*/\n\nimport 'offcanvas-bootstrap/dist/js/bootstrap.offcanvas';\n\n// import your custom UI components\nimport './main';\n\nfunction importAll(r) {\n return r.keys().map(r);\n}\n\nconst images = importAll(require.context('../img/', false, /\\.(png|jpe?g|svg)$/));\nconst fontAwesome = importAll(require.context('font-awesome', false, /\\.(otf|eot|svg|ttf|woff|woff2)$/));\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/app.js","import $ from 'jquery';\n\nconst SpinnerUI = (($) => {\n class SpinnerUI {\n static show(callback) {\n $('#PageLoading').show(0, callback);\n }\n\n static hide(callback) {\n $('#PageLoading').hide('slow', callback);\n }\n }\n\n return SpinnerUI;\n})($);\n\nexport default SpinnerUI;\n\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/_components/_ui.spinner.js","import $ from 'jquery';\n\nimport Events from '../_events';\n\nconst CarouselUI = (($) => {\n // Constants\n const NAME = 'CarouselUI';\n\n class CarouselUI {\n // Static methods\n\n static each(callback) {\n $('.js-carousel').each(function(i, e) {\n callback(i, $(e));\n });\n }\n\n static init() {\n this.dispose();\n\n this.each((i, e) => {\n const $e = $(e),\n id = `Carousel${i}`;\n\n $e.attr('id', id);\n $e.data('id', i);\n\n const $items = $(e).find('.carousel-item'),\n count = $items.length;\n if (!count) {\n return;\n }\n\n // create carousel-controls\n if ($e.data('indicators')) {\n const $indicators = $('<ol class=\"carousel-indicators\"></ol>');\n $indicators.append('<li data-target=\"#' + id + '\" data-slide-to=\"0\" class=\"active\"></li>');\n for (let i = 1; i < count; i++) {\n $indicators.append('<li data-target=\"#' + id + '\" data-slide-to=\"' + i + '\"></li>');\n }\n $e.prepend($indicators);\n }\n\n // create arrows\n if ($e.data('arrows')) {\n $e.prepend('<i class=\"carousel-control-prev\" data-target=\"#' + id + '\" role=\"button\" data-slide=\"prev\"><i class=\"fas fa-chevron-left\" aria-hidden=\"true\"></i><i class=\"sr-only\">Previous</i></i>');\n $e.prepend('<i class=\"carousel-control-next\" data-target=\"#' + id + '\" role=\"button\" data-slide=\"next\"><i class=\"fas fa-chevron-right\" aria-hidden=\"true\"></i><i class=\"sr-only\">Next</i></i>');\n }\n\n // init carousel\n $e.carousel();\n\n // init touch swipes\n $e.hammer().bind('swipeleft', (event) => {\n $(event.target).carousel('next');\n });\n\n $e.hammer().bind('swiperight', (event) => {\n $(event.target).carousel('prev');\n });\n\n $e.hammer().bind('panleft', (event) => {\n $(event.target).carousel('next');\n });\n\n $e.hammer().bind('panright', (event) => {\n $(event.target).carousel('prev');\n });\n\n $e.hammer().bind('tap', (event) => {\n $(event.target).carousel('next');\n });\n });\n }\n\n static dispose() {\n this.each((i, e) => {\n $(e).carousel('dispose');\n });\n }\n }\n\n $(window).on(`${Events.AJAX} ${Events.LOADED}`, () => {\n CarouselUI.init();\n });\n\n return CarouselUI;\n})($);\n\nexport default CarouselUI;\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/_components/_ui.carousel.js","import $ from 'jquery';\n\nconst SlidingMenu = (($) => {\n // Constants\n const NAME = 'jsSlidingMenu';\n const DATA_KEY = NAME;\n\n class SlidingMenu {\n // Constructor\n constructor(element) {\n this._element = element;\n const $element = $(this._element);\n $element.addClass(`${NAME}-active`);\n\n // esc button\n $(window).on('keyup',((e) => {\n if (e.which === 27) {\n $element.find('.is-open[data-toggle=\"offcanvas\"]').click();\n }\n }));\n }\n\n // Public methods\n dispose() {\n console.log(`Disposing: ${NAME} elements`);\n\n $(this._element).removeClass(`${NAME}-active`);\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }\n\n static _jQueryInterface() {\n return this.each(function () {\n // attach functionality to element\n const $element = $(this);\n let data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new SlidingMenu(this);\n $element.data(DATA_KEY, data);\n }\n });\n }\n }\n\n // jQuery interface\n $.fn[NAME] = SlidingMenu._jQueryInterface;\n $.fn[NAME].Constructor = SlidingMenu;\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return SlidingMenu._jQueryInterface;\n };\n\n // auto-apply\n $(`.ui.${NAME}`).ready(() => {\n $(`.ui.${NAME}`).jsSlidingMenu();\n });\n\n return SlidingMenu;\n})($);\n\nexport default SlidingMenu;\n\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/_components/_ui.menu.js","import $ from 'jquery';\nimport Events from \"../_events\";\n\nconst FormStorage = (($) => {\n // Constants\n const NAME = 'jsFormStorage';\n const DATA_KEY = NAME;\n const STORAGE = window.localStorage;\n\n class FormStorage {\n // Constructor\n constructor(element) {\n this._element = element;\n const $element = $(this._element);\n const $elements = $element.find('input,textarea');\n\n $element.addClass(`${NAME}-active`);\n\n // restore form data from localStorage\n $elements.each(function () {\n const id = $(this).attr('id');\n const type = $(this).attr('type');\n const val = STORAGE.getItem(NAME + id);\n\n if (id && val && type) {\n if (type && (type === 'checkbox' || type === 'radio')) {\n $(this).prop('checked', val);\n } else {\n $(this).val(val);\n }\n }\n });\n\n // store form data into localStorage\n $elements.change(function () {\n const id = $(this).attr('id');\n const type = $(this).attr('type');\n let val = $(this).val();\n\n if (type && (type === 'checkbox' || type === 'radio')) {\n val = !!$(this).is(':checked');\n }\n\n if (id && type && type !== 'password') {\n STORAGE.setItem(NAME + id, val);\n }\n });\n\n $element.submit(() => {\n $element.data(DATA_KEY).clear();\n });\n\n $element.find('button,[type=\"submit\"],[type=\"clear\"]').click(() => {\n $element.data(DATA_KEY).clear();\n });\n }\n\n // Public methods\n dispose() {\n const $element = $(this._element);\n\n $element.removeClass(`${NAME}-active`);\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }\n\n clear() {\n STORAGE.clear();\n }\n\n static _jQueryInterface() {\n if (typeof window.localStorage !== 'undefined') {\n return this.each(function () {\n // attach functionality to element\n const $element = $(this);\n let data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new FormStorage(this);\n $element.data(DATA_KEY, data);\n }\n });\n }\n }\n }\n\n // jQuery interface\n $.fn[NAME] = FormStorage._jQueryInterface;\n $.fn[NAME].Constructor = FormStorage;\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return FormStorage._jQueryInterface;\n };\n\n // auto-apply\n $(window).on(`${Events.AJAX} ${Events.LOADED}`, () => {\n $('form').jsFormStorage();\n });\n\n return FormStorage;\n})($);\n\nexport default FormStorage;\n\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/_components/_ui.form.storage.js","\"use strict\";\n\nimport $ from 'jquery';\nimport Events from '../_events';\nimport Spinner from './_ui.spinner';\n\nconst AjaxUI = (($) => {\n // Constants\n const G = window;\n const D = document;\n const $Html = $('html');\n const $Body = $('body');\n\n const NAME = 'jsAjaxUI';\n const DATA_KEY = NAME;\n\n class AjaxUI {\n // Constructor\n constructor(element) {\n this._element = element;\n const $element = $(this._element);\n $element.addClass(`${NAME}-active`);\n\n $element.bind('click', function (e) {\n e.preventDefault();\n\n const $this = $(this);\n\n $('.ajax').each(function () {\n const $this = $(this);\n $this.removeClass('active');\n $this.parents('.nav-item').removeClass('active');\n });\n\n $this.addClass('loading');\n\n AjaxUI.load($this.attr('href'), () => {\n $this.removeClass('loading');\n $this.parents('.nav-item').addClass('active');\n $this.addClass('active');\n });\n });\n }\n\n // Public methods\n static load(url, callback) {\n // show spinner\n Spinner.show(() => {\n $Body.removeClass('loaded');\n });\n\n // update document location\n G.MainUI.updateLocation(url);\n\n const absoluteLocation = G.URLDetails['base'] + G.URLDetails['relative'].substring(1);\n if (absoluteLocation !== G.location.href) {\n G.history.pushState({\n ajax: true,\n page: absoluteLocation,\n }, document.title, absoluteLocation);\n }\n\n $.ajax({\n sync: false,\n async: true,\n url,\n dataType: 'json',\n method: 'GET',\n cache: false,\n error(jqXHR) {\n console.warn(`AJAX request failure: ${jqXHR.statusText}`);\n G.location.href = url;\n\n // google analytics\n if (typeof G.ga === 'function') {\n G.ga('send', 'event', 'error', 'AJAX ERROR', jqXHR.statusText);\n }\n },\n success(data, status, jqXHR) {\n AjaxUI.process(data,jqXHR, callback);\n\n // google analytics\n if (typeof G.ga === 'function') {\n G.ga('set', {\n page: G.URLDetails['relative'] + G.URLDetails['hash'],\n title: jqXHR.getResponseHeader('X-Title'),\n });\n G.ga('send', 'pageview');\n }\n },\n });\n }\n\n static process(data, jqXHR, callback) {\n const css = jqXHR.getResponseHeader('X-Include-CSS').split(',') || [];\n const js = jqXHR.getResponseHeader('X-Include-JS').split(',') || [];\n\n // Replace HTML regions\n if (typeof (data.regions) === 'object') {\n for (const key in data.regions) {\n if (typeof (data.regions[key]) === 'string') {\n AjaxUI.replaceRegion(data.regions[key], key);\n }\n }\n }\n\n // remove already loaded scripts\n $('link[type=\"text/css\"]').each(function () {\n const i = css.indexOf($(this).attr('href'));\n if (i > -1) {\n css.splice(i, 1);\n }else if(!$Body.data('unload-blocked')) {\n console.log(`Unloading: ${ $(this).attr('href')}`);\n $(this).remove();\n }\n });\n\n $('script[type=\"text/javascript\"]').each(function () {\n const i = js.indexOf($(this).attr('src'));\n if (i > -1) {\n js.splice(i, 1);\n }else if(!$Body.data('unload-blocked')) {\n console.log(`Unloading: ${ $(this).attr('src')}`);\n $(this).remove();\n }\n });\n\n // preload CSS\n this.preload(css).then(() => {\n const $head = $('head');\n css.forEach((el) => {\n $head.append(`<link rel=\"stylesheet\" type=\"text/css\" href=\"${el}\" />`);\n });\n\n // preload JS\n this.preload(js, 'script').then(() => {\n\n js.forEach((el) => {\n $Body.append(`<script type=\"text/javascript\" charset=\"UTF-8\" src=\"${el}\"></script>`);\n });\n\n console.log('New page is loaded!');\n\n // trigger events\n if (typeof (data.events) === 'object') {\n for (const eventName in data.events) {\n $(D).trigger(eventName, [data.events[eventName]]);\n }\n }\n\n if (typeof callback !== 'undefined') {\n callback();\n }\n\n $(G).trigger(Events.AJAX);\n });\n });\n }\n\n static preload(items, type = 'text', cache = true) {\n if (!items.length) {\n return $.Deferred().resolve().promise();\n }\n\n const dfds = [];\n items.forEach((url) => {\n const dfd = $.Deferred();\n\n $.ajax({\n dataType: type,\n cache,\n url,\n }).always(() => {\n dfd.resolve();\n });\n\n dfds.push(dfd);\n });\n\n // return a master promise object which will resolve when all the deferred objects have resolved\n return $.when(...dfds);\n }\n\n static replaceRegion(html, key) {\n const $region = $(`[data-ajax-region=\"${key}\"]`);\n\n if ($region.length) {\n $region.empty().append(html);\n } else {\n console.warn('Region returned without class or id!');\n }\n }\n\n dispose() {\n const $element = $(this._element);\n\n $element.removeClass(`${NAME}-active`);\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }\n\n static _jQueryInterface() {\n return this.each(function () {\n // attach functionality to element\n const $element = $(this);\n let data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new AjaxUI(this);\n $element.data(DATA_KEY, data);\n }\n });\n }\n }\n\n // jQuery interface\n $.fn[NAME] = AjaxUI._jQueryInterface;\n $.fn[NAME].Constructor = AjaxUI;\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return AjaxUI._jQueryInterface;\n };\n\n // auto-apply\n $('.ajax').ready(() => {\n $('.ajax').jsAjaxUI();\n });\n\n // AJAX update browser title\n $(D).on('layoutRefresh', (e, data) => {\n D.title = data.Title;\n\n $Html.attr('class','');\n if(data.ClassName){\n $Html.addClass(data.ClassName);\n }\n //data.Link = (data.Link === '/home/') ? '/' : data.Link;\n });\n\n // Back/Forward functionality\n G.onpopstate = function(event) {\n const $existingLink = $(`a[href^=\"${ D.location }\"]`);\n\n if(event.state !== null && event.state.ajax){\n console.log('GOBACK (AJAX state)');\n AjaxUI.load(event.state.page);\n }else if($existingLink.length && $existingLink.hasClass('ajax')){\n console.log('GOBACK (AJAX link)');\n $existingLink.trigger('click');\n }else{\n console.log('GOBACK (HTTP)');\n G.location.href = D.location;\n }\n };\n\n return AjaxUI;\n})($);\n\nexport default AjaxUI;\n\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/_components/_ui.ajax.js","\"use strict\";\n\nimport $ from 'jquery';\n\nimport 'hammerjs/hammer';\nimport 'jquery-hammerjs/jquery.hammer';\n\n// Routie\nimport 'pouchdb/dist/pouchdb';\nimport './_components/routes/index';\n\nimport Events from './_events';\nimport Spinner from './_components/_ui.spinner';\n\nimport './_components/_ui.carousel';\nimport './_components/_ui.menu';\nimport './_components/_ui.form.storage';\nimport AjaxUI from './_components/_ui.ajax';\n\nimport SmoothScroll from 'smooth-scroll';\nconst smoothScroll = SmoothScroll();\n\nconst MainUI = (($) => {\n // Constants\n const W = window;\n const D = document;\n const $Body = $('body');\n\n const NAME = 'MainUI';\n\n // get browser locale\n //const Locale = $('html').attr('lang').substring(0, 2);\n\n const $AlertNotify = $('#AlertNotify');\n const $SiteWideMessage = $('#SiteWideMessage');\n\n // get browser window visibility preferences\n // Opera 12.10, Firefox >=18, Chrome >=31, IE11\n const HiddenName = 'hidden';\n const VisibilityChangeEvent = 'visibilitychange';\n\n // update visibility state\n D.addEventListener(VisibilityChangeEvent, () => {\n if (D.visibilityState === HiddenName) {\n console.log('Tab: hidden');\n $Body.addClass('is-hidden');\n $Body.trigger('tabHidden');\n } else {\n console.log('Tab: focused');\n $Body.removeClass('is-hidden');\n $Body.trigger('tabFocused');\n }\n });\n\n\n // update online/offline state\n const updateOnlineStatus = function() {\n if (!navigator.onLine) {\n console.log('Tab: offline');\n $Body.addClass('is-offline');\n $Body.trigger('offline');\n } else {\n console.log('Tab: online');\n $Body.removeClass('is-offline');\n $Body.trigger('online');\n }\n };\n\n if (typeof navigator.onLine !== 'undefined') {\n W.addEventListener('offline', () => {\n updateOnlineStatus();\n }, false);\n\n W.addEventListener('online', () => {\n updateOnlineStatus();\n }, false);\n\n W.addEventListener('load', () => {\n updateOnlineStatus();\n });\n }\n\n // scrollTo\n const ScrollTo = function(trigger, selector) {\n smoothScroll.animateScroll(\n D.querySelector(selector),\n trigger, {\n speed: 500,\n offset: -20,\n //easing: 'easeInOutCubic',\n // Callback API\n //before: function (anchor, toggle) {}, // Callback to run before scroll\n //`after: function (anchor, toggle) {} // Callback to run after scroll\n }\n );\n };\n\n // session ping\n setInterval(() => {\n if ($Body.hasClass('is-offline')) {\n return;\n }\n\n $.ajax({\n sync: false,\n async: true,\n cache: false,\n url: '/Security/ping',\n global: false,\n type: 'POST',\n complete(data, datastatus) {\n if (datastatus !== 'success') {\n W.location.reload(false);\n }\n },\n });\n }, 300000); // 5 min in ms\n\n W.URLDetails = {\n 'base': $('base').attr('href'),\n 'relative': '/',\n 'hash': '',\n };\n\n class MainUI {\n // Static methods\n\n static init() {\n this.dispose();\n\n console.log(`Initializing: ${NAME}`);\n\n // update location details\n this.updateLocation();\n\n // mark available offline areas\n if ('caches' in W) {\n $('a.offline').addClass('offline-available');\n }\n\n this.loadImages();\n\n // mark external links\n $('a.external,a[rel=\"external\"]').attr('target', '_blank');\n\n // show encoded emails\n /*$(D).find('.obm').each(function () {\n if ($(this).attr('data-val') !== undefined) {\n const email = $(this).attr('data-val').split('')\n .reverse()\n .join('')\n .slice(0, -8)\n .replace(/[a-zA-Z]/g, (c) => String.fromCharCode((c <= 'Z' ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26))\n .replace('#AT#', '@');\n const attr = $(this).attr('data-val-append');\n if (attr !== undefined && attr !== false) {\n $(this).append(email);\n }\n if ($(this).find('.sr-only').length > 0) {\n $(this).find('.sr-only').append(email);\n }\n if ($(this).attr('href') !== undefined) {\n $(this).attr('href', `mailto:${email}`);\n }\n }\n });*/\n //\n\n // scroll links\n $(D).on('click', '.js-scrollTo', function(e) {\n e.preventDefault();\n ScrollTo(this, $(this).attr('data-target'));\n });\n\n // load external fonts\n if ($('[data-extfont]').length) {\n $.getScript('//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js', () => {\n const fonts = [];\n $('[data-extfont]').each(function(i) {\n fonts[i] = $(this).attr('data-extfont');\n });\n W.WebFont.load({\n google: {\n families: fonts,\n },\n });\n });\n }\n\n // hide spinner\n Spinner.hide(() => {\n $Body.addClass('loaded');\n });\n\n // fire page printing\n if (W.URLDetails['hash'].indexOf('printpage') > -1) {\n W.print();\n }\n }\n\n static updateLocation(url) {\n let location = url || W.location.href;\n location = location.replace(W.URLDetails['base'], '/');\n const hash = location.indexOf('#');\n\n W.URLDetails.relative = location.split('#')[0];\n W.URLDetails.hash = (hash >= 0) ? location.substr(location.indexOf('#')) : '';\n }\n\n // show site-wide alert\n static alert(msg, cls) {\n $SiteWideMessage.fadeOut('fast');\n\n $SiteWideMessage.html(`<div class=\"page-alert\"><div class=\"alert alert-${cls}\"><i class=\"close\" data-dismiss=\"alert\">&times;</i>${msg}</div></div>`);\n $SiteWideMessage.find('.page-alert').alert();\n\n $SiteWideMessage.find('.close[data-dismiss=\"alert\"]').click(() => {\n $SiteWideMessage.fadeOut('slow', () => {\n $SiteWideMessage.find('.page-alert').alert('close');\n });\n });\n\n $SiteWideMessage.fadeIn('slow');\n\n if ($AlertNotify.length) {\n $AlertNotify[0].play();\n }\n\n $(W).trigger('alert-appeared');\n }\n\n // hide site-wide alert\n static alertHide() {\n if ($SiteWideMessage.length !== 0) {\n $SiteWideMessage.fadeOut('slow', () => {\n $SiteWideMessage.find('.alert').alert('close');\n });\n }\n\n if (\n $AlertNotify.length &&\n typeof $AlertNotify[0].stop !== 'undefined'\n ) {\n $AlertNotify[0].stop();\n }\n\n $(W).trigger('alert-removed');\n }\n\n // load all images\n static loadImages() {\n const $imgs = $Body.find('img');\n const $imgUrls = [];\n const $imgLazyUrls = [];\n\n // collect image details\n $imgs.each(function() {\n const src = $(this).attr('src');\n const lazySrc = $(this).data('lazy-src');\n if (src.length) {\n $imgUrls.push(src);\n }\n if (lazySrc) {\n $imgLazyUrls.push(lazySrc);\n }\n });\n\n // load defined images\n AjaxUI.preload($imgUrls).then(() => {\n $(W).trigger('images-loaded');\n\n // load lazy images\n AjaxUI.preload($imgLazyUrls).then(() => {\n // update lazy img src\n $('img[data-lazy-src]').each(function() {\n if (!$(this).attr('src')) {\n return;\n }\n $(this).attr('src', $(this).data('lazy-src'));\n });\n\n console.log('All images are loaded!');\n\n $(W).trigger('images-lazy-loaded');\n });\n });\n }\n\n static dispose() {\n console.log(`Destroying: ${NAME}`);\n }\n }\n\n $(W).on(`${Events.AJAX} ${Events.LOADED}`, () => {\n MainUI.init();\n });\n\n W.MainUI = MainUI;\n\n return MainUI;\n})($);\n\nexport default MainUI;\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/main.js","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Util = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined; // eslint-disable-line no-undefined\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $(this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator;\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || '';\n }\n\n try {\n var $selector = $(document).find(selector);\n return $selector.length > 0 ? selector : null;\n } catch (err) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $(element).css('transition-duration');\n var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END);\n },\n // TODO: Remove in v5\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n }\n };\n setTransitionEndSupport();\n return Util;\n}($);\n//# sourceMappingURL=util.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/util.js\n// module id = 8\n// module chunks = 0","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Alert = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'alert';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.alert';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Selector = {\n DISMISS: '[data-dismiss=\"alert\"]'\n };\n var Event = {\n CLOSE: \"close\" + EVENT_KEY,\n CLOSED: \"closed\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n ALERT: 'alert',\n FADE: 'fade',\n SHOW: 'show'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Alert =\n /*#__PURE__*/\n function () {\n function Alert(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Alert.prototype;\n\n // Public\n _proto.close = function close(element) {\n var rootElement = this._element;\n\n if (element) {\n rootElement = this._getRootElement(element);\n }\n\n var customEvent = this._triggerCloseEvent(rootElement);\n\n if (customEvent.isDefaultPrevented()) {\n return;\n }\n\n this._removeElement(rootElement);\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Private\n\n\n _proto._getRootElement = function _getRootElement(element) {\n var selector = Util.getSelectorFromElement(element);\n var parent = false;\n\n if (selector) {\n parent = $(selector)[0];\n }\n\n if (!parent) {\n parent = $(element).closest(\".\" + ClassName.ALERT)[0];\n }\n\n return parent;\n };\n\n _proto._triggerCloseEvent = function _triggerCloseEvent(element) {\n var closeEvent = $.Event(Event.CLOSE);\n $(element).trigger(closeEvent);\n return closeEvent;\n };\n\n _proto._removeElement = function _removeElement(element) {\n var _this = this;\n\n $(element).removeClass(ClassName.SHOW);\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element);\n\n return;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(element);\n $(element).one(Util.TRANSITION_END, function (event) {\n return _this._destroyElement(element, event);\n }).emulateTransitionEnd(transitionDuration);\n };\n\n _proto._destroyElement = function _destroyElement(element) {\n $(element).detach().trigger(Event.CLOSED).remove();\n }; // Static\n\n\n Alert._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new Alert(this);\n $element.data(DATA_KEY, data);\n }\n\n if (config === 'close') {\n data[config](this);\n }\n });\n };\n\n Alert._handleDismiss = function _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault();\n }\n\n alertInstance.close(this);\n };\n };\n\n _createClass(Alert, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Alert;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Alert._jQueryInterface;\n $.fn[NAME].Constructor = Alert;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Alert._jQueryInterface;\n };\n\n return Alert;\n}($);\n//# sourceMappingURL=alert.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/alert.js\n// module id = 9\n// module chunks = 0","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Button = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'button';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.button';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ClassName = {\n ACTIVE: 'active',\n BUTTON: 'btn',\n FOCUS: 'focus'\n };\n var Selector = {\n DATA_TOGGLE_CARROT: '[data-toggle^=\"button\"]',\n DATA_TOGGLE: '[data-toggle=\"buttons\"]',\n INPUT: 'input',\n ACTIVE: '.active',\n BUTTON: '.btn'\n };\n var Event = {\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY,\n FOCUS_BLUR_DATA_API: \"focus\" + EVENT_KEY + DATA_API_KEY + \" \" + (\"blur\" + EVENT_KEY + DATA_API_KEY)\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Button =\n /*#__PURE__*/\n function () {\n function Button(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Button.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n var triggerChangeEvent = true;\n var addAriaPressed = true;\n var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];\n\n if (rootElement) {\n var input = $(this._element).find(Selector.INPUT)[0];\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {\n triggerChangeEvent = false;\n } else {\n var activeElement = $(rootElement).find(Selector.ACTIVE)[0];\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE);\n }\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {\n return;\n }\n\n input.checked = !$(this._element).hasClass(ClassName.ACTIVE);\n $(input).trigger('change');\n }\n\n input.focus();\n addAriaPressed = false;\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE);\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Static\n\n\n Button._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n if (!data) {\n data = new Button(this);\n $(this).data(DATA_KEY, data);\n }\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n };\n\n _createClass(Button, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Button;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {\n event.preventDefault();\n var button = event.target;\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON);\n }\n\n Button._jQueryInterface.call($(button), 'toggle');\n }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {\n var button = $(event.target).closest(Selector.BUTTON)[0];\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Button._jQueryInterface;\n $.fn[NAME].Constructor = Button;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Button._jQueryInterface;\n };\n\n return Button;\n}($);\n//# sourceMappingURL=button.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/button.js\n// module id = 10\n// module chunks = 0","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Carousel = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'carousel';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.carousel';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n\n var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n var Default = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true\n };\n var DefaultType = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean'\n };\n var Direction = {\n NEXT: 'next',\n PREV: 'prev',\n LEFT: 'left',\n RIGHT: 'right'\n };\n var Event = {\n SLIDE: \"slide\" + EVENT_KEY,\n SLID: \"slid\" + EVENT_KEY,\n KEYDOWN: \"keydown\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY,\n TOUCHEND: \"touchend\" + EVENT_KEY,\n LOAD_DATA_API: \"load\" + EVENT_KEY + DATA_API_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n CAROUSEL: 'carousel',\n ACTIVE: 'active',\n SLIDE: 'slide',\n RIGHT: 'carousel-item-right',\n LEFT: 'carousel-item-left',\n NEXT: 'carousel-item-next',\n PREV: 'carousel-item-prev',\n ITEM: 'carousel-item'\n };\n var Selector = {\n ACTIVE: '.active',\n ACTIVE_ITEM: '.active.carousel-item',\n ITEM: '.carousel-item',\n NEXT_PREV: '.carousel-item-next, .carousel-item-prev',\n INDICATORS: '.carousel-indicators',\n DATA_SLIDE: '[data-slide], [data-slide-to]',\n DATA_RIDE: '[data-ride=\"carousel\"]'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Carousel =\n /*#__PURE__*/\n function () {\n function Carousel(element, config) {\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this._config = this._getConfig(config);\n this._element = $(element)[0];\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Carousel.prototype;\n\n // Public\n _proto.next = function next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT);\n }\n };\n\n _proto.nextWhenVisible = function nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {\n this.next();\n }\n };\n\n _proto.prev = function prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV);\n }\n };\n\n _proto.pause = function pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if ($(this._element).find(Selector.NEXT_PREV)[0]) {\n Util.triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n };\n\n _proto.cycle = function cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n };\n\n _proto.to = function to(index) {\n var _this = this;\n\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];\n\n var activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, function () {\n return _this.to(index);\n });\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;\n\n this._slide(direction, this._items[index]);\n };\n\n _proto.dispose = function dispose() {\n $(this._element).off(EVENT_KEY);\n $.removeData(this._element, DATA_KEY);\n this._items = null;\n this._config = null;\n this._element = null;\n this._interval = null;\n this._isPaused = null;\n this._isSliding = null;\n this._activeElement = null;\n this._indicatorsElement = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this2 = this;\n\n if (this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN, function (event) {\n return _this2._keydown(event);\n });\n }\n\n if (this._config.pause === 'hover') {\n $(this._element).on(Event.MOUSEENTER, function (event) {\n return _this2.pause(event);\n }).on(Event.MOUSELEAVE, function (event) {\n return _this2.cycle(event);\n });\n\n if ('ontouchstart' in document.documentElement) {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n $(this._element).on(Event.TOUCHEND, function () {\n _this2.pause();\n\n if (_this2.touchTimeout) {\n clearTimeout(_this2.touchTimeout);\n }\n\n _this2.touchTimeout = setTimeout(function (event) {\n return _this2.cycle(event);\n }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);\n });\n }\n }\n };\n\n _proto._keydown = function _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault();\n this.prev();\n break;\n\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault();\n this.next();\n break;\n\n default:\n }\n };\n\n _proto._getItemIndex = function _getItemIndex(element) {\n this._items = $.makeArray($(element).parent().find(Selector.ITEM));\n return this._items.indexOf(element);\n };\n\n _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {\n var isNextDirection = direction === Direction.NEXT;\n var isPrevDirection = direction === Direction.PREV;\n\n var activeIndex = this._getItemIndex(activeElement);\n\n var lastItemIndex = this._items.length - 1;\n var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement;\n }\n\n var delta = direction === Direction.PREV ? -1 : 1;\n var itemIndex = (activeIndex + delta) % this._items.length;\n return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];\n };\n\n _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {\n var targetIndex = this._getItemIndex(relatedTarget);\n\n var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]);\n\n var slideEvent = $.Event(Event.SLIDE, {\n relatedTarget: relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n $(this._element).trigger(slideEvent);\n return slideEvent;\n };\n\n _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);\n\n var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE);\n }\n }\n };\n\n _proto._slide = function _slide(direction, element) {\n var _this3 = this;\n\n var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];\n\n var activeElementIndex = this._getItemIndex(activeElement);\n\n var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);\n\n var nextElementIndex = this._getItemIndex(nextElement);\n\n var isCycling = Boolean(this._interval);\n var directionalClassName;\n var orderClassName;\n var eventDirectionName;\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT;\n orderClassName = ClassName.NEXT;\n eventDirectionName = Direction.LEFT;\n } else {\n directionalClassName = ClassName.RIGHT;\n orderClassName = ClassName.PREV;\n eventDirectionName = Direction.RIGHT;\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false;\n return;\n }\n\n var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n var slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n\n if ($(this._element).hasClass(ClassName.SLIDE)) {\n $(nextElement).addClass(orderClassName);\n Util.reflow(nextElement);\n $(activeElement).addClass(directionalClassName);\n $(nextElement).addClass(directionalClassName);\n var transitionDuration = Util.getTransitionDurationFromElement(activeElement);\n $(activeElement).one(Util.TRANSITION_END, function () {\n $(nextElement).removeClass(directionalClassName + \" \" + orderClassName).addClass(ClassName.ACTIVE);\n $(activeElement).removeClass(ClassName.ACTIVE + \" \" + orderClassName + \" \" + directionalClassName);\n _this3._isSliding = false;\n setTimeout(function () {\n return $(_this3._element).trigger(slidEvent);\n }, 0);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE);\n $(nextElement).addClass(ClassName.ACTIVE);\n this._isSliding = false;\n $(this._element).trigger(slidEvent);\n }\n\n if (isCycling) {\n this.cycle();\n }\n }; // Static\n\n\n Carousel._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $(this).data());\n\n if (typeof config === 'object') {\n _config = _objectSpread({}, _config, config);\n }\n\n var action = typeof config === 'string' ? config : _config.slide;\n\n if (!data) {\n data = new Carousel(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + action + \"\\\"\");\n }\n\n data[action]();\n } else if (_config.interval) {\n data.pause();\n data.cycle();\n }\n });\n };\n\n Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {\n var selector = Util.getSelectorFromElement(this);\n\n if (!selector) {\n return;\n }\n\n var target = $(selector)[0];\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return;\n }\n\n var config = _objectSpread({}, $(target).data(), $(this).data());\n\n var slideIndex = this.getAttribute('data-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel._jQueryInterface.call($(target), config);\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex);\n }\n\n event.preventDefault();\n };\n\n _createClass(Carousel, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Carousel;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);\n $(window).on(Event.LOAD_DATA_API, function () {\n $(Selector.DATA_RIDE).each(function () {\n var $carousel = $(this);\n\n Carousel._jQueryInterface.call($carousel, $carousel.data());\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Carousel._jQueryInterface;\n $.fn[NAME].Constructor = Carousel;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Carousel._jQueryInterface;\n };\n\n return Carousel;\n}($);\n//# sourceMappingURL=carousel.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/carousel.js\n// module id = 11\n// module chunks = 0","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Collapse = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'collapse';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.collapse';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Default = {\n toggle: true,\n parent: ''\n };\n var DefaultType = {\n toggle: 'boolean',\n parent: '(string|element)'\n };\n var Event = {\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n SHOW: 'show',\n COLLAPSE: 'collapse',\n COLLAPSING: 'collapsing',\n COLLAPSED: 'collapsed'\n };\n var Dimension = {\n WIDTH: 'width',\n HEIGHT: 'height'\n };\n var Selector = {\n ACTIVES: '.show, .collapsing',\n DATA_TOGGLE: '[data-toggle=\"collapse\"]'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Collapse =\n /*#__PURE__*/\n function () {\n function Collapse(element, config) {\n this._isTransitioning = false;\n this._element = element;\n this._config = this._getConfig(config);\n this._triggerArray = $.makeArray($(\"[data-toggle=\\\"collapse\\\"][href=\\\"#\" + element.id + \"\\\"],\" + (\"[data-toggle=\\\"collapse\\\"][data-target=\\\"#\" + element.id + \"\\\"]\")));\n var tabToggles = $(Selector.DATA_TOGGLE);\n\n for (var i = 0; i < tabToggles.length; i++) {\n var elem = tabToggles[i];\n var selector = Util.getSelectorFromElement(elem);\n\n if (selector !== null && $(selector).filter(element).length > 0) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null;\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray);\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n var _proto = Collapse.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) {\n return;\n }\n\n var actives;\n var activesData;\n\n if (this._parent) {\n actives = $.makeArray($(this._parent).find(Selector.ACTIVES).filter(\"[data-parent=\\\"\" + this._config.parent + \"\\\"]\"));\n\n if (actives.length === 0) {\n actives = null;\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY);\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n var startEvent = $.Event(Event.SHOW);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');\n\n if (!activesData) {\n $(actives).data(DATA_KEY, null);\n }\n }\n\n var dimension = this._getDimension();\n\n $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);\n this._element.style[dimension] = 0;\n\n if (this._triggerArray.length > 0) {\n $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);\n _this._element.style[dimension] = '';\n\n _this.setTransitioning(false);\n\n $(_this._element).trigger(Event.SHOWN);\n };\n\n var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n var scrollSize = \"scroll\" + capitalizedDimension;\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n this._element.style[dimension] = this._element[scrollSize] + \"px\";\n };\n\n _proto.hide = function hide() {\n var _this2 = this;\n\n if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) {\n return;\n }\n\n var startEvent = $.Event(Event.HIDE);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n var dimension = this._getDimension();\n\n this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + \"px\";\n Util.reflow(this._element);\n $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);\n\n if (this._triggerArray.length > 0) {\n for (var i = 0; i < this._triggerArray.length; i++) {\n var trigger = this._triggerArray[i];\n var selector = Util.getSelectorFromElement(trigger);\n\n if (selector !== null) {\n var $elem = $(selector);\n\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);\n }\n }\n }\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n _this2.setTransitioning(false);\n\n $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);\n };\n\n this._element.style[dimension] = '';\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n };\n\n _proto.setTransitioning = function setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning;\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._config = null;\n this._parent = null;\n this._element = null;\n this._triggerArray = null;\n this._isTransitioning = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._getDimension = function _getDimension() {\n var hasWidth = $(this._element).hasClass(Dimension.WIDTH);\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;\n };\n\n _proto._getParent = function _getParent() {\n var _this3 = this;\n\n var parent = null;\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent; // It's a jQuery object\n\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0];\n }\n } else {\n parent = $(this._config.parent)[0];\n }\n\n var selector = \"[data-toggle=\\\"collapse\\\"][data-parent=\\\"\" + this._config.parent + \"\\\"]\";\n $(parent).find(selector).each(function (i, element) {\n _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);\n });\n return parent;\n };\n\n _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n var isOpen = $(element).hasClass(ClassName.SHOW);\n\n if (triggerArray.length > 0) {\n $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);\n }\n }\n }; // Static\n\n\n Collapse._getTargetFromElement = function _getTargetFromElement(element) {\n var selector = Util.getSelectorFromElement(element);\n return selector ? $(selector)[0] : null;\n };\n\n Collapse._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n if (!data) {\n data = new Collapse(this, _config);\n $this.data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Collapse, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Collapse;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n var $trigger = $(this);\n var selector = Util.getSelectorFromElement(this);\n $(selector).each(function () {\n var $target = $(this);\n var data = $target.data(DATA_KEY);\n var config = data ? 'toggle' : $trigger.data();\n\n Collapse._jQueryInterface.call($target, config);\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface;\n $.fn[NAME].Constructor = Collapse;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Collapse._jQueryInterface;\n };\n\n return Collapse;\n}($);\n//# sourceMappingURL=collapse.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/collapse.js\n// module id = 12\n// module chunks = 0","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Dropdown = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'dropdown';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.dropdown';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key\n\n var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key\n\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n\n var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)\n\n var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + \"|\" + ARROW_DOWN_KEYCODE + \"|\" + ESCAPE_KEYCODE);\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY,\n KEYDOWN_DATA_API: \"keydown\" + EVENT_KEY + DATA_API_KEY,\n KEYUP_DATA_API: \"keyup\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DISABLED: 'disabled',\n SHOW: 'show',\n DROPUP: 'dropup',\n DROPRIGHT: 'dropright',\n DROPLEFT: 'dropleft',\n MENURIGHT: 'dropdown-menu-right',\n MENULEFT: 'dropdown-menu-left',\n POSITION_STATIC: 'position-static'\n };\n var Selector = {\n DATA_TOGGLE: '[data-toggle=\"dropdown\"]',\n FORM_CHILD: '.dropdown form',\n MENU: '.dropdown-menu',\n NAVBAR_NAV: '.navbar-nav',\n VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n };\n var AttachmentMap = {\n TOP: 'top-start',\n TOPEND: 'top-end',\n BOTTOM: 'bottom-start',\n BOTTOMEND: 'bottom-end',\n RIGHT: 'right-start',\n RIGHTEND: 'right-end',\n LEFT: 'left-start',\n LEFTEND: 'left-end'\n };\n var Default = {\n offset: 0,\n flip: true,\n boundary: 'scrollParent',\n reference: 'toggle',\n display: 'dynamic'\n };\n var DefaultType = {\n offset: '(number|string|function)',\n flip: 'boolean',\n boundary: '(string|element)',\n reference: '(string|element)',\n display: 'string'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Dropdown =\n /*#__PURE__*/\n function () {\n function Dropdown(element, config) {\n this._element = element;\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Dropdown.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n var isActive = $(this._menu).hasClass(ClassName.SHOW);\n\n Dropdown._clearMenus();\n\n if (isActive) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $.Event(Event.SHOW, relatedTarget);\n $(parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n } // Disable totally Popper.js for Dropdown in Navbar\n\n\n if (!this._inNavbar) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');\n }\n\n var referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference; // Check if it's jQuery element\n\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0];\n }\n } // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n\n\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName.POSITION_STATIC);\n }\n\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n $(this._menu).toggleClass(ClassName.SHOW);\n $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n $(this._element).off(EVENT_KEY);\n this._element = null;\n this._menu = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n\n this._popper = null;\n }\n };\n\n _proto.update = function update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Private\n\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this = this;\n\n $(this._element).on(Event.CLICK, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n _this.toggle();\n });\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getMenuElement = function _getMenuElement() {\n if (!this._menu) {\n var parent = Dropdown._getParentFromElement(this._element);\n\n this._menu = $(parent).find(Selector.MENU)[0];\n }\n\n return this._menu;\n };\n\n _proto._getPlacement = function _getPlacement() {\n var $parentDropdown = $(this._element).parent();\n var placement = AttachmentMap.BOTTOM; // Handle dropup\n\n if ($parentDropdown.hasClass(ClassName.DROPUP)) {\n placement = AttachmentMap.TOP;\n\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND;\n }\n } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT;\n } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {\n placement = AttachmentMap.LEFT;\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND;\n }\n\n return placement;\n };\n\n _proto._detectNavbar = function _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0;\n };\n\n _proto._getPopperConfig = function _getPopperConfig() {\n var _this2 = this;\n\n var offsetConf = {};\n\n if (typeof this._config.offset === 'function') {\n offsetConf.fn = function (data) {\n data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});\n return data;\n };\n } else {\n offsetConf.offset = this._config.offset;\n }\n\n var popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: offsetConf,\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n } // Disable Popper.js if we have a static display\n\n };\n\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n };\n }\n\n return popperConfig;\n }; // Static\n\n\n Dropdown._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data) {\n data = new Dropdown(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n Dropdown._clearMenus = function _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return;\n }\n\n var toggles = $.makeArray($(Selector.DATA_TOGGLE));\n\n for (var i = 0; i < toggles.length; i++) {\n var parent = Dropdown._getParentFromElement(toggles[i]);\n\n var context = $(toggles[i]).data(DATA_KEY);\n var relatedTarget = {\n relatedTarget: toggles[i]\n };\n\n if (!context) {\n continue;\n }\n\n var dropdownMenu = context._menu;\n\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue;\n }\n\n if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {\n continue;\n }\n\n var hideEvent = $.Event(Event.HIDE, relatedTarget);\n $(parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n continue;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n toggles[i].setAttribute('aria-expanded', 'false');\n $(dropdownMenu).removeClass(ClassName.SHOW);\n $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));\n }\n };\n\n Dropdown._getParentFromElement = function _getParentFromElement(element) {\n var parent;\n var selector = Util.getSelectorFromElement(element);\n\n if (selector) {\n parent = $(selector)[0];\n }\n\n return parent || element.parentNode;\n }; // eslint-disable-next-line complexity\n\n\n Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this);\n\n var isActive = $(parent).hasClass(ClassName.SHOW);\n\n if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];\n $(toggle).trigger('focus');\n }\n\n $(this).trigger('click');\n return;\n }\n\n var items = $(parent).find(Selector.VISIBLE_ITEMS).get();\n\n if (items.length === 0) {\n return;\n }\n\n var index = items.indexOf(event.target);\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) {\n // Up\n index--;\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {\n // Down\n index++;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n items[index].focus();\n };\n\n _createClass(Dropdown, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Dropdown;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + \" \" + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n Dropdown._jQueryInterface.call($(this), 'toggle');\n }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {\n e.stopPropagation();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Dropdown._jQueryInterface;\n $.fn[NAME].Constructor = Dropdown;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Dropdown._jQueryInterface;\n };\n\n return Dropdown;\n}($, Popper);\n//# sourceMappingURL=dropdown.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/dropdown.js\n// module id = 13\n// module chunks = 0","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Modal = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'modal';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.modal';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var Default = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: true\n };\n var DefaultType = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean',\n show: 'boolean'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n RESIZE: \"resize\" + EVENT_KEY,\n CLICK_DISMISS: \"click.dismiss\" + EVENT_KEY,\n KEYDOWN_DISMISS: \"keydown.dismiss\" + EVENT_KEY,\n MOUSEUP_DISMISS: \"mouseup.dismiss\" + EVENT_KEY,\n MOUSEDOWN_DISMISS: \"mousedown.dismiss\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n SCROLLBAR_MEASURER: 'modal-scrollbar-measure',\n BACKDROP: 'modal-backdrop',\n OPEN: 'modal-open',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n DIALOG: '.modal-dialog',\n DATA_TOGGLE: '[data-toggle=\"modal\"]',\n DATA_DISMISS: '[data-dismiss=\"modal\"]',\n FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT: '.sticky-top',\n NAVBAR_TOGGLER: '.navbar-toggler'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Modal =\n /*#__PURE__*/\n function () {\n function Modal(element, config) {\n this._config = this._getConfig(config);\n this._element = element;\n this._dialog = $(element).find(Selector.DIALOG)[0];\n this._backdrop = null;\n this._isShown = false;\n this._isBodyOverflowing = false;\n this._ignoreBackdropClick = false;\n this._scrollbarWidth = 0;\n } // Getters\n\n\n var _proto = Modal.prototype;\n\n // Public\n _proto.toggle = function toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n };\n\n _proto.show = function show(relatedTarget) {\n var _this = this;\n\n if (this._isTransitioning || this._isShown) {\n return;\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true;\n }\n\n var showEvent = $.Event(Event.SHOW, {\n relatedTarget: relatedTarget\n });\n $(this._element).trigger(showEvent);\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = true;\n\n this._checkScrollbar();\n\n this._setScrollbar();\n\n this._adjustDialog();\n\n $(document.body).addClass(ClassName.OPEN);\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {\n return _this.hide(event);\n });\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {\n $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {\n if ($(event.target).is(_this._element)) {\n _this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(function () {\n return _this._showElement(relatedTarget);\n });\n };\n\n _proto.hide = function hide(event) {\n var _this2 = this;\n\n if (event) {\n event.preventDefault();\n }\n\n if (this._isTransitioning || !this._isShown) {\n return;\n }\n\n var hideEvent = $.Event(Event.HIDE);\n $(this._element).trigger(hideEvent);\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = false;\n var transition = $(this._element).hasClass(ClassName.FADE);\n\n if (transition) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(document).off(Event.FOCUSIN);\n $(this._element).removeClass(ClassName.SHOW);\n $(this._element).off(Event.CLICK_DISMISS);\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS);\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, function (event) {\n return _this2._hideModal(event);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n this._hideModal();\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n $(window, document, this._element, this._backdrop).off(EVENT_KEY);\n this._config = null;\n this._element = null;\n this._dialog = null;\n this._backdrop = null;\n this._isShown = null;\n this._isBodyOverflowing = null;\n this._ignoreBackdropClick = null;\n this._scrollbarWidth = null;\n };\n\n _proto.handleUpdate = function handleUpdate() {\n this._adjustDialog();\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._showElement = function _showElement(relatedTarget) {\n var _this3 = this;\n\n var transition = $(this._element).hasClass(ClassName.FADE);\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.scrollTop = 0;\n\n if (transition) {\n Util.reflow(this._element);\n }\n\n $(this._element).addClass(ClassName.SHOW);\n\n if (this._config.focus) {\n this._enforceFocus();\n }\n\n var shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: relatedTarget\n });\n\n var transitionComplete = function transitionComplete() {\n if (_this3._config.focus) {\n _this3._element.focus();\n }\n\n _this3._isTransitioning = false;\n $(_this3._element).trigger(shownEvent);\n };\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);\n } else {\n transitionComplete();\n }\n };\n\n _proto._enforceFocus = function _enforceFocus() {\n var _this4 = this;\n\n $(document).off(Event.FOCUSIN) // Guard against infinite focus loop\n .on(Event.FOCUSIN, function (event) {\n if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {\n _this4._element.focus();\n }\n });\n };\n\n _proto._setEscapeEvent = function _setEscapeEvent() {\n var _this5 = this;\n\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, function (event) {\n if (event.which === ESCAPE_KEYCODE) {\n event.preventDefault();\n\n _this5.hide();\n }\n });\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS);\n }\n };\n\n _proto._setResizeEvent = function _setResizeEvent() {\n var _this6 = this;\n\n if (this._isShown) {\n $(window).on(Event.RESIZE, function (event) {\n return _this6.handleUpdate(event);\n });\n } else {\n $(window).off(Event.RESIZE);\n }\n };\n\n _proto._hideModal = function _hideModal() {\n var _this7 = this;\n\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._isTransitioning = false;\n\n this._showBackdrop(function () {\n $(document.body).removeClass(ClassName.OPEN);\n\n _this7._resetAdjustments();\n\n _this7._resetScrollbar();\n\n $(_this7._element).trigger(Event.HIDDEN);\n });\n };\n\n _proto._removeBackdrop = function _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove();\n this._backdrop = null;\n }\n };\n\n _proto._showBackdrop = function _showBackdrop(callback) {\n var _this8 = this;\n\n var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div');\n this._backdrop.className = ClassName.BACKDROP;\n\n if (animate) {\n $(this._backdrop).addClass(animate);\n }\n\n $(this._backdrop).appendTo(document.body);\n $(this._element).on(Event.CLICK_DISMISS, function (event) {\n if (_this8._ignoreBackdropClick) {\n _this8._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (_this8._config.backdrop === 'static') {\n _this8._element.focus();\n } else {\n _this8.hide();\n }\n });\n\n if (animate) {\n Util.reflow(this._backdrop);\n }\n\n $(this._backdrop).addClass(ClassName.SHOW);\n\n if (!callback) {\n return;\n }\n\n if (!animate) {\n callback();\n return;\n }\n\n var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW);\n\n var callbackRemove = function callbackRemove() {\n _this8._removeBackdrop();\n\n if (callback) {\n callback();\n }\n };\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n\n $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);\n } else {\n callbackRemove();\n }\n } else if (callback) {\n callback();\n }\n }; // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n\n _proto._adjustDialog = function _adjustDialog() {\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = this._scrollbarWidth + \"px\";\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = this._scrollbarWidth + \"px\";\n }\n };\n\n _proto._resetAdjustments = function _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n };\n\n _proto._checkScrollbar = function _checkScrollbar() {\n var rect = document.body.getBoundingClientRect();\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;\n this._scrollbarWidth = this._getScrollbarWidth();\n };\n\n _proto._setScrollbar = function _setScrollbar() {\n var _this9 = this;\n\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n // Adjust fixed content padding\n $(Selector.FIXED_CONTENT).each(function (index, element) {\n var actualPadding = $(element)[0].style.paddingRight;\n var calculatedPadding = $(element).css('padding-right');\n $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + \"px\");\n }); // Adjust sticky content margin\n\n $(Selector.STICKY_CONTENT).each(function (index, element) {\n var actualMargin = $(element)[0].style.marginRight;\n var calculatedMargin = $(element).css('margin-right');\n $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + \"px\");\n }); // Adjust navbar-toggler margin\n\n $(Selector.NAVBAR_TOGGLER).each(function (index, element) {\n var actualMargin = $(element)[0].style.marginRight;\n var calculatedMargin = $(element).css('margin-right');\n $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + \"px\");\n }); // Adjust body padding\n\n var actualPadding = document.body.style.paddingRight;\n var calculatedPadding = $(document.body).css('padding-right');\n $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + \"px\");\n }\n };\n\n _proto._resetScrollbar = function _resetScrollbar() {\n // Restore fixed content padding\n $(Selector.FIXED_CONTENT).each(function (index, element) {\n var padding = $(element).data('padding-right');\n\n if (typeof padding !== 'undefined') {\n $(element).css('padding-right', padding).removeData('padding-right');\n }\n }); // Restore sticky content and navbar-toggler margin\n\n $(Selector.STICKY_CONTENT + \", \" + Selector.NAVBAR_TOGGLER).each(function (index, element) {\n var margin = $(element).data('margin-right');\n\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right');\n }\n }); // Restore body padding\n\n var padding = $(document.body).data('padding-right');\n\n if (typeof padding !== 'undefined') {\n $(document.body).css('padding-right', padding).removeData('padding-right');\n }\n };\n\n _proto._getScrollbarWidth = function _getScrollbarWidth() {\n // thx d.walsh\n var scrollDiv = document.createElement('div');\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER;\n document.body.appendChild(scrollDiv);\n var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n }; // Static\n\n\n Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});\n\n if (!data) {\n data = new Modal(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config](relatedTarget);\n } else if (_config.show) {\n data.show(relatedTarget);\n }\n });\n };\n\n _createClass(Modal, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Modal;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n var _this10 = this;\n\n var target;\n var selector = Util.getSelectorFromElement(this);\n\n if (selector) {\n target = $(selector)[0];\n }\n\n var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault();\n }\n\n var $target = $(target).one(Event.SHOW, function (showEvent) {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return;\n }\n\n $target.one(Event.HIDDEN, function () {\n if ($(_this10).is(':visible')) {\n _this10.focus();\n }\n });\n });\n\n Modal._jQueryInterface.call($(target), config, this);\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Modal._jQueryInterface;\n $.fn[NAME].Constructor = Modal;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Modal._jQueryInterface;\n };\n\n return Modal;\n}($);\n//# sourceMappingURL=modal.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/modal.js\n// module id = 14\n// module chunks = 0","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Tooltip = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tooltip';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.tooltip';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DefaultType = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)'\n };\n var AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<div class=\"tooltip-inner\"></div></div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent'\n };\n var HoverState = {\n SHOW: 'show',\n OUT: 'out'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n };\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TOOLTIP: '.tooltip',\n TOOLTIP_INNER: '.tooltip-inner',\n ARROW: '.arrow'\n };\n var Trigger = {\n HOVER: 'hover',\n FOCUS: 'focus',\n CLICK: 'click',\n MANUAL: 'manual'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tooltip =\n /*#__PURE__*/\n function () {\n function Tooltip(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $.removeData(this.element, this.constructor.DATA_KEY);\n $(this.element).off(this.constructor.EVENT_KEY);\n $(this.element).closest('.modal').off('hide.bs.modal');\n\n if (this.tip) {\n $(this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $.Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent);\n var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n var container = this.config.container === false ? document.body : $(this.config.container);\n $(tip).data(this.constructor.DATA_KEY, this);\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container);\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: {\n offset: this.config.offset\n },\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n _this._handlePopperPlacementChange(data);\n }\n });\n $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $(_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HoverState.OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $.Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $(this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n this._activeTrigger[Trigger.CLICK] = false;\n this._activeTrigger[Trigger.FOCUS] = false;\n this._activeTrigger[Trigger.HOVER] = false;\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Protected\n\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement());\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());\n $tip.removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n var html = this.config.html;\n\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($(content).text());\n }\n } else {\n $element[html ? 'html' : 'text'](content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n }; // Private\n\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this3 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {\n return _this3.toggle(event);\n });\n } else if (trigger !== Trigger.MANUAL) {\n var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;\n var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;\n $(_this3.element).on(eventIn, _this3.config.selector, function (event) {\n return _this3._enter(event);\n }).on(eventOut, _this3.config.selector, function (event) {\n return _this3._leave(event);\n });\n }\n\n $(_this3.element).closest('.modal').on('hide.bs.modal', function () {\n return _this3.hide();\n });\n });\n\n if (this.config.selector) {\n this.config = _objectSpread({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute('data-original-title');\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(data.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $(tip).removeClass(ClassName.FADE);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n }; // Static\n\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME] = Tooltip._jQueryInterface;\n $.fn[NAME].Constructor = Tooltip;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tooltip._jQueryInterface;\n };\n\n return Tooltip;\n}($, Popper);\n//# sourceMappingURL=tooltip.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/tooltip.js\n// module id = 15\n// module chunks = 0","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Popover = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'popover';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.popover';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var CLASS_PREFIX = 'bs-popover';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n\n var Default = _objectSpread({}, Tooltip.Default, {\n placement: 'right',\n trigger: 'click',\n content: '',\n template: '<div class=\"popover\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<h3 class=\"popover-header\"></h3>' + '<div class=\"popover-body\"></div></div>'\n });\n\n var DefaultType = _objectSpread({}, Tooltip.DefaultType, {\n content: '(string|element|function)'\n });\n\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TITLE: '.popover-header',\n CONTENT: '.popover-body'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Popover =\n /*#__PURE__*/\n function (_Tooltip) {\n _inheritsLoose(Popover, _Tooltip);\n\n function Popover() {\n return _Tooltip.apply(this, arguments) || this;\n }\n\n var _proto = Popover.prototype;\n\n // Overrides\n _proto.isWithContent = function isWithContent() {\n return this.getTitle() || this._getContent();\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events\n\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle());\n\n var content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector.CONTENT), content);\n $tip.removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n }; // Private\n\n\n _proto._getContent = function _getContent() {\n return this.element.getAttribute('data-content') || this.config.content;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n }; // Static\n\n\n Popover._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data && /destroy|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Popover(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Popover, null, [{\n key: \"VERSION\",\n // Getters\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Popover;\n }(Tooltip);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME] = Popover._jQueryInterface;\n $.fn[NAME].Constructor = Popover;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Popover._jQueryInterface;\n };\n\n return Popover;\n}($);\n//# sourceMappingURL=popover.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/popover.js\n// module id = 16\n// module chunks = 0","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Tooltip = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tooltip';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.tooltip';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DefaultType = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)'\n };\n var AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<div class=\"tooltip-inner\"></div></div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent'\n };\n var HoverState = {\n SHOW: 'show',\n OUT: 'out'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n };\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TOOLTIP: '.tooltip',\n TOOLTIP_INNER: '.tooltip-inner',\n ARROW: '.arrow'\n };\n var Trigger = {\n HOVER: 'hover',\n FOCUS: 'focus',\n CLICK: 'click',\n MANUAL: 'manual'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tooltip =\n /*#__PURE__*/\n function () {\n function Tooltip(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $.removeData(this.element, this.constructor.DATA_KEY);\n $(this.element).off(this.constructor.EVENT_KEY);\n $(this.element).closest('.modal').off('hide.bs.modal');\n\n if (this.tip) {\n $(this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $.Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent);\n var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n var container = this.config.container === false ? document.body : $(this.config.container);\n $(tip).data(this.constructor.DATA_KEY, this);\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container);\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: {\n offset: this.config.offset\n },\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n _this._handlePopperPlacementChange(data);\n }\n });\n $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $(_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HoverState.OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $.Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $(this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n this._activeTrigger[Trigger.CLICK] = false;\n this._activeTrigger[Trigger.FOCUS] = false;\n this._activeTrigger[Trigger.HOVER] = false;\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Protected\n\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement());\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());\n $tip.removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n var html = this.config.html;\n\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($(content).text());\n }\n } else {\n $element[html ? 'html' : 'text'](content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n }; // Private\n\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this3 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {\n return _this3.toggle(event);\n });\n } else if (trigger !== Trigger.MANUAL) {\n var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;\n var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;\n $(_this3.element).on(eventIn, _this3.config.selector, function (event) {\n return _this3._enter(event);\n }).on(eventOut, _this3.config.selector, function (event) {\n return _this3._leave(event);\n });\n }\n\n $(_this3.element).closest('.modal').on('hide.bs.modal', function () {\n return _this3.hide();\n });\n });\n\n if (this.config.selector) {\n this.config = _objectSpread({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute('data-original-title');\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(data.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $(tip).removeClass(ClassName.FADE);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n }; // Static\n\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME] = Tooltip._jQueryInterface;\n $.fn[NAME].Constructor = Tooltip;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tooltip._jQueryInterface;\n };\n\n return Tooltip;\n}($, Popper);\n//# sourceMappingURL=tooltip.js.map\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = Tooltip;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/exports-loader?Tooltip!./node_modules/bootstrap/js/dist/tooltip.js\n// module id = 17\n// module chunks = 0","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar ScrollSpy = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'scrollspy';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.scrollspy';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Default = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n var DefaultType = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n var Event = {\n ACTIVATE: \"activate\" + EVENT_KEY,\n SCROLL: \"scroll\" + EVENT_KEY,\n LOAD_DATA_API: \"load\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DROPDOWN_ITEM: 'dropdown-item',\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active'\n };\n var Selector = {\n DATA_SPY: '[data-spy=\"scroll\"]',\n ACTIVE: '.active',\n NAV_LIST_GROUP: '.nav, .list-group',\n NAV_LINKS: '.nav-link',\n NAV_ITEMS: '.nav-item',\n LIST_ITEMS: '.list-group-item',\n DROPDOWN: '.dropdown',\n DROPDOWN_ITEMS: '.dropdown-item',\n DROPDOWN_TOGGLE: '.dropdown-toggle'\n };\n var OffsetMethod = {\n OFFSET: 'offset',\n POSITION: 'position'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var ScrollSpy =\n /*#__PURE__*/\n function () {\n function ScrollSpy(element, config) {\n var _this = this;\n\n this._element = element;\n this._scrollElement = element.tagName === 'BODY' ? window : element;\n this._config = this._getConfig(config);\n this._selector = this._config.target + \" \" + Selector.NAV_LINKS + \",\" + (this._config.target + \" \" + Selector.LIST_ITEMS + \",\") + (this._config.target + \" \" + Selector.DROPDOWN_ITEMS);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n $(this._scrollElement).on(Event.SCROLL, function (event) {\n return _this._process(event);\n });\n this.refresh();\n\n this._process();\n } // Getters\n\n\n var _proto = ScrollSpy.prototype;\n\n // Public\n _proto.refresh = function refresh() {\n var _this2 = this;\n\n var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;\n var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n var targets = $.makeArray($(this._selector));\n targets.map(function (element) {\n var target;\n var targetSelector = Util.getSelectorFromElement(element);\n\n if (targetSelector) {\n target = $(targetSelector)[0];\n }\n\n if (target) {\n var targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [$(target)[offsetMethod]().top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(function (item) {\n return item;\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).forEach(function (item) {\n _this2._offsets.push(item[0]);\n\n _this2._targets.push(item[1]);\n });\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n $(this._scrollElement).off(EVENT_KEY);\n this._element = null;\n this._scrollElement = null;\n this._config = null;\n this._selector = null;\n this._offsets = null;\n this._targets = null;\n this._activeTarget = null;\n this._scrollHeight = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});\n\n if (typeof config.target !== 'string') {\n var id = $(config.target).attr('id');\n\n if (!id) {\n id = Util.getUID(NAME);\n $(config.target).attr('id', id);\n }\n\n config.target = \"#\" + id;\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._getScrollTop = function _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n };\n\n _proto._getScrollHeight = function _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n };\n\n _proto._getOffsetHeight = function _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n };\n\n _proto._process = function _process() {\n var scrollTop = this._getScrollTop() + this._config.offset;\n\n var scrollHeight = this._getScrollHeight();\n\n var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n for (var i = this._offsets.length; i--;) {\n var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n };\n\n _proto._activate = function _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style\n\n\n queries = queries.map(function (selector) {\n return selector + \"[data-target=\\\"\" + target + \"\\\"],\" + (selector + \"[href=\\\"\" + target + \"\\\"]\");\n });\n var $link = $(queries.join(','));\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);\n $link.addClass(ClassName.ACTIVE);\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + \", \" + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item\n\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n });\n };\n\n _proto._clear = function _clear() {\n $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);\n }; // Static\n\n\n ScrollSpy._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data) {\n data = new ScrollSpy(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(ScrollSpy, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return ScrollSpy;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(window).on(Event.LOAD_DATA_API, function () {\n var scrollSpys = $.makeArray($(Selector.DATA_SPY));\n\n for (var i = scrollSpys.length; i--;) {\n var $spy = $(scrollSpys[i]);\n\n ScrollSpy._jQueryInterface.call($spy, $spy.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = ScrollSpy._jQueryInterface;\n $.fn[NAME].Constructor = ScrollSpy;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return ScrollSpy._jQueryInterface;\n };\n\n return ScrollSpy;\n}($);\n//# sourceMappingURL=scrollspy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/scrollspy.js\n// module id = 18\n// module chunks = 0","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.1): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\nvar Tab = function ($) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tab';\n var VERSION = '4.1.1';\n var DATA_KEY = 'bs.tab';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active',\n DISABLED: 'disabled',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n DROPDOWN: '.dropdown',\n NAV_LIST_GROUP: '.nav, .list-group',\n ACTIVE: '.active',\n ACTIVE_UL: '> li > .active',\n DATA_TOGGLE: '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE: '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tab =\n /*#__PURE__*/\n function () {\n function Tab(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Tab.prototype;\n\n // Public\n _proto.show = function show() {\n var _this = this;\n\n if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var target;\n var previous;\n var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0];\n var selector = Util.getSelectorFromElement(this._element);\n\n if (listElement) {\n var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;\n previous = $.makeArray($(listElement).find(itemSelector));\n previous = previous[previous.length - 1];\n }\n\n var hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n });\n var showEvent = $.Event(Event.SHOW, {\n relatedTarget: previous\n });\n\n if (previous) {\n $(previous).trigger(hideEvent);\n }\n\n $(this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (selector) {\n target = $(selector)[0];\n }\n\n this._activate(this._element, listElement);\n\n var complete = function complete() {\n var hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: _this._element\n });\n var shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n });\n $(previous).trigger(hiddenEvent);\n $(_this._element).trigger(shownEvent);\n };\n\n if (target) {\n this._activate(target, target.parentNode, complete);\n } else {\n complete();\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Private\n\n\n _proto._activate = function _activate(element, container, callback) {\n var _this2 = this;\n\n var activeElements;\n\n if (container.nodeName === 'UL') {\n activeElements = $(container).find(Selector.ACTIVE_UL);\n } else {\n activeElements = $(container).children(Selector.ACTIVE);\n }\n\n var active = activeElements[0];\n var isTransitioning = callback && active && $(active).hasClass(ClassName.FADE);\n\n var complete = function complete() {\n return _this2._transitionComplete(element, active, callback);\n };\n\n if (active && isTransitioning) {\n var transitionDuration = Util.getTransitionDurationFromElement(active);\n $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto._transitionComplete = function _transitionComplete(element, active, callback) {\n if (active) {\n $(active).removeClass(ClassName.SHOW + \" \" + ClassName.ACTIVE);\n var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName.ACTIVE);\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false);\n }\n }\n\n $(element).addClass(ClassName.ACTIVE);\n\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true);\n }\n\n Util.reflow(element);\n $(element).addClass(ClassName.SHOW);\n\n if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];\n\n if (dropdownElement) {\n $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);\n }\n\n element.setAttribute('aria-expanded', true);\n }\n\n if (callback) {\n callback();\n }\n }; // Static\n\n\n Tab._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(DATA_KEY);\n\n if (!data) {\n data = new Tab(this);\n $this.data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tab, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Tab;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault();\n\n Tab._jQueryInterface.call($(this), 'show');\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tab._jQueryInterface;\n $.fn[NAME].Constructor = Tab;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tab._jQueryInterface;\n };\n\n return Tab;\n}($);\n//# sourceMappingURL=tab.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap/js/dist/tab.js\n// module id = 19\n// module chunks = 0","(function() {\n var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n (function($, window) {\n var Offcanvas, OffcanvasDropdown, OffcanvasTouch;\n OffcanvasDropdown = (function() {\n function OffcanvasDropdown(element) {\n this.element = element;\n this._clickEvent = __bind(this._clickEvent, this);\n this.element = $(this.element);\n this.nav = this.element.closest(\".nav\");\n this.dropdown = this.element.parent().find(\".dropdown-menu\");\n this.element.on('click', this._clickEvent);\n this.nav.closest('.navbar-offcanvas').on('click', (function(_this) {\n return function() {\n if (_this.dropdown.is('.shown')) {\n return _this.dropdown.removeClass('shown').closest('.open').removeClass('open');\n }\n };\n })(this));\n }\n\n OffcanvasDropdown.prototype._clickEvent = function(e) {\n if (!this.dropdown.hasClass('shown')) {\n e.preventDefault();\n }\n e.stopPropagation();\n $('.dropdown-toggle').not(this.element).closest('.open').removeClass('open').find('.dropdown-menu').removeClass('shown');\n this.dropdown.toggleClass(\"shown\");\n return this.element.parent().toggleClass('open');\n };\n\n return OffcanvasDropdown;\n\n })();\n OffcanvasTouch = (function() {\n function OffcanvasTouch(button, element, location, offcanvas) {\n this.button = button;\n this.element = element;\n this.location = location;\n this.offcanvas = offcanvas;\n this._getFade = __bind(this._getFade, this);\n this._getCss = __bind(this._getCss, this);\n this._touchEnd = __bind(this._touchEnd, this);\n this._touchMove = __bind(this._touchMove, this);\n this._touchStart = __bind(this._touchStart, this);\n this.endThreshold = 130;\n this.startThreshold = this.element.hasClass('navbar-offcanvas-right') ? $(\"body\").outerWidth() - 60 : 20;\n this.maxStartThreshold = this.element.hasClass('navbar-offcanvas-right') ? $(\"body\").outerWidth() - 20 : 60;\n this.currentX = 0;\n this.fade = this.element.hasClass('navbar-offcanvas-fade') ? true : false;\n $(document).on(\"touchstart\", this._touchStart);\n $(document).on(\"touchmove\", this._touchMove);\n $(document).on(\"touchend\", this._touchEnd);\n }\n\n OffcanvasTouch.prototype._touchStart = function(e) {\n this.startX = e.originalEvent.touches[0].pageX;\n if (this.element.is('.in')) {\n return this.element.height($(window).outerHeight());\n }\n };\n\n OffcanvasTouch.prototype._touchMove = function(e) {\n var x;\n if ($(e.target).parents('.navbar-offcanvas').length > 0) {\n return true;\n }\n if (this.startX > this.startThreshold && this.startX < this.maxStartThreshold) {\n e.preventDefault();\n x = e.originalEvent.touches[0].pageX - this.startX;\n x = this.element.hasClass('navbar-offcanvas-right') ? -x : x;\n if (Math.abs(x) < this.element.outerWidth()) {\n this.element.css(this._getCss(x));\n return this.element.css(this._getFade(x));\n }\n } else if (this.element.hasClass('in')) {\n e.preventDefault();\n x = e.originalEvent.touches[0].pageX + (this.currentX - this.startX);\n x = this.element.hasClass('navbar-offcanvas-right') ? -x : x;\n if (Math.abs(x) < this.element.outerWidth()) {\n this.element.css(this._getCss(x));\n return this.element.css(this._getFade(x));\n }\n }\n };\n\n OffcanvasTouch.prototype._touchEnd = function(e) {\n var end, sendEvents, x;\n if ($(e.target).parents('.navbar-offcanvas').length > 0) {\n return true;\n }\n sendEvents = false;\n x = e.originalEvent.changedTouches[0].pageX;\n if (Math.abs(x) === this.startX) {\n return;\n }\n end = this.element.hasClass('navbar-offcanvas-right') ? Math.abs(x) > (this.endThreshold + 50) : x < (this.endThreshold + 50);\n if (this.element.hasClass('in') && end) {\n this.currentX = 0;\n this.element.removeClass('in').css(this._clearCss());\n this.button.removeClass('is-open');\n sendEvents = true;\n } else if (Math.abs(x - this.startX) > this.endThreshold && this.startX > this.startThreshold && this.startX < this.maxStartThreshold) {\n this.currentX = this.element.hasClass('navbar-offcanvas-right') ? -this.element.outerWidth() : this.element.outerWidth();\n this.element.toggleClass('in').css(this._clearCss());\n this.button.toggleClass('is-open');\n sendEvents = true;\n } else {\n this.element.css(this._clearCss());\n }\n return this.offcanvas.bodyOverflow(sendEvents);\n };\n\n OffcanvasTouch.prototype._getCss = function(x) {\n x = this.element.hasClass('navbar-offcanvas-right') ? -x : x;\n return {\n \"-webkit-transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"-webkit-transition-duration\": \"0s\",\n \"-moz-transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"-moz-transition\": \"0s\",\n \"-o-transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"-o-transition\": \"0s\",\n \"transform\": \"translate3d(\" + x + \"px, 0px, 0px)\",\n \"transition\": \"0s\"\n };\n };\n\n OffcanvasTouch.prototype._getFade = function(x) {\n if (this.fade) {\n return {\n \"opacity\": x / this.element.outerWidth()\n };\n } else {\n return {};\n }\n };\n\n OffcanvasTouch.prototype._clearCss = function() {\n return {\n \"-webkit-transform\": \"\",\n \"-webkit-transition-duration\": \"\",\n \"-moz-transform\": \"\",\n \"-moz-transition\": \"\",\n \"-o-transform\": \"\",\n \"-o-transition\": \"\",\n \"transform\": \"\",\n \"transition\": \"\",\n \"opacity\": \"\"\n };\n };\n\n return OffcanvasTouch;\n\n })();\n window.Offcanvas = Offcanvas = (function() {\n function Offcanvas(element) {\n var t, target;\n this.element = element;\n this.bodyOverflow = __bind(this.bodyOverflow, this);\n this._sendEventsAfter = __bind(this._sendEventsAfter, this);\n this._sendEventsBefore = __bind(this._sendEventsBefore, this);\n this._documentClicked = __bind(this._documentClicked, this);\n this._close = __bind(this._close, this);\n this._open = __bind(this._open, this);\n this._clicked = __bind(this._clicked, this);\n this._navbarHeight = __bind(this._navbarHeight, this);\n target = this.element.attr('data-target') ? this.element.attr('data-target') : false;\n if (target) {\n this.target = $(target);\n if (this.target.length && !this.target.hasClass('js-offcanvas-done')) {\n this.element.addClass('js-offcanvas-has-events');\n this.location = this.target.hasClass(\"navbar-offcanvas-right\") ? \"right\" : \"left\";\n this.target.addClass(this._transformSupported() ? \"offcanvas-transform js-offcanvas-done\" : \"offcanvas-position js-offcanvas-done\");\n this.target.data('offcanvas', this);\n this.element.on(\"click\", this._clicked);\n this.target.on('transitionend', (function(_this) {\n return function() {\n if (_this.target.is(':not(.in)')) {\n return _this.target.height('');\n }\n };\n })(this));\n $(document).on(\"click\", this._documentClicked);\n if (this.target.hasClass('navbar-offcanvas-touch')) {\n t = new OffcanvasTouch(this.element, this.target, this.location, this);\n }\n this.target.find(\".dropdown-toggle\").each(function() {\n var d;\n return d = new OffcanvasDropdown(this);\n });\n this.target.on('offcanvas.toggle', (function(_this) {\n return function(e) {\n return _this._clicked(e);\n };\n })(this));\n this.target.on('offcanvas.close', (function(_this) {\n return function(e) {\n return _this._close(e);\n };\n })(this));\n this.target.on('offcanvas.open', (function(_this) {\n return function(e) {\n return _this._open(e);\n };\n })(this));\n }\n } else {\n console.warn('Offcanvas: `data-target` attribute must be present.');\n }\n }\n\n Offcanvas.prototype._navbarHeight = function() {\n if (this.target.is('.in')) {\n return this.target.height($(window).outerHeight());\n }\n };\n\n Offcanvas.prototype._clicked = function(e) {\n e.preventDefault();\n this._sendEventsBefore();\n $(\".navbar-offcanvas\").not(this.target).trigger('offcanvas.close');\n this.target.toggleClass('in');\n this.element.toggleClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n };\n\n Offcanvas.prototype._open = function(e) {\n e.preventDefault();\n if (this.target.is('.in')) {\n return;\n }\n this._sendEventsBefore();\n this.target.addClass('in');\n this.element.addClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n };\n\n Offcanvas.prototype._close = function(e) {\n e.preventDefault();\n if (this.target.is(':not(.in)')) {\n return;\n }\n this._sendEventsBefore();\n this.target.removeClass('in');\n this.element.removeClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n };\n\n Offcanvas.prototype._documentClicked = function(e) {\n var clickedEl;\n clickedEl = $(e.target);\n if (!clickedEl.hasClass('offcanvas-toggle') && clickedEl.parents('.offcanvas-toggle').length === 0 && clickedEl.parents('.navbar-offcanvas').length === 0 && !clickedEl.hasClass('navbar-offcanvas')) {\n if (this.target.hasClass('in')) {\n e.preventDefault();\n this._sendEventsBefore();\n this.target.removeClass('in');\n this.element.removeClass('is-open');\n this._navbarHeight();\n return this.bodyOverflow();\n }\n }\n };\n\n Offcanvas.prototype._sendEventsBefore = function() {\n if (this.target.hasClass('in')) {\n return this.target.trigger('hide.bs.offcanvas');\n } else {\n return this.target.trigger('show.bs.offcanvas');\n }\n };\n\n Offcanvas.prototype._sendEventsAfter = function() {\n if (this.target.hasClass('in')) {\n return this.target.trigger('shown.bs.offcanvas');\n } else {\n return this.target.trigger('hidden.bs.offcanvas');\n }\n };\n\n Offcanvas.prototype.bodyOverflow = function(events) {\n if (events == null) {\n events = true;\n }\n if (this.target.is('.in')) {\n $('body').addClass('offcanvas-stop-scrolling');\n } else {\n $('body').removeClass('offcanvas-stop-scrolling');\n }\n if (events) {\n return this._sendEventsAfter();\n }\n };\n\n Offcanvas.prototype._transformSupported = function() {\n var asSupport, el, regex, translate3D;\n el = document.createElement('div');\n translate3D = \"translate3d(0px, 0px, 0px)\";\n regex = /translate3d\\(0px, 0px, 0px\\)/g;\n el.style.cssText = \"-webkit-transform: \" + translate3D + \"; -moz-transform: \" + translate3D + \"; -o-transform: \" + translate3D + \"; transform: \" + translate3D;\n asSupport = el.style.cssText.match(regex);\n return asSupport.length != null;\n };\n\n return Offcanvas;\n\n })();\n $.fn.bsOffcanvas = function() {\n return this.each(function() {\n return new Offcanvas($(this));\n });\n };\n return $(function() {\n $('[data-toggle=\"offcanvas\"]').each(function() {\n return $(this).bsOffcanvas();\n });\n $(window).on('resize', function() {\n $('.navbar-offcanvas.in').each(function() {\n return $(this).height('').removeClass('in');\n });\n $('.offcanvas-toggle').removeClass('is-open');\n return $('body').removeClass('offcanvas-stop-scrolling');\n });\n return $('.offcanvas-toggle').each(function() {\n return $(this).on('click', function(e) {\n var el, selector;\n if (!$(this).hasClass('js-offcanvas-has-events')) {\n selector = $(this).attr('data-target');\n el = $(selector);\n if (el) {\n el.height('');\n el.removeClass('in');\n return $('body').css({\n overflow: '',\n position: ''\n });\n }\n }\n });\n });\n });\n })(window.jQuery, window);\n\n}).call(this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/offcanvas-bootstrap/dist/js/bootstrap.offcanvas.js\n// module id = 20\n// module chunks = 0","(function(factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define(['jquery', 'hammerjs'], factory);\r\n } else if (typeof exports === 'object') {\r\n factory(require('jquery'), require('hammerjs'));\r\n } else {\r\n factory(jQuery, Hammer);\r\n }\r\n}(function($, Hammer) {\r\n function hammerify(el, options) {\r\n var $el = $(el);\r\n if(!$el.data(\"hammer\")) {\r\n $el.data(\"hammer\", new Hammer($el[0], options));\r\n }\r\n }\r\n\r\n $.fn.hammer = function(options) {\r\n return this.each(function() {\r\n hammerify(this, options);\r\n });\r\n };\r\n\r\n // extend the emit method to also trigger jQuery events\r\n Hammer.Manager.prototype.emit = (function(originalEmit) {\r\n return function(type, data) {\r\n originalEmit.call(this, type, data);\r\n $(this.element).trigger({\r\n type: type,\r\n gesture: data\r\n });\r\n };\r\n })(Hammer.Manager.prototype.emit);\r\n}));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/jquery-hammerjs/jquery.hammer.js\n// module id = 21\n// module chunks = 0","// PouchDB 6.4.3\n// \n// (c) 2012-2018 Dale Harvey and the PouchDB team\n// PouchDB may be freely distributed under the Apache license, version 2.0.\n// For all details and documentation:\n// http://pouchdb.com\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.PouchDB = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n'use strict';\n\nmodule.exports = argsArray;\n\nfunction argsArray(fun) {\n return function () {\n var len = arguments.length;\n if (len) {\n var args = [];\n var i = -1;\n while (++i < len) {\n args[i] = arguments[i];\n }\n return fun.call(this, args);\n } else {\n return fun.call(this, []);\n }\n };\n}\n},{}],2:[function(_dereq_,module,exports){\n(function (process){\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = _dereq_(3);\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',\n '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',\n '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',\n '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',\n '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',\n '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',\n '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',\n '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',\n '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',\n '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',\n '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // Internet Explorer and Edge do not support colors.\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n}).call(this,_dereq_(9))\n},{\"3\":3,\"9\":9}],3:[function(_dereq_,module,exports){\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = _dereq_(8);\n\n/**\n * Active `debug` instances.\n */\nexports.instances = [];\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n var prevTime;\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n exports.instances.push(debug);\n\n return debug;\n}\n\nfunction destroy () {\n var index = exports.instances.indexOf(this);\n if (index !== -1) {\n exports.instances.splice(index, 1);\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < exports.instances.length; i++) {\n var instance = exports.instances[i];\n instance.enabled = exports.enabled(instance.namespace);\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n},{\"8\":8}],4:[function(_dereq_,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n},{}],5:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],6:[function(_dereq_,module,exports){\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n},{}],7:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(5);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"5\":5}],8:[function(_dereq_,module,exports){\n/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n},{}],9:[function(_dereq_,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],10:[function(_dereq_,module,exports){\n(function (factory) {\n if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD\n define(factory);\n } else {\n // Browser globals (with support for web workers)\n var glob;\n\n try {\n glob = window;\n } catch (e) {\n glob = self;\n }\n\n glob.SparkMD5 = factory();\n }\n}(function (undefined) {\n\n 'use strict';\n\n /*\n * Fastest md5 implementation around (JKM md5).\n * Credits: Joseph Myers\n *\n * @see http://www.myersdaily.org/joseph/javascript/md5-text.html\n * @see http://jsperf.com/md5-shootout/7\n */\n\n /* this function is much faster,\n so if possible we use it. Some IEs\n are the only ones I know of that\n need the idiotic second function,\n generated by an if clause. */\n var add32 = function (a, b) {\n return (a + b) & 0xFFFFFFFF;\n },\n hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\n\n\n function cmn(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n return add32((a << s) | (a >>> (32 - s)), b);\n }\n\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n\n function md5blk(s) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n\n function md5blk_array(a) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n }\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n return state;\n }\n\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n\n // Not sure if it is a bug, however IE10 will always produce a sub array of length 1\n // containing the last element of the parent array if the sub array specified starts\n // beyond the length of the parent array - weird.\n // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue\n a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);\n\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << ((i % 4) << 3);\n }\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n\n return state;\n }\n\n function rhex(n) {\n var s = '',\n j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];\n }\n return s;\n }\n\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join('');\n }\n\n // In some cases the fast add32 function cannot be used..\n if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {\n add32 = function (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n };\n }\n\n // ---------------------------------------------------\n\n /**\n * ArrayBuffer slice polyfill.\n *\n * @see https://github.com/ttaubert/node-arraybuffer-slice\n */\n\n if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = (val | 0) || 0;\n\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n\n return Math.min(val, length);\n }\n\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n\n if (to !== undefined) {\n end = clamp(to, length);\n }\n\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n\n return target;\n };\n })();\n }\n\n // ---------------------------------------------------\n\n /**\n * Helpers.\n */\n\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n\n return str;\n }\n\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n\n return returnUInt8Array ? arr : buff;\n }\n\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n\n return returnUInt8Array ? result : result.buffer;\n }\n\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n\n return String.fromCharCode.apply(String, bytes);\n }\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation.\n *\n * Use this class to perform an incremental md5, otherwise use the\n * static methods instead.\n */\n\n function SparkMD5() {\n // call reset to init the instance\n this.reset();\n }\n\n /**\n * Appends a string.\n * A conversion will be applied if an utf8 string is detected.\n *\n * @param {String} str The string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.append = function (str) {\n // Converts the string to utf8 bytes if necessary\n // Then append as binary\n this.appendBinary(toUtf8(str));\n\n return this;\n };\n\n /**\n * Appends a binary string.\n *\n * @param {String} contents The binary string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n\n var length = this._buff.length,\n i;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n\n this._buff = this._buff.substring(i - 64);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.reset = function () {\n this._buff = '';\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash\n };\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n\n return this;\n };\n\n /**\n * Releases memory used by the incremental buffer and other additional\n * resources. If you plan to use the instance again, use reset instead.\n */\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n\n /**\n * Finish the final calculation based on the tail.\n *\n * @param {Array} tail The tail (will be modified)\n * @param {Number} length The length of the remaining buffer\n */\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Do the final computation based on the tail and length\n // Beware that the final length may not fit in 32 bits so we take care of that\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n\n /**\n * Performs the md5 hash on a string.\n * A conversion will be applied if utf8 string is detected.\n *\n * @param {String} str The string\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hash = function (str, raw) {\n // Converts the string to utf8 bytes if necessary\n // Then compute it using the binary function\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n\n /**\n * Performs the md5 hash on a binary string.\n *\n * @param {String} content The binary string\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation for array buffers.\n *\n * Use this class to perform an incremental md5 ONLY for array buffers.\n */\n SparkMD5.ArrayBuffer = function () {\n // call reset to init the instance\n this.reset();\n };\n\n /**\n * Appends an array buffer.\n *\n * @param {ArrayBuffer} arr The array to be appended\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n\n this._length += arr.byteLength;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n\n this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n\n // Convert buffer to a string\n state.buff = arrayBuffer2Utf8Str(state.buff);\n\n return state;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n // Convert string to buffer\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n\n return SparkMD5.prototype.setState.call(this, state);\n };\n\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n\n /**\n * Performs the md5 hash on an array buffer.\n *\n * @param {ArrayBuffer} arr The array buffer\n * @param {Boolean} raw True to get the raw string, false to get the hex one\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n return SparkMD5;\n}));\n\n},{}],11:[function(_dereq_,module,exports){\nvar v1 = _dereq_(14);\nvar v4 = _dereq_(15);\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n\n},{\"14\":14,\"15\":15}],12:[function(_dereq_,module,exports){\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n\n},{}],13:[function(_dereq_,module,exports){\n// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n\n},{}],14:[function(_dereq_,module,exports){\nvar rng = _dereq_(13);\nvar bytesToUuid = _dereq_(12);\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n\n},{\"12\":12,\"13\":13}],15:[function(_dereq_,module,exports){\nvar rng = _dereq_(13);\nvar bytesToUuid = _dereq_(12);\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n\n},{\"12\":12,\"13\":13}],16:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Stringify/parse functions that don't operate\n * recursively, so they avoid call stack exceeded\n * errors.\n */\nexports.stringify = function stringify(input) {\n var queue = [];\n queue.push({obj: input});\n\n var res = '';\n var next, obj, prefix, val, i, arrayPrefix, keys, k, key, value, objPrefix;\n while ((next = queue.pop())) {\n obj = next.obj;\n prefix = next.prefix || '';\n val = next.val || '';\n res += prefix;\n if (val) {\n res += val;\n } else if (typeof obj !== 'object') {\n res += typeof obj === 'undefined' ? null : JSON.stringify(obj);\n } else if (obj === null) {\n res += 'null';\n } else if (Array.isArray(obj)) {\n queue.push({val: ']'});\n for (i = obj.length - 1; i >= 0; i--) {\n arrayPrefix = i === 0 ? '' : ',';\n queue.push({obj: obj[i], prefix: arrayPrefix});\n }\n queue.push({val: '['});\n } else { // object\n keys = [];\n for (k in obj) {\n if (obj.hasOwnProperty(k)) {\n keys.push(k);\n }\n }\n queue.push({val: '}'});\n for (i = keys.length - 1; i >= 0; i--) {\n key = keys[i];\n value = obj[key];\n objPrefix = (i > 0 ? ',' : '');\n objPrefix += JSON.stringify(key) + ':';\n queue.push({obj: value, prefix: objPrefix});\n }\n queue.push({val: '{'});\n }\n }\n return res;\n};\n\n// Convenience function for the parse function.\n// This pop function is basically copied from\n// pouchCollate.parseIndexableString\nfunction pop(obj, stack, metaStack) {\n var lastMetaElement = metaStack[metaStack.length - 1];\n if (obj === lastMetaElement.element) {\n // popping a meta-element, e.g. an object whose value is another object\n metaStack.pop();\n lastMetaElement = metaStack[metaStack.length - 1];\n }\n var element = lastMetaElement.element;\n var lastElementIndex = lastMetaElement.index;\n if (Array.isArray(element)) {\n element.push(obj);\n } else if (lastElementIndex === stack.length - 2) { // obj with key+value\n var key = stack.pop();\n element[key] = obj;\n } else {\n stack.push(obj); // obj with key only\n }\n}\n\nexports.parse = function (str) {\n var stack = [];\n var metaStack = []; // stack for arrays and objects\n var i = 0;\n var collationIndex,parsedNum,numChar;\n var parsedString,lastCh,numConsecutiveSlashes,ch;\n var arrayElement, objElement;\n while (true) {\n collationIndex = str[i++];\n if (collationIndex === '}' ||\n collationIndex === ']' ||\n typeof collationIndex === 'undefined') {\n if (stack.length === 1) {\n return stack.pop();\n } else {\n pop(stack.pop(), stack, metaStack);\n continue;\n }\n }\n switch (collationIndex) {\n case ' ':\n case '\\t':\n case '\\n':\n case ':':\n case ',':\n break;\n case 'n':\n i += 3; // 'ull'\n pop(null, stack, metaStack);\n break;\n case 't':\n i += 3; // 'rue'\n pop(true, stack, metaStack);\n break;\n case 'f':\n i += 4; // 'alse'\n pop(false, stack, metaStack);\n break;\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n case '-':\n parsedNum = '';\n i--;\n while (true) {\n numChar = str[i++];\n if (/[\\d\\.\\-e\\+]/.test(numChar)) {\n parsedNum += numChar;\n } else {\n i--;\n break;\n }\n }\n pop(parseFloat(parsedNum), stack, metaStack);\n break;\n case '\"':\n parsedString = '';\n lastCh = void 0;\n numConsecutiveSlashes = 0;\n while (true) {\n ch = str[i++];\n if (ch !== '\"' || (lastCh === '\\\\' &&\n numConsecutiveSlashes % 2 === 1)) {\n parsedString += ch;\n lastCh = ch;\n if (lastCh === '\\\\') {\n numConsecutiveSlashes++;\n } else {\n numConsecutiveSlashes = 0;\n }\n } else {\n break;\n }\n }\n pop(JSON.parse('\"' + parsedString + '\"'), stack, metaStack);\n break;\n case '[':\n arrayElement = { element: [], index: stack.length };\n stack.push(arrayElement.element);\n metaStack.push(arrayElement);\n break;\n case '{':\n objElement = { element: {}, index: stack.length };\n stack.push(objElement.element);\n metaStack.push(objElement);\n break;\n default:\n throw new Error(\n 'unexpectedly reached end of input: ' + collationIndex);\n }\n }\n};\n\n},{}],17:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar lie = _interopDefault(_dereq_(7));\nvar getArguments = _interopDefault(_dereq_(1));\nvar nextTick = _interopDefault(_dereq_(5));\nvar events = _dereq_(4);\nvar inherits = _interopDefault(_dereq_(6));\nvar uuidV4 = _interopDefault(_dereq_(11));\nvar debug = _interopDefault(_dereq_(2));\nvar Md5 = _interopDefault(_dereq_(10));\nvar vuvuzela = _interopDefault(_dereq_(16));\n\n/* istanbul ignore next */\nvar PouchPromise = typeof Promise === 'function' ? Promise : lie;\n\nfunction isBinaryObject(object) {\n return (typeof ArrayBuffer !== 'undefined' && object instanceof ArrayBuffer) ||\n (typeof Blob !== 'undefined' && object instanceof Blob);\n}\n\nfunction cloneArrayBuffer(buff) {\n if (typeof buff.slice === 'function') {\n return buff.slice(0);\n }\n // IE10-11 slice() polyfill\n var target = new ArrayBuffer(buff.byteLength);\n var targetArray = new Uint8Array(target);\n var sourceArray = new Uint8Array(buff);\n targetArray.set(sourceArray);\n return target;\n}\n\nfunction cloneBinaryObject(object) {\n if (object instanceof ArrayBuffer) {\n return cloneArrayBuffer(object);\n }\n var size = object.size;\n var type = object.type;\n // Blob\n if (typeof object.slice === 'function') {\n return object.slice(0, size, type);\n }\n // PhantomJS slice() replacement\n return object.webkitSlice(0, size, type);\n}\n\n// most of this is borrowed from lodash.isPlainObject:\n// https://github.com/fis-components/lodash.isplainobject/\n// blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js\n\nvar funcToString = Function.prototype.toString;\nvar objectCtorString = funcToString.call(Object);\n\nfunction isPlainObject(value) {\n var proto = Object.getPrototypeOf(value);\n /* istanbul ignore if */\n if (proto === null) { // not sure when this happens, but I guess it can\n return true;\n }\n var Ctor = proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\nfunction clone(object) {\n var newObject;\n var i;\n var len;\n\n if (!object || typeof object !== 'object') {\n return object;\n }\n\n if (Array.isArray(object)) {\n newObject = [];\n for (i = 0, len = object.length; i < len; i++) {\n newObject[i] = clone(object[i]);\n }\n return newObject;\n }\n\n // special case: to avoid inconsistencies between IndexedDB\n // and other backends, we automatically stringify Dates\n if (object instanceof Date) {\n return object.toISOString();\n }\n\n if (isBinaryObject(object)) {\n return cloneBinaryObject(object);\n }\n\n if (!isPlainObject(object)) {\n return object; // don't clone objects like Workers\n }\n\n newObject = {};\n for (i in object) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(object, i)) {\n var value = clone(object[i]);\n if (typeof value !== 'undefined') {\n newObject[i] = value;\n }\n }\n }\n return newObject;\n}\n\nfunction once(fun) {\n var called = false;\n return getArguments(function (args) {\n /* istanbul ignore if */\n if (called) {\n // this is a smoke test and should never actually happen\n throw new Error('once called more than once');\n } else {\n called = true;\n fun.apply(this, args);\n }\n });\n}\n\nfunction toPromise(func) {\n //create the function we will be returning\n return getArguments(function (args) {\n // Clone arguments\n args = clone(args);\n var self = this;\n // if the last argument is a function, assume its a callback\n var usedCB = (typeof args[args.length - 1] === 'function') ? args.pop() : false;\n var promise = new PouchPromise(function (fulfill, reject) {\n var resp;\n try {\n var callback = once(function (err, mesg) {\n if (err) {\n reject(err);\n } else {\n fulfill(mesg);\n }\n });\n // create a callback for this invocation\n // apply the function in the orig context\n args.push(callback);\n resp = func.apply(self, args);\n if (resp && typeof resp.then === 'function') {\n fulfill(resp);\n }\n } catch (e) {\n reject(e);\n }\n });\n // if there is a callback, call it back\n if (usedCB) {\n promise.then(function (result) {\n usedCB(null, result);\n }, usedCB);\n }\n return promise;\n });\n}\n\nfunction logApiCall(self, name, args) {\n /* istanbul ignore if */\n if (self.constructor.listeners('debug').length) {\n var logArgs = ['api', self.name, name];\n for (var i = 0; i < args.length - 1; i++) {\n logArgs.push(args[i]);\n }\n self.constructor.emit('debug', logArgs);\n\n // override the callback itself to log the response\n var origCallback = args[args.length - 1];\n args[args.length - 1] = function (err, res) {\n var responseArgs = ['api', self.name, name];\n responseArgs = responseArgs.concat(\n err ? ['error', err] : ['success', res]\n );\n self.constructor.emit('debug', responseArgs);\n origCallback(err, res);\n };\n }\n}\n\nfunction adapterFun(name, callback) {\n return toPromise(getArguments(function (args) {\n if (this._closed) {\n return PouchPromise.reject(new Error('database is closed'));\n }\n if (this._destroyed) {\n return PouchPromise.reject(new Error('database is destroyed'));\n }\n var self = this;\n logApiCall(self, name, args);\n if (!this.taskqueue.isReady) {\n return new PouchPromise(function (fulfill, reject) {\n self.taskqueue.addTask(function (failed) {\n if (failed) {\n reject(failed);\n } else {\n fulfill(self[name].apply(self, args));\n }\n });\n });\n }\n return callback.apply(this, args);\n }));\n}\n\nfunction mangle(key) {\n return '$' + key;\n}\nfunction unmangle(key) {\n return key.substring(1);\n}\nfunction Map$1() {\n this._store = {};\n}\nMap$1.prototype.get = function (key) {\n var mangled = mangle(key);\n return this._store[mangled];\n};\nMap$1.prototype.set = function (key, value) {\n var mangled = mangle(key);\n this._store[mangled] = value;\n return true;\n};\nMap$1.prototype.has = function (key) {\n var mangled = mangle(key);\n return mangled in this._store;\n};\nMap$1.prototype[\"delete\"] = function (key) {\n var mangled = mangle(key);\n var res = mangled in this._store;\n delete this._store[mangled];\n return res;\n};\nMap$1.prototype.forEach = function (cb) {\n var keys = Object.keys(this._store);\n for (var i = 0, len = keys.length; i < len; i++) {\n var key = keys[i];\n var value = this._store[key];\n key = unmangle(key);\n cb(value, key);\n }\n};\nObject.defineProperty(Map$1.prototype, 'size', {\n get: function () {\n return Object.keys(this._store).length;\n }\n});\n\nfunction Set$1(array) {\n this._store = new Map$1();\n\n // init with an array\n if (array && Array.isArray(array)) {\n for (var i = 0, len = array.length; i < len; i++) {\n this.add(array[i]);\n }\n }\n}\nSet$1.prototype.add = function (key) {\n return this._store.set(key, true);\n};\nSet$1.prototype.has = function (key) {\n return this._store.has(key);\n};\nSet$1.prototype.forEach = function (cb) {\n this._store.forEach(function (value, key) {\n cb(key);\n });\n};\nObject.defineProperty(Set$1.prototype, 'size', {\n get: function () {\n return this._store.size;\n }\n});\n\n/* global Map,Set,Symbol */\n// Based on https://kangax.github.io/compat-table/es6/ we can sniff out\n// incomplete Map/Set implementations which would otherwise cause our tests to fail.\n// Notably they fail in IE11 and iOS 8.4, which this prevents.\nfunction supportsMapAndSet() {\n if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') {\n return false;\n }\n var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species);\n return prop && 'get' in prop && Map[Symbol.species] === Map;\n}\n\n// based on https://github.com/montagejs/collections\n/* global Map,Set */\n\nvar ExportedSet;\nvar ExportedMap;\n\n{\n if (supportsMapAndSet()) { // prefer built-in Map/Set\n ExportedSet = Set;\n ExportedMap = Map;\n } else { // fall back to our polyfill\n ExportedSet = Set$1;\n ExportedMap = Map$1;\n }\n}\n\n// like underscore/lodash _.pick()\nfunction pick(obj, arr) {\n var res = {};\n for (var i = 0, len = arr.length; i < len; i++) {\n var prop = arr[i];\n if (prop in obj) {\n res[prop] = obj[prop];\n }\n }\n return res;\n}\n\n// Most browsers throttle concurrent requests at 6, so it's silly\n// to shim _bulk_get by trying to launch potentially hundreds of requests\n// and then letting the majority time out. We can handle this ourselves.\nvar MAX_NUM_CONCURRENT_REQUESTS = 6;\n\nfunction identityFunction(x) {\n return x;\n}\n\nfunction formatResultForOpenRevsGet(result) {\n return [{\n ok: result\n }];\n}\n\n// shim for P/CouchDB adapters that don't directly implement _bulk_get\nfunction bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}\n\nfunction isChromeApp() {\n return (typeof chrome !== \"undefined\" &&\n typeof chrome.storage !== \"undefined\" &&\n typeof chrome.storage.local !== \"undefined\");\n}\n\nvar hasLocal;\n\nif (isChromeApp()) {\n hasLocal = false;\n} else {\n try {\n localStorage.setItem('_pouch_check_localstorage', 1);\n hasLocal = !!localStorage.getItem('_pouch_check_localstorage');\n } catch (e) {\n hasLocal = false;\n }\n}\n\nfunction hasLocalStorage() {\n return hasLocal;\n}\n\n// Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We\n// avoid using process.nextTick() directly because the polyfill is very large and we don't\n// need all of it (see: https://github.com/defunctzombie/node-process).\n// \"immediate\" 3.0.8 is used by lie, and it's a smaller version of the latest \"immediate\"\n// package, so it's the one we use.\n// When we use nextTick() in our codebase, we only care about not releasing Zalgo\n// (see: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony).\n// Microtask vs macrotask doesn't matter to us. So we're free to use the fastest\n// (least latency) option, which is \"immediate\" due to use of microtasks.\n// All of our nextTicks are isolated to this one function so we can easily swap out one\n// implementation for another.\n\ninherits(Changes, events.EventEmitter);\n\n/* istanbul ignore next */\nfunction attachBrowserEvents(self) {\n if (isChromeApp()) {\n chrome.storage.onChanged.addListener(function (e) {\n // make sure it's event addressed to us\n if (e.db_name != null) {\n //object only has oldValue, newValue members\n self.emit(e.dbName.newValue);\n }\n });\n } else if (hasLocalStorage()) {\n if (typeof addEventListener !== 'undefined') {\n addEventListener(\"storage\", function (e) {\n self.emit(e.key);\n });\n } else { // old IE\n window.attachEvent(\"storage\", function (e) {\n self.emit(e.key);\n });\n }\n }\n}\n\nfunction Changes() {\n events.EventEmitter.call(this);\n this._listeners = {};\n\n attachBrowserEvents(this);\n}\nChanges.prototype.addListener = function (dbName, id, db, opts) {\n /* istanbul ignore if */\n if (this._listeners[id]) {\n return;\n }\n var self = this;\n var inprogress = false;\n function eventFunction() {\n /* istanbul ignore if */\n if (!self._listeners[id]) {\n return;\n }\n if (inprogress) {\n inprogress = 'waiting';\n return;\n }\n inprogress = true;\n var changesOpts = pick(opts, [\n 'style', 'include_docs', 'attachments', 'conflicts', 'filter',\n 'doc_ids', 'view', 'since', 'query_params', 'binary'\n ]);\n\n /* istanbul ignore next */\n function onError() {\n inprogress = false;\n }\n\n db.changes(changesOpts).on('change', function (c) {\n if (c.seq > opts.since && !opts.cancelled) {\n opts.since = c.seq;\n opts.onChange(c);\n }\n }).on('complete', function () {\n if (inprogress === 'waiting') {\n nextTick(eventFunction);\n }\n inprogress = false;\n }).on('error', onError);\n }\n this._listeners[id] = eventFunction;\n this.on(dbName, eventFunction);\n};\n\nChanges.prototype.removeListener = function (dbName, id) {\n /* istanbul ignore if */\n if (!(id in this._listeners)) {\n return;\n }\n events.EventEmitter.prototype.removeListener.call(this, dbName,\n this._listeners[id]);\n delete this._listeners[id];\n};\n\n\n/* istanbul ignore next */\nChanges.prototype.notifyLocalWindows = function (dbName) {\n //do a useless change on a storage thing\n //in order to get other windows's listeners to activate\n if (isChromeApp()) {\n chrome.storage.local.set({dbName: dbName});\n } else if (hasLocalStorage()) {\n localStorage[dbName] = (localStorage[dbName] === \"a\") ? \"b\" : \"a\";\n }\n};\n\nChanges.prototype.notify = function (dbName) {\n this.emit(dbName);\n this.notifyLocalWindows(dbName);\n};\n\nfunction guardedConsole(method) {\n /* istanbul ignore else */\n if (typeof console !== 'undefined' && typeof console[method] === 'function') {\n var args = Array.prototype.slice.call(arguments, 1);\n console[method].apply(console, args);\n }\n}\n\nfunction randomNumber(min, max) {\n var maxTimeout = 600000; // Hard-coded default of 10 minutes\n min = parseInt(min, 10) || 0;\n max = parseInt(max, 10);\n if (max !== max || max <= min) {\n max = (min || 1) << 1; //doubling\n } else {\n max = max + 1;\n }\n // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout\n if (max > maxTimeout) {\n min = maxTimeout >> 1; // divide by two\n max = maxTimeout;\n }\n var ratio = Math.random();\n var range = max - min;\n\n return ~~(range * ratio + min); // ~~ coerces to an int, but fast.\n}\n\nfunction defaultBackOff(min) {\n var max = 0;\n if (!min) {\n max = 2000;\n }\n return randomNumber(min, max);\n}\n\n// designed to give info to browser users, who are disturbed\n// when they see http errors in the console\nfunction explainError(status, str) {\n guardedConsole('info', 'The above ' + status + ' is totally normal. ' + str);\n}\n\nvar assign;\n{\n if (typeof Object.assign === 'function') {\n assign = Object.assign;\n } else {\n // lite Object.assign polyfill based on\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n assign = function (target) {\n var to = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var nextSource = arguments[index];\n\n if (nextSource != null) { // Skip over if undefined or null\n for (var nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n };\n }\n}\n\nvar $inject_Object_assign = assign;\n\ninherits(PouchError, Error);\n\nfunction PouchError(status, error, reason) {\n Error.call(this, reason);\n this.status = status;\n this.name = error;\n this.message = reason;\n this.error = true;\n}\n\nPouchError.prototype.toString = function () {\n return JSON.stringify({\n status: this.status,\n name: this.name,\n message: this.message,\n reason: this.reason\n });\n};\n\nvar UNAUTHORIZED = new PouchError(401, 'unauthorized', \"Name or password is incorrect.\");\nvar MISSING_BULK_DOCS = new PouchError(400, 'bad_request', \"Missing JSON list of 'docs'\");\nvar MISSING_DOC = new PouchError(404, 'not_found', 'missing');\nvar REV_CONFLICT = new PouchError(409, 'conflict', 'Document update conflict');\nvar INVALID_ID = new PouchError(400, 'bad_request', '_id field must contain a string');\nvar MISSING_ID = new PouchError(412, 'missing_id', '_id is required for puts');\nvar RESERVED_ID = new PouchError(400, 'bad_request', 'Only reserved document ids may start with underscore.');\nvar NOT_OPEN = new PouchError(412, 'precondition_failed', 'Database not open');\nvar UNKNOWN_ERROR = new PouchError(500, 'unknown_error', 'Database encountered an unknown error');\nvar BAD_ARG = new PouchError(500, 'badarg', 'Some query argument is invalid');\nvar INVALID_REQUEST = new PouchError(400, 'invalid_request', 'Request was invalid');\nvar QUERY_PARSE_ERROR = new PouchError(400, 'query_parse_error', 'Some query parameter is invalid');\nvar DOC_VALIDATION = new PouchError(500, 'doc_validation', 'Bad special document member');\nvar BAD_REQUEST = new PouchError(400, 'bad_request', 'Something wrong with the request');\nvar NOT_AN_OBJECT = new PouchError(400, 'bad_request', 'Document must be a JSON object');\nvar DB_MISSING = new PouchError(404, 'not_found', 'Database not found');\nvar IDB_ERROR = new PouchError(500, 'indexed_db_went_bad', 'unknown');\nvar WSQ_ERROR = new PouchError(500, 'web_sql_went_bad', 'unknown');\nvar LDB_ERROR = new PouchError(500, 'levelDB_went_went_bad', 'unknown');\nvar FORBIDDEN = new PouchError(403, 'forbidden', 'Forbidden by design doc validate_doc_update function');\nvar INVALID_REV = new PouchError(400, 'bad_request', 'Invalid rev format');\nvar FILE_EXISTS = new PouchError(412, 'file_exists', 'The database could not be created, the file already exists.');\nvar MISSING_STUB = new PouchError(412, 'missing_stub', 'A pre-existing attachment stub wasn\\'t found');\nvar INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid');\n\nfunction createError(error, reason) {\n function CustomPouchError(reason) {\n // inherit error properties from our parent error manually\n // so as to allow proper JSON parsing.\n /* jshint ignore:start */\n for (var p in error) {\n if (typeof error[p] !== 'function') {\n this[p] = error[p];\n }\n }\n /* jshint ignore:end */\n if (reason !== undefined) {\n this.reason = reason;\n }\n }\n CustomPouchError.prototype = PouchError.prototype;\n return new CustomPouchError(reason);\n}\n\nfunction generateErrorFromResponse(err) {\n\n if (typeof err !== 'object') {\n var data = err;\n err = UNKNOWN_ERROR;\n err.data = data;\n }\n\n if ('error' in err && err.error === 'conflict') {\n err.name = 'conflict';\n err.status = 409;\n }\n\n if (!('name' in err)) {\n err.name = err.error || 'unknown';\n }\n\n if (!('status' in err)) {\n err.status = 500;\n }\n\n if (!('message' in err)) {\n err.message = err.message || err.reason;\n }\n\n return err;\n}\n\nfunction tryFilter(filter, doc, req) {\n try {\n return !filter(doc, req);\n } catch (err) {\n var msg = 'Filter function threw: ' + err.toString();\n return createError(BAD_REQUEST, msg);\n }\n}\n\nfunction filterChange(opts) {\n var req = {};\n var hasFilter = opts.filter && typeof opts.filter === 'function';\n req.query = opts.query_params;\n\n return function filter(change) {\n if (!change.doc) {\n // CSG sends events on the changes feed that don't have documents,\n // this hack makes a whole lot of existing code robust.\n change.doc = {};\n }\n\n var filterReturn = hasFilter && tryFilter(opts.filter, change.doc, req);\n\n if (typeof filterReturn === 'object') {\n return filterReturn;\n }\n\n if (filterReturn) {\n return false;\n }\n\n if (!opts.include_docs) {\n delete change.doc;\n } else if (!opts.attachments) {\n for (var att in change.doc._attachments) {\n /* istanbul ignore else */\n if (change.doc._attachments.hasOwnProperty(att)) {\n change.doc._attachments[att].stub = true;\n }\n }\n }\n return true;\n };\n}\n\nfunction flatten(arrs) {\n var res = [];\n for (var i = 0, len = arrs.length; i < len; i++) {\n res = res.concat(arrs[i]);\n }\n return res;\n}\n\n// shim for Function.prototype.name,\n// for browsers that don't support it like IE\n\n/* istanbul ignore next */\n\n// Determine id an ID is valid\n// - invalid IDs begin with an underescore that does not begin '_design' or\n// '_local'\n// - any other string value is a valid id\n// Returns the specific error object for each case\nfunction invalidIdError(id) {\n var err;\n if (!id) {\n err = createError(MISSING_ID);\n } else if (typeof id !== 'string') {\n err = createError(INVALID_ID);\n } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) {\n err = createError(RESERVED_ID);\n }\n if (err) {\n throw err;\n }\n}\n\n// Checks if a PouchDB object is \"remote\" or not. This is\n// designed to opt-in to certain optimizations, such as\n// avoiding checks for \"dependentDbs\" and other things that\n// we know only apply to local databases. In general, \"remote\"\n// should be true for the http adapter, and for third-party\n// adapters with similar expensive boundaries to cross for\n// every API call, such as socket-pouch and worker-pouch.\n// Previously, this was handled via db.type() === 'http'\n// which is now deprecated.\n\nfunction isRemote(db) {\n if (typeof db._remote === 'boolean') {\n return db._remote;\n }\n /* istanbul ignore next */\n if (typeof db.type === 'function') {\n guardedConsole('warn',\n 'db.type() is deprecated and will be removed in ' +\n 'a future version of PouchDB');\n return db.type() === 'http';\n }\n /* istanbul ignore next */\n return false;\n}\n\nfunction listenerCount(ee, type) {\n return 'listenerCount' in ee ? ee.listenerCount(type) :\n events.EventEmitter.listenerCount(ee, type);\n}\n\nfunction parseDesignDocFunctionName(s) {\n if (!s) {\n return null;\n }\n var parts = s.split('/');\n if (parts.length === 2) {\n return parts;\n }\n if (parts.length === 1) {\n return [s, s];\n }\n return null;\n}\n\nfunction normalizeDesignDocFunctionName(s) {\n var normalized = parseDesignDocFunctionName(s);\n return normalized ? normalized.join('/') : null;\n}\n\n// originally parseUri 1.2.2, now patched by us\n// (c) Steven Levithan <stevenlevithan.com>\n// MIT License\nvar keys = [\"source\", \"protocol\", \"authority\", \"userInfo\", \"user\", \"password\",\n \"host\", \"port\", \"relative\", \"path\", \"directory\", \"file\", \"query\", \"anchor\"];\nvar qName =\"queryKey\";\nvar qParser = /(?:^|&)([^&=]*)=?([^&]*)/g;\n\n// use the \"loose\" parser\n/* eslint maxlen: 0, no-useless-escape: 0 */\nvar parser = /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\n\nfunction parseUri(str) {\n var m = parser.exec(str);\n var uri = {};\n var i = 14;\n\n while (i--) {\n var key = keys[i];\n var value = m[i] || \"\";\n var encoded = ['user', 'password'].indexOf(key) !== -1;\n uri[key] = encoded ? decodeURIComponent(value) : value;\n }\n\n uri[qName] = {};\n uri[keys[12]].replace(qParser, function ($0, $1, $2) {\n if ($1) {\n uri[qName][$1] = $2;\n }\n });\n\n return uri;\n}\n\n// Based on https://github.com/alexdavid/scope-eval v0.0.3\n// (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js)\n// This is basically just a wrapper around new Function()\n\nfunction scopeEval(source, scope) {\n var keys = [];\n var values = [];\n for (var key in scope) {\n if (scope.hasOwnProperty(key)) {\n keys.push(key);\n values.push(scope[key]);\n }\n }\n keys.push(source);\n return Function.apply(null, keys).apply(null, values);\n}\n\n// this is essentially the \"update sugar\" function from daleharvey/pouchdb#1388\n// the diffFun tells us what delta to apply to the doc. it either returns\n// the doc, or false if it doesn't need to do an update after all\nfunction upsert(db, docId, diffFun) {\n return new PouchPromise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}\n\nfunction tryAndPut(db, doc, diffFun) {\n return db.put(doc).then(function (res) {\n return {\n updated: true,\n rev: res.rev\n };\n }, function (err) {\n /* istanbul ignore next */\n if (err.status !== 409) {\n throw err;\n }\n return upsert(db, doc._id, diffFun);\n });\n}\n\nfunction rev() {\n return uuidV4.v4().replace(/-/g, '').toLowerCase();\n}\n\nvar uuid = uuidV4.v4;\n\n// We fetch all leafs of the revision tree, and sort them based on tree length\n// and whether they were deleted, undeleted documents with the longest revision\n// tree (most edits) win\n// The final sort algorithm is slightly documented in a sidebar here:\n// http://guide.couchdb.org/draft/conflicts.html\nfunction winningRev(metadata) {\n var winningId;\n var winningPos;\n var winningDeleted;\n var toVisit = metadata.rev_tree.slice();\n var node;\n while ((node = toVisit.pop())) {\n var tree = node.ids;\n var branches = tree[2];\n var pos = node.pos;\n if (branches.length) { // non-leaf\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: pos + 1, ids: branches[i]});\n }\n continue;\n }\n var deleted = !!tree[1].deleted;\n var id = tree[0];\n // sort by deleted, then pos, then id\n if (!winningId || (winningDeleted !== deleted ? winningDeleted :\n winningPos !== pos ? winningPos < pos : winningId < id)) {\n winningId = id;\n winningPos = pos;\n winningDeleted = deleted;\n }\n }\n\n return winningPos + '-' + winningId;\n}\n\n// Pretty much all below can be combined into a higher order function to\n// traverse revisions\n// The return value from the callback will be passed as context to all\n// children of that node\nfunction traverseRevTree(revs, callback) {\n var toVisit = revs.slice();\n\n var node;\n while ((node = toVisit.pop())) {\n var pos = node.pos;\n var tree = node.ids;\n var branches = tree[2];\n var newCtx =\n callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]);\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx});\n }\n }\n}\n\nfunction sortByPos(a, b) {\n return a.pos - b.pos;\n}\n\nfunction collectLeaves(revs) {\n var leaves = [];\n traverseRevTree(revs, function (isLeaf, pos, id, acc, opts) {\n if (isLeaf) {\n leaves.push({rev: pos + \"-\" + id, pos: pos, opts: opts});\n }\n });\n leaves.sort(sortByPos).reverse();\n for (var i = 0, len = leaves.length; i < len; i++) {\n delete leaves[i].pos;\n }\n return leaves;\n}\n\n// returns revs of all conflicts that is leaves such that\n// 1. are not deleted and\n// 2. are different than winning revision\nfunction collectConflicts(metadata) {\n var win = winningRev(metadata);\n var leaves = collectLeaves(metadata.rev_tree);\n var conflicts = [];\n for (var i = 0, len = leaves.length; i < len; i++) {\n var leaf = leaves[i];\n if (leaf.rev !== win && !leaf.opts.deleted) {\n conflicts.push(leaf.rev);\n }\n }\n return conflicts;\n}\n\n// compact a tree by marking its non-leafs as missing,\n// and return a list of revs to delete\nfunction compactTree(metadata) {\n var revs = [];\n traverseRevTree(metadata.rev_tree, function (isLeaf, pos,\n revHash, ctx, opts) {\n if (opts.status === 'available' && !isLeaf) {\n revs.push(pos + '-' + revHash);\n opts.status = 'missing';\n }\n });\n return revs;\n}\n\n// build up a list of all the paths to the leafs in this revision tree\nfunction rootToLeaf(revs) {\n var paths = [];\n var toVisit = revs.slice();\n var node;\n while ((node = toVisit.pop())) {\n var pos = node.pos;\n var tree = node.ids;\n var id = tree[0];\n var opts = tree[1];\n var branches = tree[2];\n var isLeaf = branches.length === 0;\n\n var history = node.history ? node.history.slice() : [];\n history.push({id: id, opts: opts});\n if (isLeaf) {\n paths.push({pos: (pos + 1 - history.length), ids: history});\n }\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: pos + 1, ids: branches[i], history: history});\n }\n }\n return paths.reverse();\n}\n\n// for a better overview of what this is doing, read:\n// https://github.com/apache/couchdb-couch/blob/master/src/couch_key_tree.erl\n//\n// But for a quick intro, CouchDB uses a revision tree to store a documents\n// history, A -> B -> C, when a document has conflicts, that is a branch in the\n// tree, A -> (B1 | B2 -> C), We store these as a nested array in the format\n//\n// KeyTree = [Path ... ]\n// Path = {pos: position_from_root, ids: Tree}\n// Tree = [Key, Opts, [Tree, ...]], in particular single node: [Key, []]\n\nfunction sortByPos$1(a, b) {\n return a.pos - b.pos;\n}\n\n// classic binary search\nfunction binarySearch(arr, item, comparator) {\n var low = 0;\n var high = arr.length;\n var mid;\n while (low < high) {\n mid = (low + high) >>> 1;\n if (comparator(arr[mid], item) < 0) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return low;\n}\n\n// assuming the arr is sorted, insert the item in the proper place\nfunction insertSorted(arr, item, comparator) {\n var idx = binarySearch(arr, item, comparator);\n arr.splice(idx, 0, item);\n}\n\n// Turn a path as a flat array into a tree with a single branch.\n// If any should be stemmed from the beginning of the array, that's passed\n// in as the second argument\nfunction pathToTree(path, numStemmed) {\n var root;\n var leaf;\n for (var i = numStemmed, len = path.length; i < len; i++) {\n var node = path[i];\n var currentLeaf = [node.id, node.opts, []];\n if (leaf) {\n leaf[2].push(currentLeaf);\n leaf = currentLeaf;\n } else {\n root = leaf = currentLeaf;\n }\n }\n return root;\n}\n\n// compare the IDs of two trees\nfunction compareTree(a, b) {\n return a[0] < b[0] ? -1 : 1;\n}\n\n// Merge two trees together\n// The roots of tree1 and tree2 must be the same revision\nfunction mergeTree(in_tree1, in_tree2) {\n var queue = [{tree1: in_tree1, tree2: in_tree2}];\n var conflicts = false;\n while (queue.length > 0) {\n var item = queue.pop();\n var tree1 = item.tree1;\n var tree2 = item.tree2;\n\n if (tree1[1].status || tree2[1].status) {\n tree1[1].status =\n (tree1[1].status === 'available' ||\n tree2[1].status === 'available') ? 'available' : 'missing';\n }\n\n for (var i = 0; i < tree2[2].length; i++) {\n if (!tree1[2][0]) {\n conflicts = 'new_leaf';\n tree1[2][0] = tree2[2][i];\n continue;\n }\n\n var merged = false;\n for (var j = 0; j < tree1[2].length; j++) {\n if (tree1[2][j][0] === tree2[2][i][0]) {\n queue.push({tree1: tree1[2][j], tree2: tree2[2][i]});\n merged = true;\n }\n }\n if (!merged) {\n conflicts = 'new_branch';\n insertSorted(tree1[2], tree2[2][i], compareTree);\n }\n }\n }\n return {conflicts: conflicts, tree: in_tree1};\n}\n\nfunction doMerge(tree, path, dontExpand) {\n var restree = [];\n var conflicts = false;\n var merged = false;\n var res;\n\n if (!tree.length) {\n return {tree: [path], conflicts: 'new_leaf'};\n }\n\n for (var i = 0, len = tree.length; i < len; i++) {\n var branch = tree[i];\n if (branch.pos === path.pos && branch.ids[0] === path.ids[0]) {\n // Paths start at the same position and have the same root, so they need\n // merged\n res = mergeTree(branch.ids, path.ids);\n restree.push({pos: branch.pos, ids: res.tree});\n conflicts = conflicts || res.conflicts;\n merged = true;\n } else if (dontExpand !== true) {\n // The paths start at a different position, take the earliest path and\n // traverse up until it as at the same point from root as the path we\n // want to merge. If the keys match we return the longer path with the\n // other merged After stemming we dont want to expand the trees\n\n var t1 = branch.pos < path.pos ? branch : path;\n var t2 = branch.pos < path.pos ? path : branch;\n var diff = t2.pos - t1.pos;\n\n var candidateParents = [];\n\n var trees = [];\n trees.push({ids: t1.ids, diff: diff, parent: null, parentIdx: null});\n while (trees.length > 0) {\n var item = trees.pop();\n if (item.diff === 0) {\n if (item.ids[0] === t2.ids[0]) {\n candidateParents.push(item);\n }\n continue;\n }\n var elements = item.ids[2];\n for (var j = 0, elementsLen = elements.length; j < elementsLen; j++) {\n trees.push({\n ids: elements[j],\n diff: item.diff - 1,\n parent: item.ids,\n parentIdx: j\n });\n }\n }\n\n var el = candidateParents[0];\n\n if (!el) {\n restree.push(branch);\n } else {\n res = mergeTree(el.ids, t2.ids);\n el.parent[2][el.parentIdx] = res.tree;\n restree.push({pos: t1.pos, ids: t1.ids});\n conflicts = conflicts || res.conflicts;\n merged = true;\n }\n } else {\n restree.push(branch);\n }\n }\n\n // We didnt find\n if (!merged) {\n restree.push(path);\n }\n\n restree.sort(sortByPos$1);\n\n return {\n tree: restree,\n conflicts: conflicts || 'internal_node'\n };\n}\n\n// To ensure we dont grow the revision tree infinitely, we stem old revisions\nfunction stem(tree, depth) {\n // First we break out the tree into a complete list of root to leaf paths\n var paths = rootToLeaf(tree);\n var stemmedRevs;\n\n var result;\n for (var i = 0, len = paths.length; i < len; i++) {\n // Then for each path, we cut off the start of the path based on the\n // `depth` to stem to, and generate a new set of flat trees\n var path = paths[i];\n var stemmed = path.ids;\n var node;\n if (stemmed.length > depth) {\n // only do the stemming work if we actually need to stem\n if (!stemmedRevs) {\n stemmedRevs = {}; // avoid allocating this object unnecessarily\n }\n var numStemmed = stemmed.length - depth;\n node = {\n pos: path.pos + numStemmed,\n ids: pathToTree(stemmed, numStemmed)\n };\n\n for (var s = 0; s < numStemmed; s++) {\n var rev = (path.pos + s) + '-' + stemmed[s].id;\n stemmedRevs[rev] = true;\n }\n } else { // no need to actually stem\n node = {\n pos: path.pos,\n ids: pathToTree(stemmed, 0)\n };\n }\n\n // Then we remerge all those flat trees together, ensuring that we dont\n // connect trees that would go beyond the depth limit\n if (result) {\n result = doMerge(result, node, true).tree;\n } else {\n result = [node];\n }\n }\n\n // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed\n if (stemmedRevs) {\n traverseRevTree(result, function (isLeaf, pos, revHash) {\n // some revisions may have been removed in a branch but not in another\n delete stemmedRevs[pos + '-' + revHash];\n });\n }\n\n return {\n tree: result,\n revs: stemmedRevs ? Object.keys(stemmedRevs) : []\n };\n}\n\nfunction merge(tree, path, depth) {\n var newTree = doMerge(tree, path);\n var stemmed = stem(newTree.tree, depth);\n return {\n tree: stemmed.tree,\n stemmedRevs: stemmed.revs,\n conflicts: newTree.conflicts\n };\n}\n\n// return true if a rev exists in the rev tree, false otherwise\nfunction revExists(revs, rev) {\n var toVisit = revs.slice();\n var splitRev = rev.split('-');\n var targetPos = parseInt(splitRev[0], 10);\n var targetId = splitRev[1];\n\n var node;\n while ((node = toVisit.pop())) {\n if (node.pos === targetPos && node.ids[0] === targetId) {\n return true;\n }\n var branches = node.ids[2];\n for (var i = 0, len = branches.length; i < len; i++) {\n toVisit.push({pos: node.pos + 1, ids: branches[i]});\n }\n }\n return false;\n}\n\nfunction getTrees(node) {\n return node.ids;\n}\n\n// check if a specific revision of a doc has been deleted\n// - metadata: the metadata object from the doc store\n// - rev: (optional) the revision to check. defaults to winning revision\nfunction isDeleted(metadata, rev) {\n if (!rev) {\n rev = winningRev(metadata);\n }\n var id = rev.substring(rev.indexOf('-') + 1);\n var toVisit = metadata.rev_tree.map(getTrees);\n\n var tree;\n while ((tree = toVisit.pop())) {\n if (tree[0] === id) {\n return !!tree[1].deleted;\n }\n toVisit = toVisit.concat(tree[2]);\n }\n}\n\nfunction isLocalId(id) {\n return (/^_local/).test(id);\n}\n\n// returns the current leaf node for a given revision\nfunction latest(rev, metadata) {\n var toVisit = metadata.rev_tree.slice();\n var node;\n while ((node = toVisit.pop())) {\n var pos = node.pos;\n var tree = node.ids;\n var id = tree[0];\n var opts = tree[1];\n var branches = tree[2];\n var isLeaf = branches.length === 0;\n\n var history = node.history ? node.history.slice() : [];\n history.push({id: id, pos: pos, opts: opts});\n\n if (isLeaf) {\n for (var i = 0, len = history.length; i < len; i++) {\n var historyNode = history[i];\n var historyRev = historyNode.pos + '-' + historyNode.id;\n\n if (historyRev === rev) {\n // return the rev of this leaf\n return pos + '-' + id;\n }\n }\n }\n\n for (var j = 0, l = branches.length; j < l; j++) {\n toVisit.push({pos: pos + 1, ids: branches[j], history: history});\n }\n }\n\n /* istanbul ignore next */\n throw new Error('Unable to resolve latest revision for id ' + metadata.id + ', rev ' + rev);\n}\n\ninherits(Changes$2, events.EventEmitter);\n\nfunction tryCatchInChangeListener(self, change, pending, lastSeq) {\n // isolate try/catches to avoid V8 deoptimizations\n try {\n self.emit('change', change, pending, lastSeq);\n } catch (e) {\n guardedConsole('error', 'Error in .on(\"change\", function):', e);\n }\n}\n\nfunction Changes$2(db, opts, callback) {\n events.EventEmitter.call(this);\n var self = this;\n this.db = db;\n opts = opts ? clone(opts) : {};\n var complete = opts.complete = once(function (err, resp) {\n if (err) {\n if (listenerCount(self, 'error') > 0) {\n self.emit('error', err);\n }\n } else {\n self.emit('complete', resp);\n }\n self.removeAllListeners();\n db.removeListener('destroyed', onDestroy);\n });\n if (callback) {\n self.on('complete', function (resp) {\n callback(null, resp);\n });\n self.on('error', callback);\n }\n function onDestroy() {\n self.cancel();\n }\n db.once('destroyed', onDestroy);\n\n opts.onChange = function (change, pending, lastSeq) {\n /* istanbul ignore if */\n if (self.isCancelled) {\n return;\n }\n tryCatchInChangeListener(self, change, pending, lastSeq);\n };\n\n var promise = new PouchPromise(function (fulfill, reject) {\n opts.complete = function (err, res) {\n if (err) {\n reject(err);\n } else {\n fulfill(res);\n }\n };\n });\n self.once('cancel', function () {\n db.removeListener('destroyed', onDestroy);\n opts.complete(null, {status: 'cancelled'});\n });\n this.then = promise.then.bind(promise);\n this['catch'] = promise['catch'].bind(promise);\n this.then(function (result) {\n complete(null, result);\n }, complete);\n\n\n\n if (!db.taskqueue.isReady) {\n db.taskqueue.addTask(function (failed) {\n if (failed) {\n opts.complete(failed);\n } else if (self.isCancelled) {\n self.emit('cancel');\n } else {\n self.validateChanges(opts);\n }\n });\n } else {\n self.validateChanges(opts);\n }\n}\nChanges$2.prototype.cancel = function () {\n this.isCancelled = true;\n if (this.db.taskqueue.isReady) {\n this.emit('cancel');\n }\n};\nfunction processChange(doc, metadata, opts) {\n var changeList = [{rev: doc._rev}];\n if (opts.style === 'all_docs') {\n changeList = collectLeaves(metadata.rev_tree)\n .map(function (x) { return {rev: x.rev}; });\n }\n var change = {\n id: metadata.id,\n changes: changeList,\n doc: doc\n };\n\n if (isDeleted(metadata, doc._rev)) {\n change.deleted = true;\n }\n if (opts.conflicts) {\n change.doc._conflicts = collectConflicts(metadata);\n if (!change.doc._conflicts.length) {\n delete change.doc._conflicts;\n }\n }\n return change;\n}\n\nChanges$2.prototype.validateChanges = function (opts) {\n var callback = opts.complete;\n var self = this;\n\n /* istanbul ignore else */\n if (PouchDB._changesFilterPlugin) {\n PouchDB._changesFilterPlugin.validate(opts, function (err) {\n if (err) {\n return callback(err);\n }\n self.doChanges(opts);\n });\n } else {\n self.doChanges(opts);\n }\n};\n\nChanges$2.prototype.doChanges = function (opts) {\n var self = this;\n var callback = opts.complete;\n\n opts = clone(opts);\n if ('live' in opts && !('continuous' in opts)) {\n opts.continuous = opts.live;\n }\n opts.processChange = processChange;\n\n if (opts.since === 'latest') {\n opts.since = 'now';\n }\n if (!opts.since) {\n opts.since = 0;\n }\n if (opts.since === 'now') {\n this.db.info().then(function (info) {\n /* istanbul ignore if */\n if (self.isCancelled) {\n callback(null, {status: 'cancelled'});\n return;\n }\n opts.since = info.update_seq;\n self.doChanges(opts);\n }, callback);\n return;\n }\n\n /* istanbul ignore else */\n if (PouchDB._changesFilterPlugin) {\n PouchDB._changesFilterPlugin.normalize(opts);\n if (PouchDB._changesFilterPlugin.shouldFilter(this, opts)) {\n return PouchDB._changesFilterPlugin.filter(this, opts);\n }\n } else {\n ['doc_ids', 'filter', 'selector', 'view'].forEach(function (key) {\n if (key in opts) {\n guardedConsole('warn',\n 'The \"' + key + '\" option was passed in to changes/replicate, ' +\n 'but pouchdb-changes-filter plugin is not installed, so it ' +\n 'was ignored. Please install the plugin to enable filtering.'\n );\n }\n });\n }\n\n if (!('descending' in opts)) {\n opts.descending = false;\n }\n\n // 0 and 1 should return 1 document\n opts.limit = opts.limit === 0 ? 1 : opts.limit;\n opts.complete = callback;\n var newPromise = this.db._changes(opts);\n /* istanbul ignore else */\n if (newPromise && typeof newPromise.cancel === 'function') {\n var cancel = self.cancel;\n self.cancel = getArguments(function (args) {\n newPromise.cancel();\n cancel.apply(this, args);\n });\n }\n};\n\n/*\n * A generic pouch adapter\n */\n\nfunction compare(left, right) {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\n// Wrapper for functions that call the bulkdocs api with a single doc,\n// if the first result is an error, return an error\nfunction yankError(callback, docId) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n err = err || results[0];\n err.docId = docId;\n callback(err);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}\n\n// clean docs given to us by the user\nfunction cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}\n\n// compare two docs, first by _id then by _rev\nfunction compareByIdThenRev(a, b) {\n var idCompare = compare(a._id, b._id);\n if (idCompare !== 0) {\n return idCompare;\n }\n var aStart = a._revisions ? a._revisions.start : 0;\n var bStart = b._revisions ? b._revisions.start : 0;\n return compare(aStart, bStart);\n}\n\n// for every node in a revision tree computes its distance from the closest\n// leaf\nfunction computeHeight(revs) {\n var height = {};\n var edges = [];\n traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev$$1 = pos + \"-\" + id;\n if (isLeaf) {\n height[rev$$1] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev$$1});\n }\n return rev$$1;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}\n\nfunction allDocsKeysParse(opts) {\n var keys = ('limit' in opts) ?\n opts.keys.slice(opts.skip, opts.limit + opts.skip) :\n (opts.skip > 0) ? opts.keys.slice(opts.skip) : opts.keys;\n opts.keys = keys;\n opts.skip = 0;\n delete opts.limit;\n if (opts.descending) {\n keys.reverse();\n opts.descending = false;\n }\n}\n\n// all compaction is done in a queue, to avoid attaching\n// too many listeners at once\nfunction doNextCompaction(self) {\n var task = self._compactionQueue[0];\n var opts = task.opts;\n var callback = task.callback;\n self.get('_local/compaction')[\"catch\"](function () {\n return false;\n }).then(function (doc) {\n if (doc && doc.last_seq) {\n opts.last_seq = doc.last_seq;\n }\n self._compact(opts, function (err, res) {\n /* istanbul ignore if */\n if (err) {\n callback(err);\n } else {\n callback(null, res);\n }\n nextTick(function () {\n self._compactionQueue.shift();\n if (self._compactionQueue.length) {\n doNextCompaction(self);\n }\n });\n });\n });\n}\n\nfunction attachmentNameError(name) {\n if (name.charAt(0) === '_') {\n return name + ' is not a valid attachment name, attachment ' +\n 'names cannot start with \\'_\\'';\n }\n return false;\n}\n\ninherits(AbstractPouchDB, events.EventEmitter);\n\nfunction AbstractPouchDB() {\n events.EventEmitter.call(this);\n}\n\nAbstractPouchDB.prototype.post =\n adapterFun('post', function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n if (typeof doc !== 'object' || Array.isArray(doc)) {\n return callback(createError(NOT_AN_OBJECT));\n }\n this.bulkDocs({docs: [doc]}, opts, yankError(callback, doc._id));\n});\n\nAbstractPouchDB.prototype.put = adapterFun('put', function (doc, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts;\n opts = {};\n }\n if (typeof doc !== 'object' || Array.isArray(doc)) {\n return cb(createError(NOT_AN_OBJECT));\n }\n invalidIdError(doc._id);\n if (isLocalId(doc._id) && typeof this._putLocal === 'function') {\n if (doc._deleted) {\n return this._removeLocal(doc, cb);\n } else {\n return this._putLocal(doc, cb);\n }\n }\n var self = this;\n if (opts.force && doc._rev) {\n transformForceOptionToNewEditsOption();\n putDoc(function (err) {\n var result = err ? null : {ok: true, id: doc._id, rev: doc._rev};\n cb(err, result);\n });\n } else {\n putDoc(cb);\n }\n\n function transformForceOptionToNewEditsOption() {\n var parts = doc._rev.split('-');\n var oldRevId = parts[1];\n var oldRevNum = parseInt(parts[0], 10);\n\n var newRevNum = oldRevNum + 1;\n var newRevId = rev();\n\n doc._revisions = {\n start: newRevNum,\n ids: [newRevId, oldRevId]\n };\n doc._rev = newRevNum + '-' + newRevId;\n opts.new_edits = false;\n }\n function putDoc(next) {\n if (typeof self._put === 'function' && opts.new_edits !== false) {\n self._put(doc, opts, next);\n } else {\n self.bulkDocs({docs: [doc]}, opts, yankError(next, doc._id));\n }\n }\n});\n\nAbstractPouchDB.prototype.putAttachment =\n adapterFun('putAttachment', function (docId, attachmentId, rev$$1,\n blob, type) {\n var api = this;\n if (typeof type === 'function') {\n type = blob;\n blob = rev$$1;\n rev$$1 = null;\n }\n // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267\n /* istanbul ignore if */\n if (typeof type === 'undefined') {\n type = blob;\n blob = rev$$1;\n rev$$1 = null;\n }\n if (!type) {\n guardedConsole('warn', 'Attachment', attachmentId, 'on document', docId, 'is missing content_type');\n }\n\n function createAttachment(doc) {\n var prevrevpos = '_rev' in doc ? parseInt(doc._rev, 10) : 0;\n doc._attachments = doc._attachments || {};\n doc._attachments[attachmentId] = {\n content_type: type,\n data: blob,\n revpos: ++prevrevpos\n };\n return api.put(doc);\n }\n\n return api.get(docId).then(function (doc) {\n if (doc._rev !== rev$$1) {\n throw createError(REV_CONFLICT);\n }\n\n return createAttachment(doc);\n }, function (err) {\n // create new doc\n /* istanbul ignore else */\n if (err.reason === MISSING_DOC.message) {\n return createAttachment({_id: docId});\n } else {\n throw err;\n }\n });\n});\n\nAbstractPouchDB.prototype.removeAttachment =\n adapterFun('removeAttachment', function (docId, attachmentId, rev$$1,\n callback) {\n var self = this;\n self.get(docId, function (err, obj) {\n /* istanbul ignore if */\n if (err) {\n callback(err);\n return;\n }\n if (obj._rev !== rev$$1) {\n callback(createError(REV_CONFLICT));\n return;\n }\n /* istanbul ignore if */\n if (!obj._attachments) {\n return callback();\n }\n delete obj._attachments[attachmentId];\n if (Object.keys(obj._attachments).length === 0) {\n delete obj._attachments;\n }\n self.put(obj, callback);\n });\n});\n\nAbstractPouchDB.prototype.remove =\n adapterFun('remove', function (docOrId, optsOrRev, opts, callback) {\n var doc;\n if (typeof optsOrRev === 'string') {\n // id, rev, opts, callback style\n doc = {\n _id: docOrId,\n _rev: optsOrRev\n };\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n } else {\n // doc, opts, callback style\n doc = docOrId;\n if (typeof optsOrRev === 'function') {\n callback = optsOrRev;\n opts = {};\n } else {\n callback = opts;\n opts = optsOrRev;\n }\n }\n opts = opts || {};\n opts.was_delete = true;\n var newDoc = {_id: doc._id, _rev: (doc._rev || opts.rev)};\n newDoc._deleted = true;\n if (isLocalId(newDoc._id) && typeof this._removeLocal === 'function') {\n return this._removeLocal(doc, callback);\n }\n this.bulkDocs({docs: [newDoc]}, opts, yankError(callback, newDoc._id));\n});\n\nAbstractPouchDB.prototype.revsDiff =\n adapterFun('revsDiff', function (req, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var ids = Object.keys(req);\n\n if (!ids.length) {\n return callback(null, {});\n }\n\n var count = 0;\n var missing = new ExportedMap();\n\n function addToMissing(id, revId) {\n if (!missing.has(id)) {\n missing.set(id, {missing: []});\n }\n missing.get(id).missing.push(revId);\n }\n\n function processDoc(id, rev_tree) {\n // Is this fast enough? Maybe we should switch to a set simulated by a map\n var missingForId = req[id].slice(0);\n traverseRevTree(rev_tree, function (isLeaf, pos, revHash, ctx,\n opts) {\n var rev$$1 = pos + '-' + revHash;\n var idx = missingForId.indexOf(rev$$1);\n if (idx === -1) {\n return;\n }\n\n missingForId.splice(idx, 1);\n /* istanbul ignore if */\n if (opts.status !== 'available') {\n addToMissing(id, rev$$1);\n }\n });\n\n // Traversing the tree is synchronous, so now `missingForId` contains\n // revisions that were not found in the tree\n missingForId.forEach(function (rev$$1) {\n addToMissing(id, rev$$1);\n });\n }\n\n ids.map(function (id) {\n this._getRevisionTree(id, function (err, rev_tree) {\n if (err && err.status === 404 && err.message === 'missing') {\n missing.set(id, {missing: req[id]});\n } else if (err) {\n /* istanbul ignore next */\n return callback(err);\n } else {\n processDoc(id, rev_tree);\n }\n\n if (++count === ids.length) {\n // convert LazyMap to object\n var missingObj = {};\n missing.forEach(function (value, key) {\n missingObj[key] = value;\n });\n return callback(null, missingObj);\n }\n });\n }, this);\n});\n\n// _bulk_get API for faster replication, as described in\n// https://github.com/apache/couchdb-chttpd/pull/33\n// At the \"abstract\" level, it will just run multiple get()s in\n// parallel, because this isn't much of a performance cost\n// for local databases (except the cost of multiple transactions, which is\n// small). The http adapter overrides this in order\n// to do a more efficient single HTTP request.\nAbstractPouchDB.prototype.bulkGet =\n adapterFun('bulkGet', function (opts, callback) {\n bulkGet(this, opts, callback);\n});\n\n// compact one document and fire callback\n// by compacting we mean removing all revisions which\n// are further from the leaf in revision tree than max_height\nAbstractPouchDB.prototype.compactDocument =\n adapterFun('compactDocument', function (docId, maxHeight, callback) {\n var self = this;\n this._getRevisionTree(docId, function (err, revTree) {\n /* istanbul ignore if */\n if (err) {\n return callback(err);\n }\n var height = computeHeight(revTree);\n var candidates = [];\n var revs = [];\n Object.keys(height).forEach(function (rev$$1) {\n if (height[rev$$1] > maxHeight) {\n candidates.push(rev$$1);\n }\n });\n\n traverseRevTree(revTree, function (isLeaf, pos, revHash, ctx, opts) {\n var rev$$1 = pos + '-' + revHash;\n if (opts.status === 'available' && candidates.indexOf(rev$$1) !== -1) {\n revs.push(rev$$1);\n }\n });\n self._doCompaction(docId, revs, callback);\n });\n});\n\n// compact the whole database using single document\n// compaction\nAbstractPouchDB.prototype.compact =\n adapterFun('compact', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n var self = this;\n opts = opts || {};\n\n self._compactionQueue = self._compactionQueue || [];\n self._compactionQueue.push({opts: opts, callback: callback});\n if (self._compactionQueue.length === 1) {\n doNextCompaction(self);\n }\n});\nAbstractPouchDB.prototype._compact = function (opts, callback) {\n var self = this;\n var changesOpts = {\n return_docs: false,\n last_seq: opts.last_seq || 0\n };\n var promises = [];\n\n function onChange(row) {\n promises.push(self.compactDocument(row.id, 0));\n }\n function onComplete(resp) {\n var lastSeq = resp.last_seq;\n PouchPromise.all(promises).then(function () {\n return upsert(self, '_local/compaction', function deltaFunc(doc) {\n if (!doc.last_seq || doc.last_seq < lastSeq) {\n doc.last_seq = lastSeq;\n return doc;\n }\n return false; // somebody else got here first, don't update\n });\n }).then(function () {\n callback(null, {ok: true});\n })[\"catch\"](callback);\n }\n self.changes(changesOpts)\n .on('change', onChange)\n .on('complete', onComplete)\n .on('error', callback);\n};\n\n/* Begin api wrappers. Specific functionality to storage belongs in the\n _[method] */\nAbstractPouchDB.prototype.get = adapterFun('get', function (id, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts;\n opts = {};\n }\n if (typeof id !== 'string') {\n return cb(createError(INVALID_ID));\n }\n if (isLocalId(id) && typeof this._getLocal === 'function') {\n return this._getLocal(id, cb);\n }\n var leaves = [], self = this;\n\n function finishOpenRevs() {\n var result = [];\n var count = leaves.length;\n /* istanbul ignore if */\n if (!count) {\n return cb(null, result);\n }\n\n // order with open_revs is unspecified\n leaves.forEach(function (leaf) {\n self.get(id, {\n rev: leaf,\n revs: opts.revs,\n latest: opts.latest,\n attachments: opts.attachments,\n binary: opts.binary\n }, function (err, doc) {\n if (!err) {\n // using latest=true can produce duplicates\n var existing;\n for (var i = 0, l = result.length; i < l; i++) {\n if (result[i].ok && result[i].ok._rev === doc._rev) {\n existing = true;\n break;\n }\n }\n if (!existing) {\n result.push({ok: doc});\n }\n } else {\n result.push({missing: leaf});\n }\n count--;\n if (!count) {\n cb(null, result);\n }\n });\n });\n }\n\n if (opts.open_revs) {\n if (opts.open_revs === \"all\") {\n this._getRevisionTree(id, function (err, rev_tree) {\n if (err) {\n return cb(err);\n }\n leaves = collectLeaves(rev_tree).map(function (leaf) {\n return leaf.rev;\n });\n finishOpenRevs();\n });\n } else {\n if (Array.isArray(opts.open_revs)) {\n leaves = opts.open_revs;\n for (var i = 0; i < leaves.length; i++) {\n var l = leaves[i];\n // looks like it's the only thing couchdb checks\n if (!(typeof (l) === \"string\" && /^\\d+-/.test(l))) {\n return cb(createError(INVALID_REV));\n }\n }\n finishOpenRevs();\n } else {\n return cb(createError(UNKNOWN_ERROR, 'function_clause'));\n }\n }\n return; // open_revs does not like other options\n }\n\n return this._get(id, opts, function (err, result) {\n if (err) {\n err.docId = id;\n return cb(err);\n }\n\n var doc = result.doc;\n var metadata = result.metadata;\n var ctx = result.ctx;\n\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n doc._conflicts = conflicts;\n }\n }\n\n if (isDeleted(metadata, doc._rev)) {\n doc._deleted = true;\n }\n\n if (opts.revs || opts.revs_info) {\n var splittedRev = doc._rev.split('-');\n var revNo = parseInt(splittedRev[0], 10);\n var revHash = splittedRev[1];\n\n var paths = rootToLeaf(metadata.rev_tree);\n var path = null;\n\n for (var i = 0; i < paths.length; i++) {\n var currentPath = paths[i];\n var hashIndex = currentPath.ids.map(function (x) { return x.id; })\n .indexOf(revHash);\n var hashFoundAtRevPos = hashIndex === (revNo - 1);\n\n if (hashFoundAtRevPos || (!path && hashIndex !== -1)) {\n path = currentPath;\n }\n }\n\n var indexOfRev = path.ids.map(function (x) { return x.id; })\n .indexOf(doc._rev.split('-')[1]) + 1;\n var howMany = path.ids.length - indexOfRev;\n path.ids.splice(indexOfRev, howMany);\n path.ids.reverse();\n\n if (opts.revs) {\n doc._revisions = {\n start: (path.pos + path.ids.length) - 1,\n ids: path.ids.map(function (rev$$1) {\n return rev$$1.id;\n })\n };\n }\n if (opts.revs_info) {\n var pos = path.pos + path.ids.length;\n doc._revs_info = path.ids.map(function (rev$$1) {\n pos--;\n return {\n rev: pos + '-' + rev$$1.id,\n status: rev$$1.opts.status\n };\n });\n }\n }\n\n if (opts.attachments && doc._attachments) {\n var attachments = doc._attachments;\n var count = Object.keys(attachments).length;\n if (count === 0) {\n return cb(null, doc);\n }\n Object.keys(attachments).forEach(function (key) {\n this._getAttachment(doc._id, key, attachments[key], {\n // Previously the revision handling was done in adapter.js\n // getAttachment, however since idb-next doesnt we need to\n // pass the rev through\n rev: doc._rev,\n binary: opts.binary,\n ctx: ctx\n }, function (err, data) {\n var att = doc._attachments[key];\n att.data = data;\n delete att.stub;\n delete att.length;\n if (!--count) {\n cb(null, doc);\n }\n });\n }, self);\n } else {\n if (doc._attachments) {\n for (var key in doc._attachments) {\n /* istanbul ignore else */\n if (doc._attachments.hasOwnProperty(key)) {\n doc._attachments[key].stub = true;\n }\n }\n }\n cb(null, doc);\n }\n });\n});\n\n// TODO: I dont like this, it forces an extra read for every\n// attachment read and enforces a confusing api between\n// adapter.js and the adapter implementation\nAbstractPouchDB.prototype.getAttachment =\n adapterFun('getAttachment', function (docId, attachmentId, opts, callback) {\n var self = this;\n if (opts instanceof Function) {\n callback = opts;\n opts = {};\n }\n this._get(docId, opts, function (err, res) {\n if (err) {\n return callback(err);\n }\n if (res.doc._attachments && res.doc._attachments[attachmentId]) {\n opts.ctx = res.ctx;\n opts.binary = true;\n self._getAttachment(docId, attachmentId,\n res.doc._attachments[attachmentId], opts, callback);\n } else {\n return callback(createError(MISSING_DOC));\n }\n });\n});\n\nAbstractPouchDB.prototype.allDocs =\n adapterFun('allDocs', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts.skip = typeof opts.skip !== 'undefined' ? opts.skip : 0;\n if (opts.start_key) {\n opts.startkey = opts.start_key;\n }\n if (opts.end_key) {\n opts.endkey = opts.end_key;\n }\n if ('keys' in opts) {\n if (!Array.isArray(opts.keys)) {\n return callback(new TypeError('options.keys must be an array'));\n }\n var incompatibleOpt =\n ['startkey', 'endkey', 'key'].filter(function (incompatibleOpt) {\n return incompatibleOpt in opts;\n })[0];\n if (incompatibleOpt) {\n callback(createError(QUERY_PARSE_ERROR,\n 'Query parameter `' + incompatibleOpt +\n '` is not compatible with multi-get'\n ));\n return;\n }\n if (!isRemote(this)) {\n allDocsKeysParse(opts);\n if (opts.keys.length === 0) {\n return this._allDocs({limit: 0}, callback);\n }\n }\n }\n\n return this._allDocs(opts, callback);\n});\n\nAbstractPouchDB.prototype.changes = function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return new Changes$2(this, opts, callback);\n};\n\nAbstractPouchDB.prototype.close = adapterFun('close', function (callback) {\n this._closed = true;\n this.emit('closed');\n return this._close(callback);\n});\n\nAbstractPouchDB.prototype.info = adapterFun('info', function (callback) {\n var self = this;\n this._info(function (err, info) {\n if (err) {\n return callback(err);\n }\n // assume we know better than the adapter, unless it informs us\n info.db_name = info.db_name || self.name;\n info.auto_compaction = !!(self.auto_compaction && !isRemote(self));\n info.adapter = self.adapter;\n callback(null, info);\n });\n});\n\nAbstractPouchDB.prototype.id = adapterFun('id', function (callback) {\n return this._id(callback);\n});\n\n/* istanbul ignore next */\nAbstractPouchDB.prototype.type = function () {\n return (typeof this._type === 'function') ? this._type() : this.adapter;\n};\n\nAbstractPouchDB.prototype.bulkDocs =\n adapterFun('bulkDocs', function (req, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n opts = opts || {};\n\n if (Array.isArray(req)) {\n req = {\n docs: req\n };\n }\n\n if (!req || !req.docs || !Array.isArray(req.docs)) {\n return callback(createError(MISSING_BULK_DOCS));\n }\n\n for (var i = 0; i < req.docs.length; ++i) {\n if (typeof req.docs[i] !== 'object' || Array.isArray(req.docs[i])) {\n return callback(createError(NOT_AN_OBJECT));\n }\n }\n\n var attachmentError;\n req.docs.forEach(function (doc) {\n if (doc._attachments) {\n Object.keys(doc._attachments).forEach(function (name) {\n attachmentError = attachmentError || attachmentNameError(name);\n if (!doc._attachments[name].content_type) {\n guardedConsole('warn', 'Attachment', name, 'on document', doc._id, 'is missing content_type');\n }\n });\n }\n });\n\n if (attachmentError) {\n return callback(createError(BAD_REQUEST, attachmentError));\n }\n\n if (!('new_edits' in opts)) {\n if ('new_edits' in req) {\n opts.new_edits = req.new_edits;\n } else {\n opts.new_edits = true;\n }\n }\n\n var adapter = this;\n if (!opts.new_edits && !isRemote(adapter)) {\n // ensure revisions of the same doc are sorted, so that\n // the local adapter processes them correctly (#2935)\n req.docs.sort(compareByIdThenRev);\n }\n\n cleanDocs(req.docs);\n\n // in the case of conflicts, we want to return the _ids to the user\n // however, the underlying adapter may destroy the docs array, so\n // create a copy here\n var ids = req.docs.map(function (doc) {\n return doc._id;\n });\n\n return this._bulkDocs(req, opts, function (err, res) {\n if (err) {\n return callback(err);\n }\n if (!opts.new_edits) {\n // this is what couch does when new_edits is false\n res = res.filter(function (x) {\n return x.error;\n });\n }\n // add ids for error/conflict responses (not required for CouchDB)\n if (!isRemote(adapter)) {\n for (var i = 0, l = res.length; i < l; i++) {\n res[i].id = res[i].id || ids[i];\n }\n }\n\n callback(null, res);\n });\n});\n\nAbstractPouchDB.prototype.registerDependentDatabase =\n adapterFun('registerDependentDatabase', function (dependentDb,\n callback) {\n var depDB = new this.constructor(dependentDb, this.__opts);\n\n function diffFun(doc) {\n doc.dependentDbs = doc.dependentDbs || {};\n if (doc.dependentDbs[dependentDb]) {\n return false; // no update required\n }\n doc.dependentDbs[dependentDb] = true;\n return doc;\n }\n upsert(this, '_local/_pouch_dependentDbs', diffFun)\n .then(function () {\n callback(null, {db: depDB});\n })[\"catch\"](callback);\n});\n\nAbstractPouchDB.prototype.destroy =\n adapterFun('destroy', function (opts, callback) {\n\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n var self = this;\n var usePrefix = 'use_prefix' in self ? self.use_prefix : true;\n\n function destroyDb() {\n // call destroy method of the particular adaptor\n self._destroy(opts, function (err, resp) {\n if (err) {\n return callback(err);\n }\n self._destroyed = true;\n self.emit('destroyed');\n callback(null, resp || { 'ok': true });\n });\n }\n\n if (isRemote(self)) {\n // no need to check for dependent DBs if it's a remote DB\n return destroyDb();\n }\n\n self.get('_local/_pouch_dependentDbs', function (err, localDoc) {\n if (err) {\n /* istanbul ignore if */\n if (err.status !== 404) {\n return callback(err);\n } else { // no dependencies\n return destroyDb();\n }\n }\n var dependentDbs = localDoc.dependentDbs;\n var PouchDB = self.constructor;\n var deletedMap = Object.keys(dependentDbs).map(function (name) {\n // use_prefix is only false in the browser\n /* istanbul ignore next */\n var trueName = usePrefix ?\n name.replace(new RegExp('^' + PouchDB.prefix), '') : name;\n return new PouchDB(trueName, self.__opts).destroy();\n });\n PouchPromise.all(deletedMap).then(destroyDb, callback);\n });\n});\n\nfunction TaskQueue$1() {\n this.isReady = false;\n this.failed = false;\n this.queue = [];\n}\n\nTaskQueue$1.prototype.execute = function () {\n var fun;\n if (this.failed) {\n while ((fun = this.queue.shift())) {\n fun(this.failed);\n }\n } else {\n while ((fun = this.queue.shift())) {\n fun();\n }\n }\n};\n\nTaskQueue$1.prototype.fail = function (err) {\n this.failed = err;\n this.execute();\n};\n\nTaskQueue$1.prototype.ready = function (db) {\n this.isReady = true;\n this.db = db;\n this.execute();\n};\n\nTaskQueue$1.prototype.addTask = function (fun) {\n this.queue.push(fun);\n if (this.failed) {\n this.execute();\n }\n};\n\nfunction parseAdapter(name, opts) {\n var match = name.match(/([a-z-]*):\\/\\/(.*)/);\n if (match) {\n // the http adapter expects the fully qualified name\n return {\n name: /https?/.test(match[1]) ? match[1] + '://' + match[2] : match[2],\n adapter: match[1]\n };\n }\n\n var adapters = PouchDB.adapters;\n var preferredAdapters = PouchDB.preferredAdapters;\n var prefix = PouchDB.prefix;\n var adapterName = opts.adapter;\n\n if (!adapterName) { // automatically determine adapter\n for (var i = 0; i < preferredAdapters.length; ++i) {\n adapterName = preferredAdapters[i];\n // check for browsers that have been upgraded from websql-only to websql+idb\n /* istanbul ignore if */\n if (adapterName === 'idb' && 'websql' in adapters &&\n hasLocalStorage() && localStorage['_pouch__websqldb_' + prefix + name]) {\n // log it, because this can be confusing during development\n guardedConsole('log', 'PouchDB is downgrading \"' + name + '\" to WebSQL to' +\n ' avoid data loss, because it was already opened with WebSQL.');\n continue; // keep using websql to avoid user data loss\n }\n break;\n }\n }\n\n var adapter = adapters[adapterName];\n\n // if adapter is invalid, then an error will be thrown later\n var usePrefix = (adapter && 'use_prefix' in adapter) ?\n adapter.use_prefix : true;\n\n return {\n name: usePrefix ? (prefix + name) : name,\n adapter: adapterName\n };\n}\n\n// OK, so here's the deal. Consider this code:\n// var db1 = new PouchDB('foo');\n// var db2 = new PouchDB('foo');\n// db1.destroy();\n// ^ these two both need to emit 'destroyed' events,\n// as well as the PouchDB constructor itself.\n// So we have one db object (whichever one got destroy() called on it)\n// responsible for emitting the initial event, which then gets emitted\n// by the constructor, which then broadcasts it to any other dbs\n// that may have been created with the same name.\nfunction prepareForDestruction(self) {\n\n function onDestroyed(from_constructor) {\n self.removeListener('closed', onClosed);\n if (!from_constructor) {\n self.constructor.emit('destroyed', self.name);\n }\n }\n\n function onClosed() {\n self.removeListener('destroyed', onDestroyed);\n self.constructor.emit('unref', self);\n }\n\n self.once('destroyed', onDestroyed);\n self.once('closed', onClosed);\n self.constructor.emit('ref', self);\n}\n\ninherits(PouchDB, AbstractPouchDB);\nfunction PouchDB(name, opts) {\n // In Node our test suite only tests this for PouchAlt unfortunately\n /* istanbul ignore if */\n if (!(this instanceof PouchDB)) {\n return new PouchDB(name, opts);\n }\n\n var self = this;\n opts = opts || {};\n\n if (name && typeof name === 'object') {\n opts = name;\n name = opts.name;\n delete opts.name;\n }\n\n this.__opts = opts = clone(opts);\n\n self.auto_compaction = opts.auto_compaction;\n self.prefix = PouchDB.prefix;\n\n if (typeof name !== 'string') {\n throw new Error('Missing/invalid DB name');\n }\n\n var prefixedName = (opts.prefix || '') + name;\n var backend = parseAdapter(prefixedName, opts);\n\n opts.name = backend.name;\n opts.adapter = opts.adapter || backend.adapter;\n\n self.name = name;\n self._adapter = opts.adapter;\n PouchDB.emit('debug', ['adapter', 'Picked adapter: ', opts.adapter]);\n\n if (!PouchDB.adapters[opts.adapter] ||\n !PouchDB.adapters[opts.adapter].valid()) {\n throw new Error('Invalid Adapter: ' + opts.adapter);\n }\n\n AbstractPouchDB.call(self);\n self.taskqueue = new TaskQueue$1();\n\n self.adapter = opts.adapter;\n\n PouchDB.adapters[opts.adapter].call(self, opts, function (err) {\n if (err) {\n return self.taskqueue.fail(err);\n }\n prepareForDestruction(self);\n\n self.emit('created', self);\n PouchDB.emit('created', self.name);\n self.taskqueue.ready(self);\n });\n\n}\n\nPouchDB.adapters = {};\nPouchDB.preferredAdapters = [];\n\nPouchDB.prefix = '_pouch_';\n\nvar eventEmitter = new events.EventEmitter();\n\nfunction setUpEventEmitter(Pouch) {\n Object.keys(events.EventEmitter.prototype).forEach(function (key) {\n if (typeof events.EventEmitter.prototype[key] === 'function') {\n Pouch[key] = eventEmitter[key].bind(eventEmitter);\n }\n });\n\n // these are created in constructor.js, and allow us to notify each DB with\n // the same name that it was destroyed, via the constructor object\n var destructListeners = Pouch._destructionListeners = new ExportedMap();\n\n Pouch.on('ref', function onConstructorRef(db) {\n if (!destructListeners.has(db.name)) {\n destructListeners.set(db.name, []);\n }\n destructListeners.get(db.name).push(db);\n });\n\n Pouch.on('unref', function onConstructorUnref(db) {\n if (!destructListeners.has(db.name)) {\n return;\n }\n var dbList = destructListeners.get(db.name);\n var pos = dbList.indexOf(db);\n if (pos < 0) {\n /* istanbul ignore next */\n return;\n }\n dbList.splice(pos, 1);\n if (dbList.length > 1) {\n /* istanbul ignore next */\n destructListeners.set(db.name, dbList);\n } else {\n destructListeners[\"delete\"](db.name);\n }\n });\n\n Pouch.on('destroyed', function onConstructorDestroyed(name) {\n if (!destructListeners.has(name)) {\n return;\n }\n var dbList = destructListeners.get(name);\n destructListeners[\"delete\"](name);\n dbList.forEach(function (db) {\n db.emit('destroyed',true);\n });\n });\n}\n\nsetUpEventEmitter(PouchDB);\n\nPouchDB.adapter = function (id, obj, addToPreferredAdapters) {\n /* istanbul ignore else */\n if (obj.valid()) {\n PouchDB.adapters[id] = obj;\n if (addToPreferredAdapters) {\n PouchDB.preferredAdapters.push(id);\n }\n }\n};\n\nPouchDB.plugin = function (obj) {\n if (typeof obj === 'function') { // function style for plugins\n obj(PouchDB);\n } else if (typeof obj !== 'object' || Object.keys(obj).length === 0) {\n throw new Error('Invalid plugin: got \"' + obj + '\", expected an object or a function');\n } else {\n Object.keys(obj).forEach(function (id) { // object style for plugins\n PouchDB.prototype[id] = obj[id];\n });\n }\n if (this.__defaults) {\n PouchDB.__defaults = $inject_Object_assign({}, this.__defaults);\n }\n return PouchDB;\n};\n\nPouchDB.defaults = function (defaultOpts) {\n function PouchAlt(name, opts) {\n if (!(this instanceof PouchAlt)) {\n return new PouchAlt(name, opts);\n }\n\n opts = opts || {};\n\n if (name && typeof name === 'object') {\n opts = name;\n name = opts.name;\n delete opts.name;\n }\n\n opts = $inject_Object_assign({}, PouchAlt.__defaults, opts);\n PouchDB.call(this, name, opts);\n }\n\n inherits(PouchAlt, PouchDB);\n\n PouchAlt.preferredAdapters = PouchDB.preferredAdapters.slice();\n Object.keys(PouchDB).forEach(function (key) {\n if (!(key in PouchAlt)) {\n PouchAlt[key] = PouchDB[key];\n }\n });\n\n // make default options transitive\n // https://github.com/pouchdb/pouchdb/issues/5922\n PouchAlt.__defaults = $inject_Object_assign({}, this.__defaults, defaultOpts);\n\n return PouchAlt;\n};\n\n// managed automatically by set-version.js\nvar version = \"6.4.3\";\n\nfunction debugPouch(PouchDB) {\n PouchDB.debug = debug;\n var logs = {};\n /* istanbul ignore next */\n PouchDB.on('debug', function (args) {\n // first argument is log identifier\n var logId = args[0];\n // rest should be passed verbatim to debug module\n var logArgs = args.slice(1);\n if (!logs[logId]) {\n logs[logId] = debug('pouchdb:' + logId);\n }\n logs[logId].apply(null, logArgs);\n });\n}\n\n// this would just be \"return doc[field]\", but fields\n// can be \"deep\" due to dot notation\nfunction getFieldFromDoc(doc, parsedField) {\n var value = doc;\n for (var i = 0, len = parsedField.length; i < len; i++) {\n var key = parsedField[i];\n value = value[key];\n if (!value) {\n break;\n }\n }\n return value;\n}\n\nfunction compare$1(left, right) {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\n// Converts a string in dot notation to an array of its components, with backslash escaping\nfunction parseField(fieldName) {\n // fields may be deep (e.g. \"foo.bar.baz\"), so parse\n var fields = [];\n var current = '';\n for (var i = 0, len = fieldName.length; i < len; i++) {\n var ch = fieldName[i];\n if (ch === '.') {\n if (i > 0 && fieldName[i - 1] === '\\\\') { // escaped delimiter\n current = current.substring(0, current.length - 1) + '.';\n } else { // not escaped, so delimiter\n fields.push(current);\n current = '';\n }\n } else { // normal character\n current += ch;\n }\n }\n fields.push(current);\n return fields;\n}\n\nvar combinationFields = ['$or', '$nor', '$not'];\nfunction isCombinationalField(field) {\n return combinationFields.indexOf(field) > -1;\n}\n\nfunction getKey(obj) {\n return Object.keys(obj)[0];\n}\n\nfunction getValue(obj) {\n return obj[getKey(obj)];\n}\n\n\n// flatten an array of selectors joined by an $and operator\nfunction mergeAndedSelectors(selectors) {\n\n // sort to ensure that e.g. if the user specified\n // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into\n // just {$gt: 'b'}\n var res = {};\n\n selectors.forEach(function (selector) {\n Object.keys(selector).forEach(function (field) {\n var matcher = selector[field];\n if (typeof matcher !== 'object') {\n matcher = {$eq: matcher};\n }\n\n if (isCombinationalField(field)) {\n if (matcher instanceof Array) {\n res[field] = matcher.map(function (m) {\n return mergeAndedSelectors([m]);\n });\n } else {\n res[field] = mergeAndedSelectors([matcher]);\n }\n } else {\n var fieldMatchers = res[field] = res[field] || {};\n Object.keys(matcher).forEach(function (operator) {\n var value = matcher[operator];\n\n if (operator === '$gt' || operator === '$gte') {\n return mergeGtGte(operator, value, fieldMatchers);\n } else if (operator === '$lt' || operator === '$lte') {\n return mergeLtLte(operator, value, fieldMatchers);\n } else if (operator === '$ne') {\n return mergeNe(value, fieldMatchers);\n } else if (operator === '$eq') {\n return mergeEq(value, fieldMatchers);\n }\n fieldMatchers[operator] = value;\n });\n }\n });\n });\n\n return res;\n}\n\n\n\n// collapse logically equivalent gt/gte values\nfunction mergeGtGte(operator, value, fieldMatchers) {\n if (typeof fieldMatchers.$eq !== 'undefined') {\n return; // do nothing\n }\n if (typeof fieldMatchers.$gte !== 'undefined') {\n if (operator === '$gte') {\n if (value > fieldMatchers.$gte) { // more specificity\n fieldMatchers.$gte = value;\n }\n } else { // operator === '$gt'\n if (value >= fieldMatchers.$gte) { // more specificity\n delete fieldMatchers.$gte;\n fieldMatchers.$gt = value;\n }\n }\n } else if (typeof fieldMatchers.$gt !== 'undefined') {\n if (operator === '$gte') {\n if (value > fieldMatchers.$gt) { // more specificity\n delete fieldMatchers.$gt;\n fieldMatchers.$gte = value;\n }\n } else { // operator === '$gt'\n if (value > fieldMatchers.$gt) { // more specificity\n fieldMatchers.$gt = value;\n }\n }\n } else {\n fieldMatchers[operator] = value;\n }\n}\n\n// collapse logically equivalent lt/lte values\nfunction mergeLtLte(operator, value, fieldMatchers) {\n if (typeof fieldMatchers.$eq !== 'undefined') {\n return; // do nothing\n }\n if (typeof fieldMatchers.$lte !== 'undefined') {\n if (operator === '$lte') {\n if (value < fieldMatchers.$lte) { // more specificity\n fieldMatchers.$lte = value;\n }\n } else { // operator === '$gt'\n if (value <= fieldMatchers.$lte) { // more specificity\n delete fieldMatchers.$lte;\n fieldMatchers.$lt = value;\n }\n }\n } else if (typeof fieldMatchers.$lt !== 'undefined') {\n if (operator === '$lte') {\n if (value < fieldMatchers.$lt) { // more specificity\n delete fieldMatchers.$lt;\n fieldMatchers.$lte = value;\n }\n } else { // operator === '$gt'\n if (value < fieldMatchers.$lt) { // more specificity\n fieldMatchers.$lt = value;\n }\n }\n } else {\n fieldMatchers[operator] = value;\n }\n}\n\n// combine $ne values into one array\nfunction mergeNe(value, fieldMatchers) {\n if ('$ne' in fieldMatchers) {\n // there are many things this could \"not\" be\n fieldMatchers.$ne.push(value);\n } else { // doesn't exist yet\n fieldMatchers.$ne = [value];\n }\n}\n\n// add $eq into the mix\nfunction mergeEq(value, fieldMatchers) {\n // these all have less specificity than the $eq\n // TODO: check for user errors here\n delete fieldMatchers.$gt;\n delete fieldMatchers.$gte;\n delete fieldMatchers.$lt;\n delete fieldMatchers.$lte;\n delete fieldMatchers.$ne;\n fieldMatchers.$eq = value;\n}\n\n\n//\n// normalize the selector\n//\nfunction massageSelector(input) {\n var result = clone(input);\n var wasAnded = false;\n if ('$and' in result) {\n result = mergeAndedSelectors(result['$and']);\n wasAnded = true;\n }\n\n ['$or', '$nor'].forEach(function (orOrNor) {\n if (orOrNor in result) {\n // message each individual selector\n // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}}\n result[orOrNor].forEach(function (subSelector) {\n var fields = Object.keys(subSelector);\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n var matcher = subSelector[field];\n if (typeof matcher !== 'object' || matcher === null) {\n subSelector[field] = {$eq: matcher};\n }\n }\n });\n }\n });\n\n if ('$not' in result) {\n //This feels a little like forcing, but it will work for now,\n //I would like to come back to this and make the merging of selectors a little more generic\n result['$not'] = mergeAndedSelectors([result['$not']]);\n }\n\n var fields = Object.keys(result);\n\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n var matcher = result[field];\n\n if (typeof matcher !== 'object' || matcher === null) {\n matcher = {$eq: matcher};\n } else if ('$ne' in matcher && !wasAnded) {\n // I put these in an array, since there may be more than one\n // but in the \"mergeAnded\" operation, I already take care of that\n matcher.$ne = [matcher.$ne];\n }\n result[field] = matcher;\n }\n\n return result;\n}\n\nfunction pad(str, padWith, upToLength) {\n var padding = '';\n var targetLength = upToLength - str.length;\n /* istanbul ignore next */\n while (padding.length < targetLength) {\n padding += padWith;\n }\n return padding;\n}\n\nfunction padLeft(str, padWith, upToLength) {\n var padding = pad(str, padWith, upToLength);\n return padding + str;\n}\n\nvar MIN_MAGNITUDE = -324; // verified by -Number.MIN_VALUE\nvar MAGNITUDE_DIGITS = 3; // ditto\nvar SEP = ''; // set to '_' for easier debugging \n\nfunction collate(a, b) {\n\n if (a === b) {\n return 0;\n }\n\n a = normalizeKey(a);\n b = normalizeKey(b);\n\n var ai = collationIndex(a);\n var bi = collationIndex(b);\n if ((ai - bi) !== 0) {\n return ai - bi;\n }\n switch (typeof a) {\n case 'number':\n return a - b;\n case 'boolean':\n return a < b ? -1 : 1;\n case 'string':\n return stringCollate(a, b);\n }\n return Array.isArray(a) ? arrayCollate(a, b) : objectCollate(a, b);\n}\n\n// couch considers null/NaN/Infinity/-Infinity === undefined,\n// for the purposes of mapreduce indexes. also, dates get stringified.\nfunction normalizeKey(key) {\n switch (typeof key) {\n case 'undefined':\n return null;\n case 'number':\n if (key === Infinity || key === -Infinity || isNaN(key)) {\n return null;\n }\n return key;\n case 'object':\n var origKey = key;\n if (Array.isArray(key)) {\n var len = key.length;\n key = new Array(len);\n for (var i = 0; i < len; i++) {\n key[i] = normalizeKey(origKey[i]);\n }\n /* istanbul ignore next */\n } else if (key instanceof Date) {\n return key.toJSON();\n } else if (key !== null) { // generic object\n key = {};\n for (var k in origKey) {\n if (origKey.hasOwnProperty(k)) {\n var val = origKey[k];\n if (typeof val !== 'undefined') {\n key[k] = normalizeKey(val);\n }\n }\n }\n }\n }\n return key;\n}\n\nfunction indexify(key) {\n if (key !== null) {\n switch (typeof key) {\n case 'boolean':\n return key ? 1 : 0;\n case 'number':\n return numToIndexableString(key);\n case 'string':\n // We've to be sure that key does not contain \\u0000\n // Do order-preserving replacements:\n // 0 -> 1, 1\n // 1 -> 1, 2\n // 2 -> 2, 2\n return key\n .replace(/\\u0002/g, '\\u0002\\u0002')\n .replace(/\\u0001/g, '\\u0001\\u0002')\n .replace(/\\u0000/g, '\\u0001\\u0001');\n case 'object':\n var isArray = Array.isArray(key);\n var arr = isArray ? key : Object.keys(key);\n var i = -1;\n var len = arr.length;\n var result = '';\n if (isArray) {\n while (++i < len) {\n result += toIndexableString(arr[i]);\n }\n } else {\n while (++i < len) {\n var objKey = arr[i];\n result += toIndexableString(objKey) +\n toIndexableString(key[objKey]);\n }\n }\n return result;\n }\n }\n return '';\n}\n\n// convert the given key to a string that would be appropriate\n// for lexical sorting, e.g. within a database, where the\n// sorting is the same given by the collate() function.\nfunction toIndexableString(key) {\n var zero = '\\u0000';\n key = normalizeKey(key);\n return collationIndex(key) + SEP + indexify(key) + zero;\n}\n\nfunction parseNumber(str, i) {\n var originalIdx = i;\n var num;\n var zero = str[i] === '1';\n if (zero) {\n num = 0;\n i++;\n } else {\n var neg = str[i] === '0';\n i++;\n var numAsString = '';\n var magAsString = str.substring(i, i + MAGNITUDE_DIGITS);\n var magnitude = parseInt(magAsString, 10) + MIN_MAGNITUDE;\n /* istanbul ignore next */\n if (neg) {\n magnitude = -magnitude;\n }\n i += MAGNITUDE_DIGITS;\n while (true) {\n var ch = str[i];\n if (ch === '\\u0000') {\n break;\n } else {\n numAsString += ch;\n }\n i++;\n }\n numAsString = numAsString.split('.');\n if (numAsString.length === 1) {\n num = parseInt(numAsString, 10);\n } else {\n /* istanbul ignore next */\n num = parseFloat(numAsString[0] + '.' + numAsString[1]);\n }\n /* istanbul ignore next */\n if (neg) {\n num = num - 10;\n }\n /* istanbul ignore next */\n if (magnitude !== 0) {\n // parseFloat is more reliable than pow due to rounding errors\n // e.g. Number.MAX_VALUE would return Infinity if we did\n // num * Math.pow(10, magnitude);\n num = parseFloat(num + 'e' + magnitude);\n }\n }\n return {num: num, length : i - originalIdx};\n}\n\n// move up the stack while parsing\n// this function moved outside of parseIndexableString for performance\nfunction pop(stack, metaStack) {\n var obj = stack.pop();\n\n if (metaStack.length) {\n var lastMetaElement = metaStack[metaStack.length - 1];\n if (obj === lastMetaElement.element) {\n // popping a meta-element, e.g. an object whose value is another object\n metaStack.pop();\n lastMetaElement = metaStack[metaStack.length - 1];\n }\n var element = lastMetaElement.element;\n var lastElementIndex = lastMetaElement.index;\n if (Array.isArray(element)) {\n element.push(obj);\n } else if (lastElementIndex === stack.length - 2) { // obj with key+value\n var key = stack.pop();\n element[key] = obj;\n } else {\n stack.push(obj); // obj with key only\n }\n }\n}\n\nfunction parseIndexableString(str) {\n var stack = [];\n var metaStack = []; // stack for arrays and objects\n var i = 0;\n\n /*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n while (true) {\n var collationIndex = str[i++];\n if (collationIndex === '\\u0000') {\n if (stack.length === 1) {\n return stack.pop();\n } else {\n pop(stack, metaStack);\n continue;\n }\n }\n switch (collationIndex) {\n case '1':\n stack.push(null);\n break;\n case '2':\n stack.push(str[i] === '1');\n i++;\n break;\n case '3':\n var parsedNum = parseNumber(str, i);\n stack.push(parsedNum.num);\n i += parsedNum.length;\n break;\n case '4':\n var parsedStr = '';\n /*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n while (true) {\n var ch = str[i];\n if (ch === '\\u0000') {\n break;\n }\n parsedStr += ch;\n i++;\n }\n // perform the reverse of the order-preserving replacement\n // algorithm (see above)\n parsedStr = parsedStr.replace(/\\u0001\\u0001/g, '\\u0000')\n .replace(/\\u0001\\u0002/g, '\\u0001')\n .replace(/\\u0002\\u0002/g, '\\u0002');\n stack.push(parsedStr);\n break;\n case '5':\n var arrayElement = { element: [], index: stack.length };\n stack.push(arrayElement.element);\n metaStack.push(arrayElement);\n break;\n case '6':\n var objElement = { element: {}, index: stack.length };\n stack.push(objElement.element);\n metaStack.push(objElement);\n break;\n /* istanbul ignore next */\n default:\n throw new Error(\n 'bad collationIndex or unexpectedly reached end of input: ' +\n collationIndex);\n }\n }\n}\n\nfunction arrayCollate(a, b) {\n var len = Math.min(a.length, b.length);\n for (var i = 0; i < len; i++) {\n var sort = collate(a[i], b[i]);\n if (sort !== 0) {\n return sort;\n }\n }\n return (a.length === b.length) ? 0 :\n (a.length > b.length) ? 1 : -1;\n}\nfunction stringCollate(a, b) {\n // See: https://github.com/daleharvey/pouchdb/issues/40\n // This is incompatible with the CouchDB implementation, but its the\n // best we can do for now\n return (a === b) ? 0 : ((a > b) ? 1 : -1);\n}\nfunction objectCollate(a, b) {\n var ak = Object.keys(a), bk = Object.keys(b);\n var len = Math.min(ak.length, bk.length);\n for (var i = 0; i < len; i++) {\n // First sort the keys\n var sort = collate(ak[i], bk[i]);\n if (sort !== 0) {\n return sort;\n }\n // if the keys are equal sort the values\n sort = collate(a[ak[i]], b[bk[i]]);\n if (sort !== 0) {\n return sort;\n }\n\n }\n return (ak.length === bk.length) ? 0 :\n (ak.length > bk.length) ? 1 : -1;\n}\n// The collation is defined by erlangs ordered terms\n// the atoms null, true, false come first, then numbers, strings,\n// arrays, then objects\n// null/undefined/NaN/Infinity/-Infinity are all considered null\nfunction collationIndex(x) {\n var id = ['boolean', 'number', 'string', 'object'];\n var idx = id.indexOf(typeof x);\n //false if -1 otherwise true, but fast!!!!1\n if (~idx) {\n if (x === null) {\n return 1;\n }\n if (Array.isArray(x)) {\n return 5;\n }\n return idx < 3 ? (idx + 2) : (idx + 3);\n }\n /* istanbul ignore next */\n if (Array.isArray(x)) {\n return 5;\n }\n}\n\n// conversion:\n// x yyy zz...zz\n// x = 0 for negative, 1 for 0, 2 for positive\n// y = exponent (for negative numbers negated) moved so that it's >= 0\n// z = mantisse\nfunction numToIndexableString(num) {\n\n if (num === 0) {\n return '1';\n }\n\n // convert number to exponential format for easier and\n // more succinct string sorting\n var expFormat = num.toExponential().split(/e\\+?/);\n var magnitude = parseInt(expFormat[1], 10);\n\n var neg = num < 0;\n\n var result = neg ? '0' : '2';\n\n // first sort by magnitude\n // it's easier if all magnitudes are positive\n var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE);\n var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS);\n\n result += SEP + magString;\n\n // then sort by the factor\n var factor = Math.abs(parseFloat(expFormat[0])); // [1..10)\n /* istanbul ignore next */\n if (neg) { // for negative reverse ordering\n factor = 10 - factor;\n }\n\n var factorStr = factor.toFixed(20);\n\n // strip zeros from the end\n factorStr = factorStr.replace(/\\.?0+$/, '');\n\n result += SEP + factorStr;\n\n return result;\n}\n\n// create a comparator based on the sort object\nfunction createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare$1(aRow.doc._id, bRow.doc._id);\n };\n}\n\nfunction filterInMemoryFields(rows, requestDef, inMemoryFields) {\n rows = rows.filter(function (row) {\n return rowFilter(row.doc, requestDef.selector, inMemoryFields);\n });\n\n if (requestDef.sort) {\n // in-memory sort\n var fieldSorter = createFieldSorter(requestDef.sort);\n rows = rows.sort(fieldSorter);\n if (typeof requestDef.sort[0] !== 'string' &&\n getValue(requestDef.sort[0]) === 'desc') {\n rows = rows.reverse();\n }\n }\n\n if ('limit' in requestDef || 'skip' in requestDef) {\n // have to do the limit in-memory\n var skip = requestDef.skip || 0;\n var limit = ('limit' in requestDef ? requestDef.limit : rows.length) + skip;\n rows = rows.slice(skip, limit);\n }\n return rows;\n}\n\nfunction rowFilter(doc, selector, inMemoryFields) {\n return inMemoryFields.every(function (field) {\n var matcher = selector[field];\n var parsedField = parseField(field);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n if (isCombinationalField(field)) {\n return matchCominationalSelector(field, matcher, doc);\n }\n\n return matchSelector(matcher, doc, parsedField, docFieldValue);\n });\n}\n\nfunction matchSelector(matcher, doc, parsedField, docFieldValue) {\n if (!matcher) {\n // no filtering necessary; this field is just needed for sorting\n return true;\n }\n\n return Object.keys(matcher).every(function (userOperator) {\n var userValue = matcher[userOperator];\n return match(userOperator, doc, userValue, parsedField, docFieldValue);\n });\n}\n\nfunction matchCominationalSelector(field, matcher, doc) {\n\n if (field === '$or') {\n return matcher.some(function (orMatchers) {\n return rowFilter(doc, orMatchers, Object.keys(orMatchers));\n });\n }\n\n if (field === '$not') {\n return !rowFilter(doc, matcher, Object.keys(matcher));\n }\n\n //`$nor`\n return !matcher.find(function (orMatchers) {\n return rowFilter(doc, orMatchers, Object.keys(orMatchers));\n });\n\n}\n\nfunction match(userOperator, doc, userValue, parsedField, docFieldValue) {\n if (!matchers[userOperator]) {\n throw new Error('unknown operator \"' + userOperator +\n '\" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, ' +\n '$nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all');\n }\n return matchers[userOperator](doc, userValue, parsedField, docFieldValue);\n}\n\nfunction fieldExists(docFieldValue) {\n return typeof docFieldValue !== 'undefined' && docFieldValue !== null;\n}\n\nfunction fieldIsNotUndefined(docFieldValue) {\n return typeof docFieldValue !== 'undefined';\n}\n\nfunction modField(docFieldValue, userValue) {\n var divisor = userValue[0];\n var mod = userValue[1];\n if (divisor === 0) {\n throw new Error('Bad divisor, cannot divide by zero');\n }\n\n if (parseInt(divisor, 10) !== divisor ) {\n throw new Error('Divisor is not an integer');\n }\n\n if (parseInt(mod, 10) !== mod ) {\n throw new Error('Modulus is not an integer');\n }\n\n if (parseInt(docFieldValue, 10) !== docFieldValue) {\n return false;\n }\n\n return docFieldValue % divisor === mod;\n}\n\nfunction arrayContainsValue(docFieldValue, userValue) {\n return userValue.some(function (val) {\n if (docFieldValue instanceof Array) {\n return docFieldValue.indexOf(val) > -1;\n }\n\n return docFieldValue === val;\n });\n}\n\nfunction arrayContainsAllValues(docFieldValue, userValue) {\n return userValue.every(function (val) {\n return docFieldValue.indexOf(val) > -1;\n });\n}\n\nfunction arraySize(docFieldValue, userValue) {\n return docFieldValue.length === userValue;\n}\n\nfunction regexMatch(docFieldValue, userValue) {\n var re = new RegExp(userValue);\n\n return re.test(docFieldValue);\n}\n\nfunction typeMatch(docFieldValue, userValue) {\n\n switch (userValue) {\n case 'null':\n return docFieldValue === null;\n case 'boolean':\n return typeof (docFieldValue) === 'boolean';\n case 'number':\n return typeof (docFieldValue) === 'number';\n case 'string':\n return typeof (docFieldValue) === 'string';\n case 'array':\n return docFieldValue instanceof Array;\n case 'object':\n return ({}).toString.call(docFieldValue) === '[object Object]';\n }\n\n throw new Error(userValue + ' not supported as a type.' +\n 'Please use one of object, string, array, number, boolean or null.');\n\n}\n\nvar matchers = {\n\n '$elemMatch': function (doc, userValue, parsedField, docFieldValue) {\n if (!Array.isArray(docFieldValue)) {\n return false;\n }\n\n if (docFieldValue.length === 0) {\n return false;\n }\n\n if (typeof docFieldValue[0] === 'object') {\n return docFieldValue.some(function (val) {\n return rowFilter(val, userValue, Object.keys(userValue));\n });\n }\n\n return docFieldValue.some(function (val) {\n return matchSelector(userValue, doc, parsedField, val);\n });\n },\n\n '$allMatch': function (doc, userValue, parsedField, docFieldValue) {\n if (!Array.isArray(docFieldValue)) {\n return false;\n }\n\n /* istanbul ignore next */\n if (docFieldValue.length === 0) {\n return false;\n }\n\n if (typeof docFieldValue[0] === 'object') {\n return docFieldValue.every(function (val) {\n return rowFilter(val, userValue, Object.keys(userValue));\n });\n }\n\n return docFieldValue.every(function (val) {\n return matchSelector(userValue, doc, parsedField, val);\n });\n },\n\n '$eq': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) === 0;\n },\n\n '$gte': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) >= 0;\n },\n\n '$gt': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) > 0;\n },\n\n '$lte': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) <= 0;\n },\n\n '$lt': function (doc, userValue, parsedField, docFieldValue) {\n return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) < 0;\n },\n\n '$exists': function (doc, userValue, parsedField, docFieldValue) {\n //a field that is null is still considered to exist\n if (userValue) {\n return fieldIsNotUndefined(docFieldValue);\n }\n\n return !fieldIsNotUndefined(docFieldValue);\n },\n\n '$mod': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && modField(docFieldValue, userValue);\n },\n\n '$ne': function (doc, userValue, parsedField, docFieldValue) {\n return userValue.every(function (neValue) {\n return collate(docFieldValue, neValue) !== 0;\n });\n },\n '$in': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && arrayContainsValue(docFieldValue, userValue);\n },\n\n '$nin': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && !arrayContainsValue(docFieldValue, userValue);\n },\n\n '$size': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && arraySize(docFieldValue, userValue);\n },\n\n '$all': function (doc, userValue, parsedField, docFieldValue) {\n return Array.isArray(docFieldValue) && arrayContainsAllValues(docFieldValue, userValue);\n },\n\n '$regex': function (doc, userValue, parsedField, docFieldValue) {\n return fieldExists(docFieldValue) && regexMatch(docFieldValue, userValue);\n },\n\n '$type': function (doc, userValue, parsedField, docFieldValue) {\n return typeMatch(docFieldValue, userValue);\n }\n};\n\n// return true if the given doc matches the supplied selector\nfunction matchesSelector(doc, selector) {\n /* istanbul ignore if */\n if (typeof selector !== 'object') {\n // match the CouchDB error message\n throw new Error('Selector error: expected a JSON object');\n }\n\n selector = massageSelector(selector);\n var row = {\n 'doc': doc\n };\n\n var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector));\n return rowsMatched && rowsMatched.length === 1;\n}\n\nfunction evalFilter(input) {\n return scopeEval('\"use strict\";\\nreturn ' + input + ';', {});\n}\n\nfunction evalView(input) {\n var code = [\n 'return function(doc) {',\n ' \"use strict\";',\n ' var emitted = false;',\n ' var emit = function (a, b) {',\n ' emitted = true;',\n ' };',\n ' var view = ' + input + ';',\n ' view(doc);',\n ' if (emitted) {',\n ' return true;',\n ' }',\n '};'\n ].join('\\n');\n\n return scopeEval(code, {});\n}\n\nfunction validate(opts, callback) {\n if (opts.selector) {\n if (opts.filter && opts.filter !== '_selector') {\n var filterName = typeof opts.filter === 'string' ?\n opts.filter : 'function';\n return callback(new Error('selector invalid for filter \"' + filterName + '\"'));\n }\n }\n callback();\n}\n\nfunction normalize(opts) {\n if (opts.view && !opts.filter) {\n opts.filter = '_view';\n }\n\n if (opts.selector && !opts.filter) {\n opts.filter = '_selector';\n }\n\n if (opts.filter && typeof opts.filter === 'string') {\n if (opts.filter === '_view') {\n opts.view = normalizeDesignDocFunctionName(opts.view);\n } else {\n opts.filter = normalizeDesignDocFunctionName(opts.filter);\n }\n }\n}\n\nfunction shouldFilter(changesHandler, opts) {\n return opts.filter && typeof opts.filter === 'string' &&\n !opts.doc_ids && !isRemote(changesHandler.db);\n}\n\nfunction filter(changesHandler, opts) {\n var callback = opts.complete;\n if (opts.filter === '_view') {\n if (!opts.view || typeof opts.view !== 'string') {\n var err = createError(BAD_REQUEST,\n '`view` filter parameter not found or invalid.');\n return callback(err);\n }\n // fetch a view from a design doc, make it behave like a filter\n var viewName = parseDesignDocFunctionName(opts.view);\n changesHandler.db.get('_design/' + viewName[0], function (err, ddoc) {\n /* istanbul ignore if */\n if (changesHandler.isCancelled) {\n return callback(null, {status: 'cancelled'});\n }\n /* istanbul ignore next */\n if (err) {\n return callback(generateErrorFromResponse(err));\n }\n var mapFun = ddoc && ddoc.views && ddoc.views[viewName[1]] &&\n ddoc.views[viewName[1]].map;\n if (!mapFun) {\n return callback(createError(MISSING_DOC,\n (ddoc.views ? 'missing json key: ' + viewName[1] :\n 'missing json key: views')));\n }\n opts.filter = evalView(mapFun);\n changesHandler.doChanges(opts);\n });\n } else if (opts.selector) {\n opts.filter = function (doc) {\n return matchesSelector(doc, opts.selector);\n };\n changesHandler.doChanges(opts);\n } else {\n // fetch a filter from a design doc\n var filterName = parseDesignDocFunctionName(opts.filter);\n changesHandler.db.get('_design/' + filterName[0], function (err, ddoc) {\n /* istanbul ignore if */\n if (changesHandler.isCancelled) {\n return callback(null, {status: 'cancelled'});\n }\n /* istanbul ignore next */\n if (err) {\n return callback(generateErrorFromResponse(err));\n }\n var filterFun = ddoc && ddoc.filters && ddoc.filters[filterName[1]];\n if (!filterFun) {\n return callback(createError(MISSING_DOC,\n ((ddoc && ddoc.filters) ? 'missing json key: ' + filterName[1]\n : 'missing json key: filters')));\n }\n opts.filter = evalFilter(filterFun);\n changesHandler.doChanges(opts);\n });\n }\n}\n\nfunction applyChangesFilterPlugin(PouchDB) {\n PouchDB._changesFilterPlugin = {\n validate: validate,\n normalize: normalize,\n shouldFilter: shouldFilter,\n filter: filter\n };\n}\n\n// TODO: remove from pouchdb-core (breaking)\nPouchDB.plugin(debugPouch);\n\n// TODO: remove from pouchdb-core (breaking)\nPouchDB.plugin(applyChangesFilterPlugin);\n\nPouchDB.version = version;\n\nfunction toObject(array) {\n return array.reduce(function (obj, item) {\n obj[item] = true;\n return obj;\n }, {});\n}\n// List of top level reserved words for doc\nvar reservedWords = toObject([\n '_id',\n '_rev',\n '_attachments',\n '_deleted',\n '_revisions',\n '_revs_info',\n '_conflicts',\n '_deleted_conflicts',\n '_local_seq',\n '_rev_tree',\n //replication documents\n '_replication_id',\n '_replication_state',\n '_replication_state_time',\n '_replication_state_reason',\n '_replication_stats',\n // Specific to Couchbase Sync Gateway\n '_removed'\n]);\n\n// List of reserved words that should end up the document\nvar dataWords = toObject([\n '_attachments',\n //replication documents\n '_replication_id',\n '_replication_state',\n '_replication_state_time',\n '_replication_state_reason',\n '_replication_stats'\n]);\n\nfunction parseRevisionInfo(rev$$1) {\n if (!/^\\d+-./.test(rev$$1)) {\n return createError(INVALID_REV);\n }\n var idx = rev$$1.indexOf('-');\n var left = rev$$1.substring(0, idx);\n var right = rev$$1.substring(idx + 1);\n return {\n prefix: parseInt(left, 10),\n id: right\n };\n}\n\nfunction makeRevTreeFromRevisions(revisions, opts) {\n var pos = revisions.start - revisions.ids.length + 1;\n\n var revisionIds = revisions.ids;\n var ids = [revisionIds[0], opts, []];\n\n for (var i = 1, len = revisionIds.length; i < len; i++) {\n ids = [revisionIds[i], {status: 'missing'}, [ids]];\n }\n\n return [{\n pos: pos,\n ids: ids\n }];\n}\n\n// Preprocess documents, parse their revisions, assign an id and a\n// revision for new writes that are missing them, etc\nfunction parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = rev();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}\n\nvar thisAtob = function (str) {\n return atob(str);\n};\n\nvar thisBtoa = function (str) {\n return btoa(str);\n};\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor (e.g.\n// old QtWebKit versions, Android < 4.4).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== \"TypeError\") {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :\n typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :\n typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :\n WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction binaryStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\nfunction binStringToBluffer(binString, type) {\n return createBlob([binaryStringToArrayBuffer(binString)], {type: type});\n}\n\nfunction b64ToBluffer(b64, type) {\n return binStringToBluffer(thisAtob(b64), type);\n}\n\n//Can't find original post, but this is close\n//http://stackoverflow.com/questions/6965107/ (continues on next line)\n//converting-between-strings-and-arraybuffers\nfunction arrayBufferToBinaryString(buffer) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var length = bytes.byteLength;\n for (var i = 0; i < length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return binary;\n}\n\n// shim for browsers that don't support it\nfunction readAsBinaryString(blob, callback) {\n if (typeof FileReader === 'undefined') {\n // fix for Firefox in a web worker\n // https://bugzilla.mozilla.org/show_bug.cgi?id=901097\n return callback(arrayBufferToBinaryString(\n new FileReaderSync().readAsArrayBuffer(blob)));\n }\n\n var reader = new FileReader();\n var hasBinaryString = typeof reader.readAsBinaryString === 'function';\n reader.onloadend = function (e) {\n var result = e.target.result || '';\n if (hasBinaryString) {\n return callback(result);\n }\n callback(arrayBufferToBinaryString(result));\n };\n if (hasBinaryString) {\n reader.readAsBinaryString(blob);\n } else {\n reader.readAsArrayBuffer(blob);\n }\n}\n\nfunction blobToBinaryString(blobOrBuffer, callback) {\n readAsBinaryString(blobOrBuffer, function (bin) {\n callback(bin);\n });\n}\n\nfunction blobToBase64(blobOrBuffer, callback) {\n blobToBinaryString(blobOrBuffer, function (base64) {\n callback(thisBtoa(base64));\n });\n}\n\n// simplified API. universal browser support is assumed\nfunction readAsArrayBuffer(blob, callback) {\n if (typeof FileReader === 'undefined') {\n // fix for Firefox in a web worker:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=901097\n return callback(new FileReaderSync().readAsArrayBuffer(blob));\n }\n\n var reader = new FileReader();\n reader.onloadend = function (e) {\n var result = e.target.result || new ArrayBuffer(0);\n callback(result);\n };\n reader.readAsArrayBuffer(blob);\n}\n\n// this is not used in the browser\n\nvar setImmediateShim = global.setImmediate || global.setTimeout;\nvar MD5_CHUNK_SIZE = 32768;\n\nfunction rawToBase64(raw) {\n return thisBtoa(raw);\n}\n\nfunction sliceBlob(blob, start, end) {\n if (blob.webkitSlice) {\n return blob.webkitSlice(start, end);\n }\n return blob.slice(start, end);\n}\n\nfunction appendBlob(buffer, blob, start, end, callback) {\n if (start > 0 || end < blob.size) {\n // only slice blob if we really need to\n blob = sliceBlob(blob, start, end);\n }\n readAsArrayBuffer(blob, function (arrayBuffer) {\n buffer.append(arrayBuffer);\n callback();\n });\n}\n\nfunction appendString(buffer, string, start, end, callback) {\n if (start > 0 || end < string.length) {\n // only create a substring if we really need to\n string = string.substring(start, end);\n }\n buffer.appendBinary(string);\n callback();\n}\n\nfunction binaryMd5(data, callback) {\n var inputIsString = typeof data === 'string';\n var len = inputIsString ? data.length : data.size;\n var chunkSize = Math.min(MD5_CHUNK_SIZE, len);\n var chunks = Math.ceil(len / chunkSize);\n var currentChunk = 0;\n var buffer = inputIsString ? new Md5() : new Md5.ArrayBuffer();\n\n var append = inputIsString ? appendString : appendBlob;\n\n function next() {\n setImmediateShim(loadNextChunk);\n }\n\n function done() {\n var raw = buffer.end(true);\n var base64 = rawToBase64(raw);\n callback(base64);\n buffer.destroy();\n }\n\n function loadNextChunk() {\n var start = currentChunk * chunkSize;\n var end = start + chunkSize;\n currentChunk++;\n if (currentChunk < chunks) {\n append(buffer, data, start, end, next);\n } else {\n append(buffer, data, start, end, done);\n }\n }\n loadNextChunk();\n}\n\nfunction stringMd5(string) {\n return Md5.hash(string);\n}\n\nfunction parseBase64(data) {\n try {\n return thisAtob(data);\n } catch (e) {\n var err = createError(BAD_ARG,\n 'Attachment is not a valid base64 string');\n return {error: err};\n }\n}\n\nfunction preprocessString(att, blobType, callback) {\n var asBinary = parseBase64(att.data);\n if (asBinary.error) {\n return callback(asBinary.error);\n }\n\n att.length = asBinary.length;\n if (blobType === 'blob') {\n att.data = binStringToBluffer(asBinary, att.content_type);\n } else if (blobType === 'base64') {\n att.data = thisBtoa(asBinary);\n } else { // binary\n att.data = asBinary;\n }\n binaryMd5(asBinary, function (result) {\n att.digest = 'md5-' + result;\n callback();\n });\n}\n\nfunction preprocessBlob(att, blobType, callback) {\n binaryMd5(att.data, function (md5) {\n att.digest = 'md5-' + md5;\n // size is for blobs (browser), length is for buffers (node)\n att.length = att.data.size || att.data.length || 0;\n if (blobType === 'binary') {\n blobToBinaryString(att.data, function (binString) {\n att.data = binString;\n callback();\n });\n } else if (blobType === 'base64') {\n blobToBase64(att.data, function (b64) {\n att.data = b64;\n callback();\n });\n } else {\n callback();\n }\n });\n}\n\nfunction preprocessAttachment(att, blobType, callback) {\n if (att.stub) {\n return callback();\n }\n if (typeof att.data === 'string') { // input is a base64 string\n preprocessString(att, blobType, callback);\n } else { // input is a blob\n preprocessBlob(att, blobType, callback);\n }\n}\n\nfunction preprocessAttachments(docInfos, blobType, callback) {\n\n if (!docInfos.length) {\n return callback();\n }\n\n var docv = 0;\n var overallErr;\n\n docInfos.forEach(function (docInfo) {\n var attachments = docInfo.data && docInfo.data._attachments ?\n Object.keys(docInfo.data._attachments) : [];\n var recv = 0;\n\n if (!attachments.length) {\n return done();\n }\n\n function processedAttachment(err) {\n overallErr = err;\n recv++;\n if (recv === attachments.length) {\n done();\n }\n }\n\n for (var key in docInfo.data._attachments) {\n if (docInfo.data._attachments.hasOwnProperty(key)) {\n preprocessAttachment(docInfo.data._attachments[key],\n blobType, processedAttachment);\n }\n }\n });\n\n function done() {\n docv++;\n if (docInfos.length === docv) {\n if (overallErr) {\n callback(overallErr);\n } else {\n callback();\n }\n }\n }\n}\n\nfunction updateDoc(revLimit, prev, docInfo, results,\n i, cb, writeDoc, newEdits) {\n\n if (revExists(prev.rev_tree, docInfo.metadata.rev)) {\n results[i] = docInfo;\n return cb();\n }\n\n // sometimes this is pre-calculated. historically not always\n var previousWinningRev = prev.winningRev || winningRev(prev);\n var previouslyDeleted = 'deleted' in prev ? prev.deleted :\n isDeleted(prev, previousWinningRev);\n var deleted = 'deleted' in docInfo.metadata ? docInfo.metadata.deleted :\n isDeleted(docInfo.metadata);\n var isRoot = /^1-/.test(docInfo.metadata.rev);\n\n if (previouslyDeleted && !deleted && newEdits && isRoot) {\n var newDoc = docInfo.data;\n newDoc._rev = previousWinningRev;\n newDoc._id = docInfo.metadata.id;\n docInfo = parseDoc(newDoc, newEdits);\n }\n\n var merged = merge(prev.rev_tree, docInfo.metadata.rev_tree[0], revLimit);\n\n var inConflict = newEdits && ((\n (previouslyDeleted && deleted && merged.conflicts !== 'new_leaf') ||\n (!previouslyDeleted && merged.conflicts !== 'new_leaf') ||\n (previouslyDeleted && !deleted && merged.conflicts === 'new_branch')));\n\n if (inConflict) {\n var err = createError(REV_CONFLICT);\n results[i] = err;\n return cb();\n }\n\n var newRev = docInfo.metadata.rev;\n docInfo.metadata.rev_tree = merged.tree;\n docInfo.stemmedRevs = merged.stemmedRevs || [];\n /* istanbul ignore else */\n if (prev.rev_map) {\n docInfo.metadata.rev_map = prev.rev_map; // used only by leveldb\n }\n\n // recalculate\n var winningRev$$1 = winningRev(docInfo.metadata);\n var winningRevIsDeleted = isDeleted(docInfo.metadata, winningRev$$1);\n\n // calculate the total number of documents that were added/removed,\n // from the perspective of total_rows/doc_count\n var delta = (previouslyDeleted === winningRevIsDeleted) ? 0 :\n previouslyDeleted < winningRevIsDeleted ? -1 : 1;\n\n var newRevIsDeleted;\n if (newRev === winningRev$$1) {\n // if the new rev is the same as the winning rev, we can reuse that value\n newRevIsDeleted = winningRevIsDeleted;\n } else {\n // if they're not the same, then we need to recalculate\n newRevIsDeleted = isDeleted(docInfo.metadata, newRev);\n }\n\n writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted,\n true, delta, i, cb);\n}\n\nfunction rootIsMissing(docInfo) {\n return docInfo.metadata.rev_tree[0].ids[1].status === 'missing';\n}\n\nfunction processDocs(revLimit, docInfos, api, fetchedDocs, tx, results,\n writeDoc, opts, overallCallback) {\n\n // Default to 1000 locally\n revLimit = revLimit || 1000;\n\n function insertDoc(docInfo, resultsIdx, callback) {\n // Cant insert new deleted documents\n var winningRev$$1 = winningRev(docInfo.metadata);\n var deleted = isDeleted(docInfo.metadata, winningRev$$1);\n if ('was_delete' in opts && deleted) {\n results[resultsIdx] = createError(MISSING_DOC, 'deleted');\n return callback();\n }\n\n // 4712 - detect whether a new document was inserted with a _rev\n var inConflict = newEdits && rootIsMissing(docInfo);\n\n if (inConflict) {\n var err = createError(REV_CONFLICT);\n results[resultsIdx] = err;\n return callback();\n }\n\n var delta = deleted ? 0 : 1;\n\n writeDoc(docInfo, winningRev$$1, deleted, deleted, false,\n delta, resultsIdx, callback);\n }\n\n var newEdits = opts.new_edits;\n var idsToDocs = new ExportedMap();\n\n var docsDone = 0;\n var docsToDo = docInfos.length;\n\n function checkAllDocsDone() {\n if (++docsDone === docsToDo && overallCallback) {\n overallCallback();\n }\n }\n\n docInfos.forEach(function (currentDoc, resultsIdx) {\n\n if (currentDoc._id && isLocalId(currentDoc._id)) {\n var fun = currentDoc._deleted ? '_removeLocal' : '_putLocal';\n api[fun](currentDoc, {ctx: tx}, function (err, res) {\n results[resultsIdx] = err || res;\n checkAllDocsDone();\n });\n return;\n }\n\n var id = currentDoc.metadata.id;\n if (idsToDocs.has(id)) {\n docsToDo--; // duplicate\n idsToDocs.get(id).push([currentDoc, resultsIdx]);\n } else {\n idsToDocs.set(id, [[currentDoc, resultsIdx]]);\n }\n });\n\n // in the case of new_edits, the user can provide multiple docs\n // with the same id. these need to be processed sequentially\n idsToDocs.forEach(function (docs, id) {\n var numDone = 0;\n\n function docWritten() {\n if (++numDone < docs.length) {\n nextDoc();\n } else {\n checkAllDocsDone();\n }\n }\n function nextDoc() {\n var value = docs[numDone];\n var currentDoc = value[0];\n var resultsIdx = value[1];\n\n if (fetchedDocs.has(id)) {\n updateDoc(revLimit, fetchedDocs.get(id), currentDoc, results,\n resultsIdx, docWritten, writeDoc, newEdits);\n } else {\n // Ensure stemming applies to new writes as well\n var merged = merge([], currentDoc.metadata.rev_tree[0], revLimit);\n currentDoc.metadata.rev_tree = merged.tree;\n currentDoc.stemmedRevs = merged.stemmedRevs || [];\n insertDoc(currentDoc, resultsIdx, docWritten);\n }\n }\n nextDoc();\n });\n}\n\n// IndexedDB requires a versioned database structure, so we use the\n// version here to manage migrations.\nvar ADAPTER_VERSION = 5;\n\n// The object stores created for each database\n// DOC_STORE stores the document meta data, its revision history and state\n// Keyed by document id\nvar DOC_STORE = 'document-store';\n// BY_SEQ_STORE stores a particular version of a document, keyed by its\n// sequence id\nvar BY_SEQ_STORE = 'by-sequence';\n// Where we store attachments\nvar ATTACH_STORE = 'attach-store';\n// Where we store many-to-many relations\n// between attachment digests and seqs\nvar ATTACH_AND_SEQ_STORE = 'attach-seq-store';\n\n// Where we store database-wide meta data in a single record\n// keyed by id: META_STORE\nvar META_STORE = 'meta-store';\n// Where we store local documents\nvar LOCAL_STORE = 'local-store';\n// Where we detect blob support\nvar DETECT_BLOB_SUPPORT_STORE = 'detect-blob-support';\n\nfunction safeJsonParse(str) {\n // This try/catch guards against stack overflow errors.\n // JSON.parse() is faster than vuvuzela.parse() but vuvuzela\n // cannot overflow.\n try {\n return JSON.parse(str);\n } catch (e) {\n /* istanbul ignore next */\n return vuvuzela.parse(str);\n }\n}\n\nfunction safeJsonStringify(json) {\n try {\n return JSON.stringify(json);\n } catch (e) {\n /* istanbul ignore next */\n return vuvuzela.stringify(json);\n }\n}\n\nfunction idbError(callback) {\n return function (evt) {\n var message = 'unknown_error';\n if (evt.target && evt.target.error) {\n message = evt.target.error.name || evt.target.error.message;\n }\n callback(createError(IDB_ERROR, message, evt.type));\n };\n}\n\n// Unfortunately, the metadata has to be stringified\n// when it is put into the database, because otherwise\n// IndexedDB can throw errors for deeply-nested objects.\n// Originally we just used JSON.parse/JSON.stringify; now\n// we use this custom vuvuzela library that avoids recursion.\n// If we could do it all over again, we'd probably use a\n// format for the revision trees other than JSON.\nfunction encodeMetadata(metadata, winningRev, deleted) {\n return {\n data: safeJsonStringify(metadata),\n winningRev: winningRev,\n deletedOrLocal: deleted ? '1' : '0',\n seq: metadata.seq, // highest seq for this doc\n id: metadata.id\n };\n}\n\nfunction decodeMetadata(storedObject) {\n if (!storedObject) {\n return null;\n }\n var metadata = safeJsonParse(storedObject.data);\n metadata.winningRev = storedObject.winningRev;\n metadata.deleted = storedObject.deletedOrLocal === '1';\n metadata.seq = storedObject.seq;\n return metadata;\n}\n\n// read the doc back out from the database. we don't store the\n// _id or _rev because we already have _doc_id_rev.\nfunction decodeDoc(doc) {\n if (!doc) {\n return doc;\n }\n var idx = doc._doc_id_rev.lastIndexOf(':');\n doc._id = doc._doc_id_rev.substring(0, idx - 1);\n doc._rev = doc._doc_id_rev.substring(idx + 1);\n delete doc._doc_id_rev;\n return doc;\n}\n\n// Read a blob from the database, encoding as necessary\n// and translating from base64 if the IDB doesn't support\n// native Blobs\nfunction readBlobData(body, type, asBlob, callback) {\n if (asBlob) {\n if (!body) {\n callback(createBlob([''], {type: type}));\n } else if (typeof body !== 'string') { // we have blob support\n callback(body);\n } else { // no blob support\n callback(b64ToBluffer(body, type));\n }\n } else { // as base64 string\n if (!body) {\n callback('');\n } else if (typeof body !== 'string') { // we have blob support\n readAsBinaryString(body, function (binary) {\n callback(thisBtoa(binary));\n });\n } else { // no blob support\n callback(body);\n }\n }\n}\n\nfunction fetchAttachmentsIfNecessary(doc, opts, txn, cb) {\n var attachments = Object.keys(doc._attachments || {});\n if (!attachments.length) {\n return cb && cb();\n }\n var numDone = 0;\n\n function checkDone() {\n if (++numDone === attachments.length && cb) {\n cb();\n }\n }\n\n function fetchAttachment(doc, att) {\n var attObj = doc._attachments[att];\n var digest = attObj.digest;\n var req = txn.objectStore(ATTACH_STORE).get(digest);\n req.onsuccess = function (e) {\n attObj.body = e.target.result.body;\n checkDone();\n };\n }\n\n attachments.forEach(function (att) {\n if (opts.attachments && opts.include_docs) {\n fetchAttachment(doc, att);\n } else {\n doc._attachments[att].stub = true;\n checkDone();\n }\n });\n}\n\n// IDB-specific postprocessing necessary because\n// we don't know whether we stored a true Blob or\n// a base64-encoded string, and if it's a Blob it\n// needs to be read outside of the transaction context\nfunction postProcessAttachments(results, asBlob) {\n return PouchPromise.all(results.map(function (row) {\n if (row.doc && row.doc._attachments) {\n var attNames = Object.keys(row.doc._attachments);\n return PouchPromise.all(attNames.map(function (att) {\n var attObj = row.doc._attachments[att];\n if (!('body' in attObj)) { // already processed\n return;\n }\n var body = attObj.body;\n var type = attObj.content_type;\n return new PouchPromise(function (resolve) {\n readBlobData(body, type, asBlob, function (data) {\n row.doc._attachments[att] = $inject_Object_assign(\n pick(attObj, ['digest', 'content_type']),\n {data: data}\n );\n resolve();\n });\n });\n }));\n }\n }));\n}\n\nfunction compactRevs(revs, docId, txn) {\n\n var possiblyOrphanedDigests = [];\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n var attStore = txn.objectStore(ATTACH_STORE);\n var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE);\n var count = revs.length;\n\n function checkDone() {\n count--;\n if (!count) { // done processing all revs\n deleteOrphanedAttachments();\n }\n }\n\n function deleteOrphanedAttachments() {\n if (!possiblyOrphanedDigests.length) {\n return;\n }\n possiblyOrphanedDigests.forEach(function (digest) {\n var countReq = attAndSeqStore.index('digestSeq').count(\n IDBKeyRange.bound(\n digest + '::', digest + '::\\uffff', false, false));\n countReq.onsuccess = function (e) {\n var count = e.target.result;\n if (!count) {\n // orphaned\n attStore[\"delete\"](digest);\n }\n };\n });\n }\n\n revs.forEach(function (rev$$1) {\n var index = seqStore.index('_doc_id_rev');\n var key = docId + \"::\" + rev$$1;\n index.getKey(key).onsuccess = function (e) {\n var seq = e.target.result;\n if (typeof seq !== 'number') {\n return checkDone();\n }\n seqStore[\"delete\"](seq);\n\n var cursor = attAndSeqStore.index('seq')\n .openCursor(IDBKeyRange.only(seq));\n\n cursor.onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n var digest = cursor.value.digestSeq.split('::')[0];\n possiblyOrphanedDigests.push(digest);\n attAndSeqStore[\"delete\"](cursor.primaryKey);\n cursor[\"continue\"]();\n } else { // done\n checkDone();\n }\n };\n };\n });\n}\n\nfunction openTransactionSafely(idb, stores, mode) {\n try {\n return {\n txn: idb.transaction(stores, mode)\n };\n } catch (err) {\n return {\n error: err\n };\n }\n}\n\nvar changesHandler$$1 = new Changes();\n\nfunction idbBulkDocs(dbOpts, req, opts, api, idb, callback) {\n var docInfos = req.docs;\n var txn;\n var docStore;\n var bySeqStore;\n var attachStore;\n var attachAndSeqStore;\n var metaStore;\n var docInfoError;\n var metaDoc;\n\n for (var i = 0, len = docInfos.length; i < len; i++) {\n var doc = docInfos[i];\n if (doc._id && isLocalId(doc._id)) {\n continue;\n }\n doc = docInfos[i] = parseDoc(doc, opts.new_edits);\n if (doc.error && !docInfoError) {\n docInfoError = doc;\n }\n }\n\n if (docInfoError) {\n return callback(docInfoError);\n }\n\n var allDocsProcessed = false;\n var docCountDelta = 0;\n var results = new Array(docInfos.length);\n var fetchedDocs = new ExportedMap();\n var preconditionErrored = false;\n var blobType = api._meta.blobSupport ? 'blob' : 'base64';\n\n preprocessAttachments(docInfos, blobType, function (err) {\n if (err) {\n return callback(err);\n }\n startTransaction();\n });\n\n function startTransaction() {\n\n var stores = [\n DOC_STORE, BY_SEQ_STORE,\n ATTACH_STORE,\n LOCAL_STORE, ATTACH_AND_SEQ_STORE,\n META_STORE\n ];\n var txnResult = openTransactionSafely(idb, stores, 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n txn = txnResult.txn;\n txn.onabort = idbError(callback);\n txn.ontimeout = idbError(callback);\n txn.oncomplete = complete;\n docStore = txn.objectStore(DOC_STORE);\n bySeqStore = txn.objectStore(BY_SEQ_STORE);\n attachStore = txn.objectStore(ATTACH_STORE);\n attachAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE);\n metaStore = txn.objectStore(META_STORE);\n\n metaStore.get(META_STORE).onsuccess = function (e) {\n metaDoc = e.target.result;\n updateDocCountIfReady();\n };\n\n verifyAttachments(function (err) {\n if (err) {\n preconditionErrored = true;\n return callback(err);\n }\n fetchExistingDocs();\n });\n }\n\n function onAllDocsProcessed() {\n allDocsProcessed = true;\n updateDocCountIfReady();\n }\n\n function idbProcessDocs() {\n processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs,\n txn, results, writeDoc, opts, onAllDocsProcessed);\n }\n\n function updateDocCountIfReady() {\n if (!metaDoc || !allDocsProcessed) {\n return;\n }\n // caching the docCount saves a lot of time in allDocs() and\n // info(), which is why we go to all the trouble of doing this\n metaDoc.docCount += docCountDelta;\n metaStore.put(metaDoc);\n }\n\n function fetchExistingDocs() {\n\n if (!docInfos.length) {\n return;\n }\n\n var numFetched = 0;\n\n function checkDone() {\n if (++numFetched === docInfos.length) {\n idbProcessDocs();\n }\n }\n\n function readMetadata(event) {\n var metadata = decodeMetadata(event.target.result);\n\n if (metadata) {\n fetchedDocs.set(metadata.id, metadata);\n }\n checkDone();\n }\n\n for (var i = 0, len = docInfos.length; i < len; i++) {\n var docInfo = docInfos[i];\n if (docInfo._id && isLocalId(docInfo._id)) {\n checkDone(); // skip local docs\n continue;\n }\n var req = docStore.get(docInfo.metadata.id);\n req.onsuccess = readMetadata;\n }\n }\n\n function complete() {\n if (preconditionErrored) {\n return;\n }\n\n changesHandler$$1.notify(api._meta.name);\n callback(null, results);\n }\n\n function verifyAttachment(digest, callback) {\n\n var req = attachStore.get(digest);\n req.onsuccess = function (e) {\n if (!e.target.result) {\n var err = createError(MISSING_STUB,\n 'unknown stub attachment with digest ' +\n digest);\n err.status = 412;\n callback(err);\n } else {\n callback();\n }\n };\n }\n\n function verifyAttachments(finish) {\n\n\n var digests = [];\n docInfos.forEach(function (docInfo) {\n if (docInfo.data && docInfo.data._attachments) {\n Object.keys(docInfo.data._attachments).forEach(function (filename) {\n var att = docInfo.data._attachments[filename];\n if (att.stub) {\n digests.push(att.digest);\n }\n });\n }\n });\n if (!digests.length) {\n return finish();\n }\n var numDone = 0;\n var err;\n\n function checkDone() {\n if (++numDone === digests.length) {\n finish(err);\n }\n }\n digests.forEach(function (digest) {\n verifyAttachment(digest, function (attErr) {\n if (attErr && !err) {\n err = attErr;\n }\n checkDone();\n });\n });\n }\n\n function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted,\n isUpdate, delta, resultsIdx, callback) {\n\n docInfo.metadata.winningRev = winningRev$$1;\n docInfo.metadata.deleted = winningRevIsDeleted;\n\n var doc = docInfo.data;\n doc._id = docInfo.metadata.id;\n doc._rev = docInfo.metadata.rev;\n\n if (newRevIsDeleted) {\n doc._deleted = true;\n }\n\n var hasAttachments = doc._attachments &&\n Object.keys(doc._attachments).length;\n if (hasAttachments) {\n return writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback);\n }\n\n docCountDelta += delta;\n updateDocCountIfReady();\n\n finishDoc(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback);\n }\n\n function finishDoc(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback) {\n\n var doc = docInfo.data;\n var metadata = docInfo.metadata;\n\n doc._doc_id_rev = metadata.id + '::' + metadata.rev;\n delete doc._id;\n delete doc._rev;\n\n function afterPutDoc(e) {\n var revsToDelete = docInfo.stemmedRevs || [];\n\n if (isUpdate && api.auto_compaction) {\n revsToDelete = revsToDelete.concat(compactTree(docInfo.metadata));\n }\n\n if (revsToDelete && revsToDelete.length) {\n compactRevs(revsToDelete, docInfo.metadata.id, txn);\n }\n\n metadata.seq = e.target.result;\n // Current _rev is calculated from _rev_tree on read\n // delete metadata.rev;\n var metadataToStore = encodeMetadata(metadata, winningRev$$1,\n winningRevIsDeleted);\n var metaDataReq = docStore.put(metadataToStore);\n metaDataReq.onsuccess = afterPutMetadata;\n }\n\n function afterPutDocError(e) {\n // ConstraintError, need to update, not put (see #1638 for details)\n e.preventDefault(); // avoid transaction abort\n e.stopPropagation(); // avoid transaction onerror\n var index = bySeqStore.index('_doc_id_rev');\n var getKeyReq = index.getKey(doc._doc_id_rev);\n getKeyReq.onsuccess = function (e) {\n var putReq = bySeqStore.put(doc, e.target.result);\n putReq.onsuccess = afterPutDoc;\n };\n }\n\n function afterPutMetadata() {\n results[resultsIdx] = {\n ok: true,\n id: metadata.id,\n rev: metadata.rev\n };\n fetchedDocs.set(docInfo.metadata.id, docInfo.metadata);\n insertAttachmentMappings(docInfo, metadata.seq, callback);\n }\n\n var putReq = bySeqStore.put(doc);\n\n putReq.onsuccess = afterPutDoc;\n putReq.onerror = afterPutDocError;\n }\n\n function writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback) {\n\n\n var doc = docInfo.data;\n\n var numDone = 0;\n var attachments = Object.keys(doc._attachments);\n\n function collectResults() {\n if (numDone === attachments.length) {\n finishDoc(docInfo, winningRev$$1, winningRevIsDeleted,\n isUpdate, resultsIdx, callback);\n }\n }\n\n function attachmentSaved() {\n numDone++;\n collectResults();\n }\n\n attachments.forEach(function (key) {\n var att = docInfo.data._attachments[key];\n if (!att.stub) {\n var data = att.data;\n delete att.data;\n att.revpos = parseInt(winningRev$$1, 10);\n var digest = att.digest;\n saveAttachment(digest, data, attachmentSaved);\n } else {\n numDone++;\n collectResults();\n }\n });\n }\n\n // map seqs to attachment digests, which\n // we will need later during compaction\n function insertAttachmentMappings(docInfo, seq, callback) {\n\n var attsAdded = 0;\n var attsToAdd = Object.keys(docInfo.data._attachments || {});\n\n if (!attsToAdd.length) {\n return callback();\n }\n\n function checkDone() {\n if (++attsAdded === attsToAdd.length) {\n callback();\n }\n }\n\n function add(att) {\n var digest = docInfo.data._attachments[att].digest;\n var req = attachAndSeqStore.put({\n seq: seq,\n digestSeq: digest + '::' + seq\n });\n\n req.onsuccess = checkDone;\n req.onerror = function (e) {\n // this callback is for a constaint error, which we ignore\n // because this docid/rev has already been associated with\n // the digest (e.g. when new_edits == false)\n e.preventDefault(); // avoid transaction abort\n e.stopPropagation(); // avoid transaction onerror\n checkDone();\n };\n }\n for (var i = 0; i < attsToAdd.length; i++) {\n add(attsToAdd[i]); // do in parallel\n }\n }\n\n function saveAttachment(digest, data, callback) {\n\n\n var getKeyReq = attachStore.count(digest);\n getKeyReq.onsuccess = function (e) {\n var count = e.target.result;\n if (count) {\n return callback(); // already exists\n }\n var newAtt = {\n digest: digest,\n body: data\n };\n var putReq = attachStore.put(newAtt);\n putReq.onsuccess = callback;\n };\n }\n}\n\n// Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations\n// while falling back to a normal IDBCursor operation on browsers that don't support getAll() or\n// getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because\n// we're not processing each document one-at-a-time.\nfunction runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited,\n // not really clear the user wants a batched approach where the entire DB is read into memory,\n // perhaps they are filtering on a per-doc basis)\n // 3) descending no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n}\n\n// simple shim for objectStore.getAll(), falling back to IDBCursor\nfunction getAll(objectStore, keyRange, onSuccess) {\n if (typeof objectStore.getAll === 'function') {\n // use native getAll\n objectStore.getAll(keyRange).onsuccess = onSuccess;\n return;\n }\n // fall back to cursors\n var values = [];\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (cursor) {\n values.push(cursor.value);\n cursor[\"continue\"]();\n } else {\n onSuccess({\n target: {\n result: values\n }\n });\n }\n }\n\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n}\n\nfunction allDocsKeys(keys, docStore, onBatch) {\n // It's not guaranted to be returned in right order \n var valuesBatch = [];\n var count = 0;\n keys.forEach(function (key, index) {\n docStore.get(key).onsuccess = function (event) {\n if (event.target.result) {\n valuesBatch[index] = event.target.result;\n } else {\n valuesBatch[index] = {key: key, error: 'not_found'};\n }\n count++;\n if (count === keys.length) {\n onBatch(keys, valuesBatch, {});\n }\n };\n });\n}\n\nfunction createKeyRange(start, end, inclusiveEnd, key, descending) {\n try {\n if (start && end) {\n if (descending) {\n return IDBKeyRange.bound(end, start, !inclusiveEnd, false);\n } else {\n return IDBKeyRange.bound(start, end, false, !inclusiveEnd);\n }\n } else if (start) {\n if (descending) {\n return IDBKeyRange.upperBound(start);\n } else {\n return IDBKeyRange.lowerBound(start);\n }\n } else if (end) {\n if (descending) {\n return IDBKeyRange.lowerBound(end, !inclusiveEnd);\n } else {\n return IDBKeyRange.upperBound(end, !inclusiveEnd);\n }\n } else if (key) {\n return IDBKeyRange.only(key);\n }\n } catch (e) {\n return {error: e};\n }\n return null;\n}\n\nfunction idbAllDocs(opts, idb, callback) {\n var start = 'startkey' in opts ? opts.startkey : false;\n var end = 'endkey' in opts ? opts.endkey : false;\n var key = 'key' in opts ? opts.key : false;\n var keys = 'keys' in opts ? opts.keys : false; \n var skip = opts.skip || 0;\n var limit = typeof opts.limit === 'number' ? opts.limit : -1;\n var inclusiveEnd = opts.inclusive_end !== false;\n\n var keyRange; \n var keyRangeError;\n if (!keys) {\n keyRange = createKeyRange(start, end, inclusiveEnd, key, opts.descending);\n keyRangeError = keyRange && keyRange.error;\n if (keyRangeError && \n !(keyRangeError.name === \"DataError\" && keyRangeError.code === 0)) {\n // DataError with error code 0 indicates start is less than end, so\n // can just do an empty query. Else need to throw\n return callback(createError(IDB_ERROR,\n keyRangeError.name, keyRangeError.message));\n }\n }\n\n var stores = [DOC_STORE, BY_SEQ_STORE, META_STORE];\n\n if (opts.attachments) {\n stores.push(ATTACH_STORE);\n }\n var txnResult = openTransactionSafely(idb, stores, 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n txn.oncomplete = onTxnComplete;\n txn.onabort = idbError(callback);\n var docStore = txn.objectStore(DOC_STORE);\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n var metaStore = txn.objectStore(META_STORE);\n var docIdRevIndex = seqStore.index('_doc_id_rev');\n var results = [];\n var docCount;\n var updateSeq;\n\n metaStore.get(META_STORE).onsuccess = function (e) {\n docCount = e.target.result.docCount;\n };\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n getMaxUpdateSeq(seqStore, function (e) { \n if (e.target.result && e.target.result.length > 0) {\n updateSeq = e.target.result[0];\n }\n });\n }\n\n function getMaxUpdateSeq(objectStore, onSuccess) {\n function onCursor(e) {\n var cursor = e.target.result;\n var maxKey = undefined;\n if (cursor && cursor.key) {\n maxKey = cursor.key;\n } \n return onSuccess({\n target: {\n result: [maxKey]\n }\n });\n }\n objectStore.openCursor(null, 'prev').onsuccess = onCursor;\n }\n\n // if the user specifies include_docs=true, then we don't\n // want to block the main cursor while we're fetching the doc\n function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }\n\n function allDocsInner(winningRev$$1, metadata) {\n var row = {\n id: metadata.id,\n key: metadata.id,\n value: {\n rev: winningRev$$1\n }\n };\n var deleted = metadata.deleted;\n if (deleted) {\n if (keys) {\n results.push(row);\n // deleted docs are okay with \"keys\" requests\n row.value.deleted = true;\n row.doc = null;\n }\n } else if (skip-- <= 0) {\n results.push(row);\n if (opts.include_docs) {\n fetchDocAsynchronously(metadata, row, winningRev$$1);\n }\n }\n }\n\n function processBatch(batchValues) {\n for (var i = 0, len = batchValues.length; i < len; i++) {\n if (results.length === limit) {\n break;\n }\n var batchValue = batchValues[i];\n if (batchValue.error && keys) {\n // key was not found with \"keys\" requests\n results.push(batchValue);\n continue;\n }\n var metadata = decodeMetadata(batchValue);\n var winningRev$$1 = metadata.winningRev;\n allDocsInner(winningRev$$1, metadata);\n }\n }\n\n function onBatch(batchKeys, batchValues, cursor) {\n if (!cursor) {\n return;\n }\n processBatch(batchValues);\n if (results.length < limit) {\n cursor[\"continue\"]();\n }\n }\n\n function onGetAll(e) {\n var values = e.target.result;\n if (opts.descending) {\n values = values.reverse();\n }\n processBatch(values);\n }\n\n function onResultsReady() {\n var returnVal = {\n total_rows: docCount,\n offset: opts.skip,\n rows: results\n };\n \n /* istanbul ignore if */\n if (opts.update_seq && updateSeq !== undefined) {\n returnVal.update_seq = updateSeq;\n }\n callback(null, returnVal);\n }\n\n function onTxnComplete() {\n if (opts.attachments) {\n postProcessAttachments(results, opts.binary).then(onResultsReady);\n } else {\n onResultsReady();\n }\n }\n\n // don't bother doing any requests if start > end or limit === 0\n if (keyRangeError || limit === 0) {\n return;\n }\n if (keys) {\n return allDocsKeys(opts.keys, docStore, onBatch);\n }\n if (limit === -1) { // just fetch everything\n return getAll(docStore, keyRange, onGetAll);\n }\n // else do a cursor\n // choose a batch size based on the skip, since we'll need to skip that many\n runBatchedCursor(docStore, keyRange, opts.descending, limit + skip, onBatch);\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\nfunction checkBlobSupport(txn) {\n return new PouchPromise(function (resolve) {\n var blob$$1 = createBlob(['']);\n var req = txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob$$1, 'key');\n\n req.onsuccess = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome ||\n parseInt(matchedChrome[1], 10) >= 43);\n };\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction countDocs(txn, cb) {\n var index = txn.objectStore(DOC_STORE).index('deletedOrLocal');\n index.count(IDBKeyRange.only('0')).onsuccess = function (e) {\n cb(e.target.result);\n };\n}\n\n// This task queue ensures that IDB open calls are done in their own tick\n// and sequentially - i.e. we wait for the async IDB open to *fully* complete\n// before calling the next one. This works around IE/Edge race conditions in IDB.\n\nvar running = false;\nvar queue = [];\n\nfunction tryCode(fun, err, res, PouchDB) {\n try {\n fun(err, res);\n } catch (err) {\n // Shouldn't happen, but in some odd cases\n // IndexedDB implementations might throw a sync\n // error, in which case this will at least log it.\n PouchDB.emit('error', err);\n }\n}\n\nfunction applyNext() {\n if (running || !queue.length) {\n return;\n }\n running = true;\n queue.shift()();\n}\n\nfunction enqueueTask(action, callback, PouchDB) {\n queue.push(function runAction() {\n action(function runCallback(err, res) {\n tryCode(callback, err, res, PouchDB);\n running = false;\n nextTick(function runNext() {\n applyNext(PouchDB);\n });\n });\n });\n applyNext();\n}\n\nfunction changes(opts, api, dbName, idb) {\n opts = clone(opts);\n\n if (opts.continuous) {\n var id = dbName + ':' + uuid();\n changesHandler$$1.addListener(dbName, id, api, opts);\n changesHandler$$1.notify(dbName);\n return {\n cancel: function () {\n changesHandler$$1.removeListener(dbName, id);\n }\n };\n }\n\n var docIds = opts.doc_ids && new ExportedSet(opts.doc_ids);\n\n opts.since = opts.since || 0;\n var lastSeq = opts.since;\n\n var limit = 'limit' in opts ? opts.limit : -1;\n if (limit === 0) {\n limit = 1; // per CouchDB _changes spec\n }\n var returnDocs;\n if ('return_docs' in opts) {\n returnDocs = opts.return_docs;\n } else if ('returnDocs' in opts) {\n // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release\n returnDocs = opts.returnDocs;\n } else {\n returnDocs = true;\n }\n\n var results = [];\n var numResults = 0;\n var filter = filterChange(opts);\n var docIdsToMetadata = new ExportedMap();\n\n var txn;\n var bySeqStore;\n var docStore;\n var docIdRevIndex;\n\n function onBatch(batchKeys, batchValues, cursor) {\n if (!cursor || !batchKeys.length) { // done\n return;\n }\n\n var winningDocs = new Array(batchKeys.length);\n var metadatas = new Array(batchKeys.length);\n\n function processMetadataAndWinningDoc(metadata, winningDoc) {\n var change = opts.processChange(winningDoc, metadata, opts);\n lastSeq = change.seq = metadata.seq;\n\n var filtered = filter(change);\n if (typeof filtered === 'object') { // anything but true/false indicates error\n return opts.complete(filtered);\n }\n\n if (filtered) {\n numResults++;\n if (returnDocs) {\n results.push(change);\n }\n // process the attachment immediately\n // for the benefit of live listeners\n if (opts.attachments && opts.include_docs) {\n fetchAttachmentsIfNecessary(winningDoc, opts, txn, function () {\n postProcessAttachments([change], opts.binary).then(function () {\n opts.onChange(change);\n });\n });\n } else {\n opts.onChange(change);\n }\n }\n }\n\n function onBatchDone() {\n for (var i = 0, len = winningDocs.length; i < len; i++) {\n if (numResults === limit) {\n break;\n }\n var winningDoc = winningDocs[i];\n if (!winningDoc) {\n continue;\n }\n var metadata = metadatas[i];\n processMetadataAndWinningDoc(metadata, winningDoc);\n }\n\n if (numResults !== limit) {\n cursor[\"continue\"]();\n }\n }\n\n // Fetch all metadatas/winningdocs from this batch in parallel, then process\n // them all only once all data has been collected. This is done in parallel\n // because it's faster than doing it one-at-a-time.\n var numDone = 0;\n batchValues.forEach(function (value, i) {\n var doc = decodeDoc(value);\n var seq = batchKeys[i];\n fetchWinningDocAndMetadata(doc, seq, function (metadata, winningDoc) {\n metadatas[i] = metadata;\n winningDocs[i] = winningDoc;\n if (++numDone === batchKeys.length) {\n onBatchDone();\n }\n });\n });\n }\n\n function onGetMetadata(doc, seq, metadata, cb) {\n if (metadata.seq !== seq) {\n // some other seq is later\n return cb();\n }\n\n if (metadata.winningRev === doc._rev) {\n // this is the winning doc\n return cb(metadata, doc);\n }\n\n // fetch winning doc in separate request\n var docIdRev = doc._id + '::' + metadata.winningRev;\n var req = docIdRevIndex.get(docIdRev);\n req.onsuccess = function (e) {\n cb(metadata, decodeDoc(e.target.result));\n };\n }\n\n function fetchWinningDocAndMetadata(doc, seq, cb) {\n if (docIds && !docIds.has(doc._id)) {\n return cb();\n }\n\n var metadata = docIdsToMetadata.get(doc._id);\n if (metadata) { // cached\n return onGetMetadata(doc, seq, metadata, cb);\n }\n // metadata not cached, have to go fetch it\n docStore.get(doc._id).onsuccess = function (e) {\n metadata = decodeMetadata(e.target.result);\n docIdsToMetadata.set(doc._id, metadata);\n onGetMetadata(doc, seq, metadata, cb);\n };\n }\n\n function finish() {\n opts.complete(null, {\n results: results,\n last_seq: lastSeq\n });\n }\n\n function onTxnComplete() {\n if (!opts.continuous && opts.attachments) {\n // cannot guarantee that postProcessing was already done,\n // so do it again\n postProcessAttachments(results).then(finish);\n } else {\n finish();\n }\n }\n\n var objectStores = [DOC_STORE, BY_SEQ_STORE];\n if (opts.attachments) {\n objectStores.push(ATTACH_STORE);\n }\n var txnResult = openTransactionSafely(idb, objectStores, 'readonly');\n if (txnResult.error) {\n return opts.complete(txnResult.error);\n }\n txn = txnResult.txn;\n txn.onabort = idbError(opts.complete);\n txn.oncomplete = onTxnComplete;\n\n bySeqStore = txn.objectStore(BY_SEQ_STORE);\n docStore = txn.objectStore(DOC_STORE);\n docIdRevIndex = bySeqStore.index('_doc_id_rev');\n\n var keyRange = (opts.since && !opts.descending) ?\n IDBKeyRange.lowerBound(opts.since, true) : null;\n\n runBatchedCursor(bySeqStore, keyRange, opts.descending, limit, onBatch);\n}\n\nvar cachedDBs = new ExportedMap();\nvar blobSupportPromise;\nvar openReqList = new ExportedMap();\n\nfunction IdbPouch(opts, callback) {\n var api = this;\n\n enqueueTask(function (thisCallback) {\n init(api, opts, thisCallback);\n }, callback, api.constructor);\n}\n\nfunction init(api, opts, callback) {\n\n var dbName = opts.name;\n\n var idb = null;\n api._meta = null;\n\n // called when creating a fresh new database\n function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }\n\n // migration to version 2\n // unfortunately \"deletedOrLocal\" is a misnomer now that we no longer\n // store local docs in the main doc-store, but whaddyagonnado\n function addDeletedOrLocalIndex(txn, callback) {\n var docStore = txn.objectStore(DOC_STORE);\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n docStore.openCursor().onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n var metadata = cursor.value;\n var deleted = isDeleted(metadata);\n metadata.deletedOrLocal = deleted ? \"1\" : \"0\";\n docStore.put(metadata);\n cursor[\"continue\"]();\n } else {\n callback();\n }\n };\n }\n\n // migration to version 3 (part 1)\n function createLocalStoreSchema(db) {\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n }\n\n // migration to version 3 (part 2)\n function migrateLocalStore(txn, cb) {\n var localStore = txn.objectStore(LOCAL_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n var metadata = cursor.value;\n var docId = metadata.id;\n var local = isLocalId(docId);\n var rev$$1 = winningRev(metadata);\n if (local) {\n var docIdRev = docId + \"::\" + rev$$1;\n // remove all seq entries\n // associated with this docId\n var start = docId + \"::\";\n var end = docId + \"::~\";\n var index = seqStore.index('_doc_id_rev');\n var range = IDBKeyRange.bound(start, end, false, false);\n var seqCursor = index.openCursor(range);\n seqCursor.onsuccess = function (e) {\n seqCursor = e.target.result;\n if (!seqCursor) {\n // done\n docStore[\"delete\"](cursor.primaryKey);\n cursor[\"continue\"]();\n } else {\n var data = seqCursor.value;\n if (data._doc_id_rev === docIdRev) {\n localStore.put(data);\n }\n seqStore[\"delete\"](seqCursor.primaryKey);\n seqCursor[\"continue\"]();\n }\n };\n } else {\n cursor[\"continue\"]();\n }\n } else if (cb) {\n cb();\n }\n };\n }\n\n // migration to version 4 (part 1)\n function addAttachAndSeqStore(db) {\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }\n\n // migration to version 4 (part 2)\n function migrateAttsAndSeqs(txn, callback) {\n var seqStore = txn.objectStore(BY_SEQ_STORE);\n var attStore = txn.objectStore(ATTACH_STORE);\n var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE);\n\n // need to actually populate the table. this is the expensive part,\n // so as an optimization, check first that this database even\n // contains attachments\n var req = attStore.count();\n req.onsuccess = function (e) {\n var count = e.target.result;\n if (!count) {\n return callback(); // done\n }\n\n seqStore.openCursor().onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return callback(); // done\n }\n var doc = cursor.value;\n var seq = cursor.primaryKey;\n var atts = Object.keys(doc._attachments || {});\n var digestMap = {};\n for (var j = 0; j < atts.length; j++) {\n var att = doc._attachments[atts[j]];\n digestMap[att.digest] = true; // uniq digests, just in case\n }\n var digests = Object.keys(digestMap);\n for (j = 0; j < digests.length; j++) {\n var digest = digests[j];\n attAndSeqStore.put({\n seq: seq,\n digestSeq: digest + '::' + seq\n });\n }\n cursor[\"continue\"]();\n };\n };\n }\n\n // migration to version 5\n // Instead of relying on on-the-fly migration of metadata,\n // this brings the doc-store to its modern form:\n // - metadata.winningrev\n // - metadata.seq\n // - stringify the metadata when storing it\n function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev ||\n winningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor[\"continue\"]();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor[\"continue\"]();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }\n\n api._remote = false;\n api.type = function () {\n return 'idb';\n };\n\n api._id = toPromise(function (callback) {\n callback(null, api._meta.instanceId);\n });\n\n api._bulkDocs = function idb_bulkDocs(req, reqOpts, callback) {\n idbBulkDocs(opts, req, reqOpts, api, idb, callback);\n };\n\n // First we look up the metadata in the ids database, then we fetch the\n // current revision(s) from the by sequence store\n api._get = function idb_get(id, opts, callback) {\n var doc;\n var metadata;\n var err;\n var txn = opts.ctx;\n if (!txn) {\n var txnResult = openTransactionSafely(idb,\n [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n txn = txnResult.txn;\n }\n\n function finish() {\n callback(err, {doc: doc, metadata: metadata, ctx: txn});\n }\n\n txn.objectStore(DOC_STORE).get(id).onsuccess = function (e) {\n metadata = decodeMetadata(e.target.result);\n // we can determine the result here if:\n // 1. there is no such document\n // 2. the document is deleted and we don't ask about specific rev\n // When we ask with opts.rev we expect the answer to be either\n // doc (possibly with _deleted=true) or missing error\n if (!metadata) {\n err = createError(MISSING_DOC, 'missing');\n return finish();\n }\n\n var rev$$1;\n if (!opts.rev) {\n rev$$1 = metadata.winningRev;\n var deleted = isDeleted(metadata);\n if (deleted) {\n err = createError(MISSING_DOC, \"deleted\");\n return finish();\n }\n } else {\n rev$$1 = opts.latest ? latest(opts.rev, metadata) : opts.rev;\n }\n\n var objectStore = txn.objectStore(BY_SEQ_STORE);\n var key = metadata.id + '::' + rev$$1;\n\n objectStore.index('_doc_id_rev').get(key).onsuccess = function (e) {\n doc = e.target.result;\n if (doc) {\n doc = decodeDoc(doc);\n }\n if (!doc) {\n err = createError(MISSING_DOC, 'missing');\n return finish();\n }\n finish();\n };\n };\n };\n\n api._getAttachment = function (docId, attachId, attachment, opts, callback) {\n var txn;\n if (opts.ctx) {\n txn = opts.ctx;\n } else {\n var txnResult = openTransactionSafely(idb,\n [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n txn = txnResult.txn;\n }\n var digest = attachment.digest;\n var type = attachment.content_type;\n\n txn.objectStore(ATTACH_STORE).get(digest).onsuccess = function (e) {\n var body = e.target.result.body;\n readBlobData(body, type, opts.binary, function (blobData) {\n callback(null, blobData);\n });\n };\n };\n\n api._info = function idb_info(callback) {\n var updateSeq;\n var docCount;\n\n var txnResult = openTransactionSafely(idb, [META_STORE, BY_SEQ_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) {\n docCount = e.target.result.docCount;\n };\n txn.objectStore(BY_SEQ_STORE).openCursor(null, 'prev').onsuccess = function (e) {\n var cursor = e.target.result;\n updateSeq = cursor ? cursor.key : 0;\n };\n\n txn.oncomplete = function () {\n callback(null, {\n doc_count: docCount,\n update_seq: updateSeq,\n // for debugging\n idb_attachment_format: (api._meta.blobSupport ? 'binary' : 'base64')\n });\n };\n };\n\n api._allDocs = function idb_allDocs(opts, callback) {\n idbAllDocs(opts, idb, callback);\n };\n\n api._changes = function idbChanges(opts) {\n return changes(opts, api, dbName, idb);\n };\n\n api._close = function (callback) {\n // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close\n // \"Returns immediately and closes the connection in a separate thread...\"\n idb.close();\n cachedDBs[\"delete\"](dbName);\n callback();\n };\n\n api._getRevisionTree = function (docId, callback) {\n var txnResult = openTransactionSafely(idb, [DOC_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n var req = txn.objectStore(DOC_STORE).get(docId);\n req.onsuccess = function (event) {\n var doc = decodeMetadata(event.target.result);\n if (!doc) {\n callback(createError(MISSING_DOC));\n } else {\n callback(null, doc.rev_tree);\n }\n };\n };\n\n // This function removes revisions of document docId\n // which are listed in revs and sets this document\n // revision to to rev_tree\n api._doCompaction = function (docId, revs, callback) {\n var stores = [\n DOC_STORE,\n BY_SEQ_STORE,\n ATTACH_STORE,\n ATTACH_AND_SEQ_STORE\n ];\n var txnResult = openTransactionSafely(idb, stores, 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var txn = txnResult.txn;\n\n var docStore = txn.objectStore(DOC_STORE);\n\n docStore.get(docId).onsuccess = function (event) {\n var metadata = decodeMetadata(event.target.result);\n traverseRevTree(metadata.rev_tree, function (isLeaf, pos,\n revHash, ctx, opts) {\n var rev$$1 = pos + '-' + revHash;\n if (revs.indexOf(rev$$1) !== -1) {\n opts.status = 'missing';\n }\n });\n compactRevs(revs, docId, txn);\n var winningRev$$1 = metadata.winningRev;\n var deleted = metadata.deleted;\n txn.objectStore(DOC_STORE).put(\n encodeMetadata(metadata, winningRev$$1, deleted));\n };\n txn.onabort = idbError(callback);\n txn.oncomplete = function () {\n callback();\n };\n };\n\n\n api._getLocal = function (id, callback) {\n var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readonly');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n var tx = txnResult.txn;\n var req = tx.objectStore(LOCAL_STORE).get(id);\n\n req.onerror = idbError(callback);\n req.onsuccess = function (e) {\n var doc = e.target.result;\n if (!doc) {\n callback(createError(MISSING_DOC));\n } else {\n delete doc['_doc_id_rev']; // for backwards compat\n callback(null, doc);\n }\n };\n };\n\n api._putLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n delete doc._revisions; // ignore this, trust the rev\n var oldRev = doc._rev;\n var id = doc._id;\n if (!oldRev) {\n doc._rev = '0-1';\n } else {\n doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1);\n }\n\n var tx = opts.ctx;\n var ret;\n if (!tx) {\n var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n tx = txnResult.txn;\n tx.onerror = idbError(callback);\n tx.oncomplete = function () {\n if (ret) {\n callback(null, ret);\n }\n };\n }\n\n var oStore = tx.objectStore(LOCAL_STORE);\n var req;\n if (oldRev) {\n req = oStore.get(id);\n req.onsuccess = function (e) {\n var oldDoc = e.target.result;\n if (!oldDoc || oldDoc._rev !== oldRev) {\n callback(createError(REV_CONFLICT));\n } else { // update\n var req = oStore.put(doc);\n req.onsuccess = function () {\n ret = {ok: true, id: doc._id, rev: doc._rev};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n };\n }\n };\n } else { // new doc\n req = oStore.add(doc);\n req.onerror = function (e) {\n // constraint error, already exists\n callback(createError(REV_CONFLICT));\n e.preventDefault(); // avoid transaction abort\n e.stopPropagation(); // avoid transaction onerror\n };\n req.onsuccess = function () {\n ret = {ok: true, id: doc._id, rev: doc._rev};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n };\n }\n };\n\n api._removeLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var tx = opts.ctx;\n if (!tx) {\n var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite');\n if (txnResult.error) {\n return callback(txnResult.error);\n }\n tx = txnResult.txn;\n tx.oncomplete = function () {\n if (ret) {\n callback(null, ret);\n }\n };\n }\n var ret;\n var id = doc._id;\n var oStore = tx.objectStore(LOCAL_STORE);\n var req = oStore.get(id);\n\n req.onerror = idbError(callback);\n req.onsuccess = function (e) {\n var oldDoc = e.target.result;\n if (!oldDoc || oldDoc._rev !== doc._rev) {\n callback(createError(MISSING_DOC));\n } else {\n oStore[\"delete\"](id);\n ret = {ok: true, id: id, rev: '0-0'};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n }\n };\n };\n\n api._destroy = function (opts, callback) {\n changesHandler$$1.removeAllListeners(dbName);\n\n //Close open request for \"dbName\" database to fix ie delay.\n var openReq = openReqList.get(dbName);\n if (openReq && openReq.result) {\n openReq.result.close();\n cachedDBs[\"delete\"](dbName);\n }\n var req = indexedDB.deleteDatabase(dbName);\n\n req.onsuccess = function () {\n //Remove open request from the list.\n openReqList[\"delete\"](dbName);\n if (hasLocalStorage() && (dbName in localStorage)) {\n delete localStorage[dbName];\n }\n callback(null, { 'ok': true });\n };\n\n req.onerror = idbError(callback);\n };\n\n var cached = cachedDBs.get(dbName);\n\n if (cached) {\n idb = cached.idb;\n api._meta = cached.global;\n return nextTick(function () {\n callback(null, api);\n });\n }\n\n var req;\n if (opts.storage) {\n req = tryStorageOption(dbName, opts.storage);\n } else {\n req = indexedDB.open(dbName, ADAPTER_VERSION);\n }\n\n openReqList.set(dbName, req);\n\n req.onupgradeneeded = function (e) {\n var db = e.target.result;\n if (e.oldVersion < 1) {\n return createSchema(db); // new db, initial schema\n }\n // do migrations\n\n var txn = e.currentTarget.transaction;\n // these migrations have to be done in this function, before\n // control is returned to the event loop, because IndexedDB\n\n if (e.oldVersion < 3) {\n createLocalStoreSchema(db); // v2 -> v3\n }\n if (e.oldVersion < 4) {\n addAttachAndSeqStore(db); // v3 -> v4\n }\n\n var migrations = [\n addDeletedOrLocalIndex, // v1 -> v2\n migrateLocalStore, // v2 -> v3\n migrateAttsAndSeqs, // v3 -> v4\n migrateMetadata // v4 -> v5\n ];\n\n var i = e.oldVersion;\n\n function next() {\n var migration = migrations[i - 1];\n i++;\n if (migration) {\n migration(txn, next);\n }\n }\n\n next();\n };\n\n req.onsuccess = function (e) {\n\n idb = e.target.result;\n\n idb.onversionchange = function () {\n idb.close();\n cachedDBs[\"delete\"](dbName);\n };\n\n idb.onabort = function (e) {\n guardedConsole('error', 'Database has a global failure', e.target.error);\n idb.close();\n cachedDBs[\"delete\"](dbName);\n };\n\n // Do a few setup operations (in parallel as much as possible):\n // 1. Fetch meta doc\n // 2. Check blob support\n // 3. Calculate docCount\n // 4. Generate an instanceId if necessary\n // 5. Store docCount and instanceId on meta doc\n\n var txn = idb.transaction([\n META_STORE,\n DETECT_BLOB_SUPPORT_STORE,\n DOC_STORE\n ], 'readwrite');\n\n var storedMetaDoc = false;\n var metaDoc;\n var docCount;\n var blobSupport;\n var instanceId;\n\n function completeSetup() {\n if (typeof blobSupport === 'undefined' || !storedMetaDoc) {\n return;\n }\n api._meta = {\n name: dbName,\n instanceId: instanceId,\n blobSupport: blobSupport\n };\n\n cachedDBs.set(dbName, {\n idb: idb,\n global: api._meta\n });\n callback(null, api);\n }\n\n function storeMetaDocIfReady() {\n if (typeof docCount === 'undefined' || typeof metaDoc === 'undefined') {\n return;\n }\n var instanceKey = dbName + '_id';\n if (instanceKey in metaDoc) {\n instanceId = metaDoc[instanceKey];\n } else {\n metaDoc[instanceKey] = instanceId = uuid();\n }\n metaDoc.docCount = docCount;\n txn.objectStore(META_STORE).put(metaDoc);\n }\n\n //\n // fetch or generate the instanceId\n //\n txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) {\n metaDoc = e.target.result || { id: META_STORE };\n storeMetaDocIfReady();\n };\n\n //\n // countDocs\n //\n countDocs(txn, function (count) {\n docCount = count;\n storeMetaDocIfReady();\n });\n\n //\n // check blob support\n //\n if (!blobSupportPromise) {\n // make sure blob support is only checked once\n blobSupportPromise = checkBlobSupport(txn);\n }\n\n blobSupportPromise.then(function (val) {\n blobSupport = val;\n completeSetup();\n });\n\n // only when the metadata put transaction has completed,\n // consider the setup done\n txn.oncomplete = function () {\n storedMetaDoc = true;\n completeSetup();\n };\n txn.onabort = idbError(callback);\n };\n\n req.onerror = function () {\n var msg = 'Failed to open indexedDB, are you in private browsing mode?';\n guardedConsole('error', msg);\n callback(createError(IDB_ERROR, msg));\n };\n}\n\nIdbPouch.valid = function () {\n // Issue #2533, we finally gave up on doing bug\n // detection instead of browser sniffing. Safari brought us\n // to our knees.\n var isSafari = typeof openDatabase !== 'undefined' &&\n /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) &&\n !/Chrome/.test(navigator.userAgent) &&\n !/BlackBerry/.test(navigator.platform);\n\n // Safari <10.1 does not meet our requirements for IDB support (#5572)\n // since Safari 10.1 shipped with fetch, we can use that to detect it\n var hasFetch = typeof fetch === 'function' &&\n fetch.toString().indexOf('[native code') !== -1;\n\n // On Firefox SecurityError is thrown while referencing indexedDB if cookies\n // are not allowed. `typeof indexedDB` also triggers the error.\n try {\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n};\n\nfunction tryStorageOption(dbName, storage) {\n try { // option only available in Firefox 26+\n return indexedDB.open(dbName, {\n version: ADAPTER_VERSION,\n storage: storage\n });\n } catch (err) {\n return indexedDB.open(dbName, ADAPTER_VERSION);\n }\n}\n\nfunction IDBPouch (PouchDB) {\n PouchDB.adapter('idb', IdbPouch, true);\n}\n\n//\n// Parsing hex strings. Yeah.\n//\n// So basically we need this because of a bug in WebSQL:\n// https://code.google.com/p/chromium/issues/detail?id=422690\n// https://bugs.webkit.org/show_bug.cgi?id=137637\n//\n// UTF-8 and UTF-16 are provided as separate functions\n// for meager performance improvements\n//\n\nfunction decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction hexToInt(charCode) {\n // '0'-'9' is 48-57\n // 'A'-'F' is 65-70\n // SQLite will only give us uppercase hex\n return charCode < 65 ? (charCode - 48) : (charCode - 55);\n}\n\n\n// Example:\n// pragma encoding=utf8;\n// select hex('A');\n// returns '41'\nfunction parseHexUtf8(str, start, end) {\n var result = '';\n while (start < end) {\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start++)) << 4) |\n hexToInt(str.charCodeAt(start++)));\n }\n return result;\n}\n\n// Example:\n// pragma encoding=utf16;\n// select hex('A');\n// returns '4100'\n// notice that the 00 comes after the 41 (i.e. it's swizzled)\nfunction parseHexUtf16(str, start, end) {\n var result = '';\n while (start < end) {\n // UTF-16, so swizzle the bytes\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start + 2)) << 12) |\n (hexToInt(str.charCodeAt(start + 3)) << 8) |\n (hexToInt(str.charCodeAt(start)) << 4) |\n hexToInt(str.charCodeAt(start + 1)));\n start += 4;\n }\n return result;\n}\n\nfunction parseHexString(str, encoding) {\n if (encoding === 'UTF-8') {\n return decodeUtf8(parseHexUtf8(str, 0, str.length));\n } else {\n return parseHexUtf16(str, 0, str.length);\n }\n}\n\nfunction quote(str) {\n return \"'\" + str + \"'\";\n}\n\nvar ADAPTER_VERSION$1 = 7; // used to manage migrations\n\n// The object stores created for each database\n// DOC_STORE stores the document meta data, its revision history and state\nvar DOC_STORE$1 = quote('document-store');\n// BY_SEQ_STORE stores a particular version of a document, keyed by its\n// sequence id\nvar BY_SEQ_STORE$1 = quote('by-sequence');\n// Where we store attachments\nvar ATTACH_STORE$1 = quote('attach-store');\nvar LOCAL_STORE$1 = quote('local-store');\nvar META_STORE$1 = quote('metadata-store');\n// where we store many-to-many relations between attachment\n// digests and seqs\nvar ATTACH_AND_SEQ_STORE$1 = quote('attach-seq-store');\n\n// escapeBlob and unescapeBlob are workarounds for a websql bug:\n// https://code.google.com/p/chromium/issues/detail?id=422690\n// https://bugs.webkit.org/show_bug.cgi?id=137637\n// The goal is to never actually insert the \\u0000 character\n// in the database.\nfunction escapeBlob(str) {\n return str\n .replace(/\\u0002/g, '\\u0002\\u0002')\n .replace(/\\u0001/g, '\\u0001\\u0002')\n .replace(/\\u0000/g, '\\u0001\\u0001');\n}\n\nfunction unescapeBlob(str) {\n return str\n .replace(/\\u0001\\u0001/g, '\\u0000')\n .replace(/\\u0001\\u0002/g, '\\u0001')\n .replace(/\\u0002\\u0002/g, '\\u0002');\n}\n\nfunction stringifyDoc(doc) {\n // don't bother storing the id/rev. it uses lots of space,\n // in persistent map/reduce especially\n delete doc._id;\n delete doc._rev;\n return JSON.stringify(doc);\n}\n\nfunction unstringifyDoc(doc, id, rev$$1) {\n doc = JSON.parse(doc);\n doc._id = id;\n doc._rev = rev$$1;\n return doc;\n}\n\n// question mark groups IN queries, e.g. 3 -> '(?,?,?)'\nfunction qMarks(num) {\n var s = '(';\n while (num--) {\n s += '?';\n if (num) {\n s += ',';\n }\n }\n return s + ')';\n}\n\nfunction select(selector, table, joiner, where, orderBy) {\n return 'SELECT ' + selector + ' FROM ' +\n (typeof table === 'string' ? table : table.join(' JOIN ')) +\n (joiner ? (' ON ' + joiner) : '') +\n (where ? (' WHERE ' +\n (typeof where === 'string' ? where : where.join(' AND '))) : '') +\n (orderBy ? (' ORDER BY ' + orderBy) : '');\n}\n\nfunction compactRevs$1(revs, docId, tx) {\n\n if (!revs.length) {\n return;\n }\n\n var numDone = 0;\n var seqs = [];\n\n function checkDone() {\n if (++numDone === revs.length) { // done\n deleteOrphans();\n }\n }\n\n function deleteOrphans() {\n // find orphaned attachment digests\n\n if (!seqs.length) {\n return;\n }\n\n var sql = 'SELECT DISTINCT digest AS digest FROM ' +\n ATTACH_AND_SEQ_STORE$1 + ' WHERE seq IN ' + qMarks(seqs.length);\n\n tx.executeSql(sql, seqs, function (tx, res) {\n\n var digestsToCheck = [];\n for (var i = 0; i < res.rows.length; i++) {\n digestsToCheck.push(res.rows.item(i).digest);\n }\n if (!digestsToCheck.length) {\n return;\n }\n\n var sql = 'DELETE FROM ' + ATTACH_AND_SEQ_STORE$1 +\n ' WHERE seq IN (' +\n seqs.map(function () { return '?'; }).join(',') +\n ')';\n tx.executeSql(sql, seqs, function (tx) {\n\n var sql = 'SELECT digest FROM ' + ATTACH_AND_SEQ_STORE$1 +\n ' WHERE digest IN (' +\n digestsToCheck.map(function () { return '?'; }).join(',') +\n ')';\n tx.executeSql(sql, digestsToCheck, function (tx, res) {\n var nonOrphanedDigests = new ExportedSet();\n for (var i = 0; i < res.rows.length; i++) {\n nonOrphanedDigests.add(res.rows.item(i).digest);\n }\n digestsToCheck.forEach(function (digest) {\n if (nonOrphanedDigests.has(digest)) {\n return;\n }\n tx.executeSql(\n 'DELETE FROM ' + ATTACH_AND_SEQ_STORE$1 + ' WHERE digest=?',\n [digest]);\n tx.executeSql(\n 'DELETE FROM ' + ATTACH_STORE$1 + ' WHERE digest=?', [digest]);\n });\n });\n });\n });\n }\n\n // update by-seq and attach stores in parallel\n revs.forEach(function (rev$$1) {\n var sql = 'SELECT seq FROM ' + BY_SEQ_STORE$1 +\n ' WHERE doc_id=? AND rev=?';\n\n tx.executeSql(sql, [docId, rev$$1], function (tx, res) {\n if (!res.rows.length) { // already deleted\n return checkDone();\n }\n var seq = res.rows.item(0).seq;\n seqs.push(seq);\n\n tx.executeSql(\n 'DELETE FROM ' + BY_SEQ_STORE$1 + ' WHERE seq=?', [seq], checkDone);\n });\n });\n}\n\nfunction websqlError(callback) {\n return function (event) {\n guardedConsole('error', 'WebSQL threw an error', event);\n // event may actually be a SQLError object, so report is as such\n var errorNameMatch = event && event.constructor.toString()\n .match(/function ([^(]+)/);\n var errorName = (errorNameMatch && errorNameMatch[1]) || event.type;\n var errorReason = event.target || event.message;\n callback(createError(WSQ_ERROR, errorReason, errorName));\n };\n}\n\nfunction getSize(opts) {\n if ('size' in opts) {\n // triggers immediate popup in iOS, fixes #2347\n // e.g. 5000001 asks for 5 MB, 10000001 asks for 10 MB,\n return opts.size * 1000000;\n }\n // In iOS, doesn't matter as long as it's <= 5000000.\n // Except that if you request too much, our tests fail\n // because of the native \"do you accept?\" popup.\n // In Android <=4.3, this value is actually used as an\n // honest-to-god ceiling for data, so we need to\n // set it to a decently high number.\n var isAndroid = typeof navigator !== 'undefined' &&\n /Android/.test(navigator.userAgent);\n return isAndroid ? 5000000 : 1; // in PhantomJS, if you use 0 it will crash\n}\n\nfunction websqlBulkDocs(dbOpts, req, opts, api, db, websqlChanges, callback) {\n var newEdits = opts.new_edits;\n var userDocs = req.docs;\n\n // Parse the docs, give them a sequence number for the result\n var docInfos = userDocs.map(function (doc) {\n if (doc._id && isLocalId(doc._id)) {\n return doc;\n }\n var newDoc = parseDoc(doc, newEdits);\n return newDoc;\n });\n\n var docInfoErrors = docInfos.filter(function (docInfo) {\n return docInfo.error;\n });\n if (docInfoErrors.length) {\n return callback(docInfoErrors[0]);\n }\n\n var tx;\n var results = new Array(docInfos.length);\n var fetchedDocs = new ExportedMap();\n\n var preconditionErrored;\n function complete() {\n if (preconditionErrored) {\n return callback(preconditionErrored);\n }\n websqlChanges.notify(api._name);\n callback(null, results);\n }\n\n function verifyAttachment(digest, callback) {\n var sql = 'SELECT count(*) as cnt FROM ' + ATTACH_STORE$1 +\n ' WHERE digest=?';\n tx.executeSql(sql, [digest], function (tx, result) {\n if (result.rows.item(0).cnt === 0) {\n var err = createError(MISSING_STUB,\n 'unknown stub attachment with digest ' +\n digest);\n callback(err);\n } else {\n callback();\n }\n });\n }\n\n function verifyAttachments(finish) {\n var digests = [];\n docInfos.forEach(function (docInfo) {\n if (docInfo.data && docInfo.data._attachments) {\n Object.keys(docInfo.data._attachments).forEach(function (filename) {\n var att = docInfo.data._attachments[filename];\n if (att.stub) {\n digests.push(att.digest);\n }\n });\n }\n });\n if (!digests.length) {\n return finish();\n }\n var numDone = 0;\n var err;\n\n function checkDone() {\n if (++numDone === digests.length) {\n finish(err);\n }\n }\n digests.forEach(function (digest) {\n verifyAttachment(digest, function (attErr) {\n if (attErr && !err) {\n err = attErr;\n }\n checkDone();\n });\n });\n }\n\n function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted,\n isUpdate, delta, resultsIdx, callback) {\n\n function finish() {\n var data = docInfo.data;\n var deletedInt = newRevIsDeleted ? 1 : 0;\n\n var id = data._id;\n var rev = data._rev;\n var json = stringifyDoc(data);\n var sql = 'INSERT INTO ' + BY_SEQ_STORE$1 +\n ' (doc_id, rev, json, deleted) VALUES (?, ?, ?, ?);';\n var sqlArgs = [id, rev, json, deletedInt];\n\n // map seqs to attachment digests, which\n // we will need later during compaction\n function insertAttachmentMappings(seq, callback) {\n var attsAdded = 0;\n var attsToAdd = Object.keys(data._attachments || {});\n\n if (!attsToAdd.length) {\n return callback();\n }\n function checkDone() {\n if (++attsAdded === attsToAdd.length) {\n callback();\n }\n return false; // ack handling a constraint error\n }\n function add(att) {\n var sql = 'INSERT INTO ' + ATTACH_AND_SEQ_STORE$1 +\n ' (digest, seq) VALUES (?,?)';\n var sqlArgs = [data._attachments[att].digest, seq];\n tx.executeSql(sql, sqlArgs, checkDone, checkDone);\n // second callback is for a constaint error, which we ignore\n // because this docid/rev has already been associated with\n // the digest (e.g. when new_edits == false)\n }\n for (var i = 0; i < attsToAdd.length; i++) {\n add(attsToAdd[i]); // do in parallel\n }\n }\n\n tx.executeSql(sql, sqlArgs, function (tx, result) {\n var seq = result.insertId;\n insertAttachmentMappings(seq, function () {\n dataWritten(tx, seq);\n });\n }, function () {\n // constraint error, recover by updating instead (see #1638)\n var fetchSql = select('seq', BY_SEQ_STORE$1, null,\n 'doc_id=? AND rev=?');\n tx.executeSql(fetchSql, [id, rev], function (tx, res) {\n var seq = res.rows.item(0).seq;\n var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n ' SET json=?, deleted=? WHERE doc_id=? AND rev=?;';\n var sqlArgs = [json, deletedInt, id, rev];\n tx.executeSql(sql, sqlArgs, function (tx) {\n insertAttachmentMappings(seq, function () {\n dataWritten(tx, seq);\n });\n });\n });\n return false; // ack that we've handled the error\n });\n }\n\n function collectResults(attachmentErr) {\n if (!err) {\n if (attachmentErr) {\n err = attachmentErr;\n callback(err);\n } else if (recv === attachments.length) {\n finish();\n }\n }\n }\n\n var err = null;\n var recv = 0;\n\n docInfo.data._id = docInfo.metadata.id;\n docInfo.data._rev = docInfo.metadata.rev;\n var attachments = Object.keys(docInfo.data._attachments || {});\n\n\n if (newRevIsDeleted) {\n docInfo.data._deleted = true;\n }\n\n function attachmentSaved(err) {\n recv++;\n collectResults(err);\n }\n\n attachments.forEach(function (key) {\n var att = docInfo.data._attachments[key];\n if (!att.stub) {\n var data = att.data;\n delete att.data;\n att.revpos = parseInt(winningRev$$1, 10);\n var digest = att.digest;\n saveAttachment(digest, data, attachmentSaved);\n } else {\n recv++;\n collectResults();\n }\n });\n\n if (!attachments.length) {\n finish();\n }\n\n function dataWritten(tx, seq) {\n var id = docInfo.metadata.id;\n\n var revsToCompact = docInfo.stemmedRevs || [];\n if (isUpdate && api.auto_compaction) {\n revsToCompact = compactTree(docInfo.metadata).concat(revsToCompact);\n }\n if (revsToCompact.length) {\n compactRevs$1(revsToCompact, id, tx);\n }\n\n docInfo.metadata.seq = seq;\n var rev = docInfo.metadata.rev;\n delete docInfo.metadata.rev;\n\n var sql = isUpdate ?\n 'UPDATE ' + DOC_STORE$1 +\n ' SET json=?, max_seq=?, winningseq=' +\n '(SELECT seq FROM ' + BY_SEQ_STORE$1 +\n ' WHERE doc_id=' + DOC_STORE$1 + '.id AND rev=?) WHERE id=?'\n : 'INSERT INTO ' + DOC_STORE$1 +\n ' (id, winningseq, max_seq, json) VALUES (?,?,?,?);';\n var metadataStr = safeJsonStringify(docInfo.metadata);\n var params = isUpdate ?\n [metadataStr, seq, winningRev$$1, id] :\n [id, seq, seq, metadataStr];\n tx.executeSql(sql, params, function () {\n results[resultsIdx] = {\n ok: true,\n id: docInfo.metadata.id,\n rev: rev\n };\n fetchedDocs.set(id, docInfo.metadata);\n callback();\n });\n }\n }\n\n function websqlProcessDocs() {\n processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs, tx,\n results, writeDoc, opts);\n }\n\n function fetchExistingDocs(callback) {\n if (!docInfos.length) {\n return callback();\n }\n\n var numFetched = 0;\n\n function checkDone() {\n if (++numFetched === docInfos.length) {\n callback();\n }\n }\n\n docInfos.forEach(function (docInfo) {\n if (docInfo._id && isLocalId(docInfo._id)) {\n return checkDone(); // skip local docs\n }\n var id = docInfo.metadata.id;\n tx.executeSql('SELECT json FROM ' + DOC_STORE$1 +\n ' WHERE id = ?', [id], function (tx, result) {\n if (result.rows.length) {\n var metadata = safeJsonParse(result.rows.item(0).json);\n fetchedDocs.set(id, metadata);\n }\n checkDone();\n });\n });\n }\n\n function saveAttachment(digest, data, callback) {\n var sql = 'SELECT digest FROM ' + ATTACH_STORE$1 + ' WHERE digest=?';\n tx.executeSql(sql, [digest], function (tx, result) {\n if (result.rows.length) { // attachment already exists\n return callback();\n }\n // we could just insert before selecting and catch the error,\n // but my hunch is that it's cheaper not to serialize the blob\n // from JS to C if we don't have to (TODO: confirm this)\n sql = 'INSERT INTO ' + ATTACH_STORE$1 +\n ' (digest, body, escaped) VALUES (?,?,1)';\n tx.executeSql(sql, [digest, escapeBlob(data)], function () {\n callback();\n }, function () {\n // ignore constaint errors, means it already exists\n callback();\n return false; // ack we handled the error\n });\n });\n }\n\n preprocessAttachments(docInfos, 'binary', function (err) {\n if (err) {\n return callback(err);\n }\n db.transaction(function (txn) {\n tx = txn;\n verifyAttachments(function (err) {\n if (err) {\n preconditionErrored = err;\n } else {\n fetchExistingDocs(websqlProcessDocs);\n }\n });\n }, websqlError(callback), complete);\n });\n}\n\nvar cachedDatabases = new ExportedMap();\n\n// openDatabase passed in through opts (e.g. for node-websql)\nfunction openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}\n\nfunction openDBSafely(opts) {\n try {\n return {\n db: openDatabaseWithOpts(opts)\n };\n } catch (err) {\n return {\n error: err\n };\n }\n}\n\nfunction openDB(opts) {\n var cachedResult = cachedDatabases.get(opts.name);\n if (!cachedResult) {\n cachedResult = openDBSafely(opts);\n cachedDatabases.set(opts.name, cachedResult);\n }\n return cachedResult;\n}\n\nvar websqlChanges = new Changes();\n\nfunction fetchAttachmentsIfNecessary$1(doc, opts, api, txn, cb) {\n var attachments = Object.keys(doc._attachments || {});\n if (!attachments.length) {\n return cb && cb();\n }\n var numDone = 0;\n\n function checkDone() {\n if (++numDone === attachments.length && cb) {\n cb();\n }\n }\n\n function fetchAttachment(doc, att) {\n var attObj = doc._attachments[att];\n var attOpts = {binary: opts.binary, ctx: txn};\n api._getAttachment(doc._id, att, attObj, attOpts, function (_, data) {\n doc._attachments[att] = $inject_Object_assign(\n pick(attObj, ['digest', 'content_type']),\n { data: data }\n );\n checkDone();\n });\n }\n\n attachments.forEach(function (att) {\n if (opts.attachments && opts.include_docs) {\n fetchAttachment(doc, att);\n } else {\n doc._attachments[att].stub = true;\n checkDone();\n }\n });\n}\n\nvar POUCH_VERSION = 1;\n\n// these indexes cover the ground for most allDocs queries\nvar BY_SEQ_STORE_DELETED_INDEX_SQL =\n 'CREATE INDEX IF NOT EXISTS \\'by-seq-deleted-idx\\' ON ' +\n BY_SEQ_STORE$1 + ' (seq, deleted)';\nvar BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL =\n 'CREATE UNIQUE INDEX IF NOT EXISTS \\'by-seq-doc-id-rev\\' ON ' +\n BY_SEQ_STORE$1 + ' (doc_id, rev)';\nvar DOC_STORE_WINNINGSEQ_INDEX_SQL =\n 'CREATE INDEX IF NOT EXISTS \\'doc-winningseq-idx\\' ON ' +\n DOC_STORE$1 + ' (winningseq)';\nvar ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL =\n 'CREATE INDEX IF NOT EXISTS \\'attach-seq-seq-idx\\' ON ' +\n ATTACH_AND_SEQ_STORE$1 + ' (seq)';\nvar ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL =\n 'CREATE UNIQUE INDEX IF NOT EXISTS \\'attach-seq-digest-idx\\' ON ' +\n ATTACH_AND_SEQ_STORE$1 + ' (digest, seq)';\n\nvar DOC_STORE_AND_BY_SEQ_JOINER = BY_SEQ_STORE$1 +\n '.seq = ' + DOC_STORE$1 + '.winningseq';\n\nvar SELECT_DOCS = BY_SEQ_STORE$1 + '.seq AS seq, ' +\n BY_SEQ_STORE$1 + '.deleted AS deleted, ' +\n BY_SEQ_STORE$1 + '.json AS data, ' +\n BY_SEQ_STORE$1 + '.rev AS rev, ' +\n DOC_STORE$1 + '.json AS metadata';\n\nfunction WebSqlPouch(opts, callback) {\n var api = this;\n var instanceId = null;\n var size = getSize(opts);\n var idRequests = [];\n var encoding;\n\n api._name = opts.name;\n\n // extend the options here, because sqlite plugin has a ton of options\n // and they are constantly changing, so it's more prudent to allow anything\n var websqlOpts = $inject_Object_assign({}, opts, {\n version: POUCH_VERSION,\n description: opts.name,\n size: size\n });\n var openDBResult = openDB(websqlOpts);\n if (openDBResult.error) {\n return websqlError(callback)(openDBResult.error);\n }\n var db = openDBResult.db;\n if (typeof db.readTransaction !== 'function') {\n // doesn't exist in sqlite plugin\n db.readTransaction = db.transaction;\n }\n\n function dbCreated() {\n // note the db name in case the browser upgrades to idb\n if (hasLocalStorage()) {\n window.localStorage['_pouch__websqldb_' + api._name] = true;\n }\n callback(null, api);\n }\n\n // In this migration, we added the 'deleted' and 'local' columns to the\n // by-seq and doc store tables.\n // To preserve existing user data, we re-process all the existing JSON\n // and add these values.\n // Called migration2 because it corresponds to adapter version (db_version) #2\n function runMigration2(tx, callback) {\n // index used for the join in the allDocs query\n tx.executeSql(DOC_STORE_WINNINGSEQ_INDEX_SQL);\n\n tx.executeSql('ALTER TABLE ' + BY_SEQ_STORE$1 +\n ' ADD COLUMN deleted TINYINT(1) DEFAULT 0', [], function () {\n tx.executeSql(BY_SEQ_STORE_DELETED_INDEX_SQL);\n tx.executeSql('ALTER TABLE ' + DOC_STORE$1 +\n ' ADD COLUMN local TINYINT(1) DEFAULT 0', [], function () {\n tx.executeSql('CREATE INDEX IF NOT EXISTS \\'doc-store-local-idx\\' ON ' +\n DOC_STORE$1 + ' (local, id)');\n\n var sql = 'SELECT ' + DOC_STORE$1 + '.winningseq AS seq, ' + DOC_STORE$1 +\n '.json AS metadata FROM ' + BY_SEQ_STORE$1 + ' JOIN ' + DOC_STORE$1 +\n ' ON ' + BY_SEQ_STORE$1 + '.seq = ' + DOC_STORE$1 + '.winningseq';\n\n tx.executeSql(sql, [], function (tx, result) {\n\n var deleted = [];\n var local = [];\n\n for (var i = 0; i < result.rows.length; i++) {\n var item = result.rows.item(i);\n var seq = item.seq;\n var metadata = JSON.parse(item.metadata);\n if (isDeleted(metadata)) {\n deleted.push(seq);\n }\n if (isLocalId(metadata.id)) {\n local.push(metadata.id);\n }\n }\n tx.executeSql('UPDATE ' + DOC_STORE$1 + 'SET local = 1 WHERE id IN ' +\n qMarks(local.length), local, function () {\n tx.executeSql('UPDATE ' + BY_SEQ_STORE$1 +\n ' SET deleted = 1 WHERE seq IN ' +\n qMarks(deleted.length), deleted, callback);\n });\n });\n });\n });\n }\n\n // in this migration, we make all the local docs unversioned\n function runMigration3(tx, callback) {\n var local = 'CREATE TABLE IF NOT EXISTS ' + LOCAL_STORE$1 +\n ' (id UNIQUE, rev, json)';\n tx.executeSql(local, [], function () {\n var sql = 'SELECT ' + DOC_STORE$1 + '.id AS id, ' +\n BY_SEQ_STORE$1 + '.json AS data ' +\n 'FROM ' + BY_SEQ_STORE$1 + ' JOIN ' +\n DOC_STORE$1 + ' ON ' + BY_SEQ_STORE$1 + '.seq = ' +\n DOC_STORE$1 + '.winningseq WHERE local = 1';\n tx.executeSql(sql, [], function (tx, res) {\n var rows = [];\n for (var i = 0; i < res.rows.length; i++) {\n rows.push(res.rows.item(i));\n }\n function doNext() {\n if (!rows.length) {\n return callback(tx);\n }\n var row = rows.shift();\n var rev$$1 = JSON.parse(row.data)._rev;\n tx.executeSql('INSERT INTO ' + LOCAL_STORE$1 +\n ' (id, rev, json) VALUES (?,?,?)',\n [row.id, rev$$1, row.data], function (tx) {\n tx.executeSql('DELETE FROM ' + DOC_STORE$1 + ' WHERE id=?',\n [row.id], function (tx) {\n tx.executeSql('DELETE FROM ' + BY_SEQ_STORE$1 + ' WHERE seq=?',\n [row.seq], function () {\n doNext();\n });\n });\n });\n }\n doNext();\n });\n });\n }\n\n // in this migration, we remove doc_id_rev and just use rev\n function runMigration4(tx, callback) {\n\n function updateRows(rows) {\n function doNext() {\n if (!rows.length) {\n return callback(tx);\n }\n var row = rows.shift();\n var doc_id_rev = parseHexString(row.hex, encoding);\n var idx = doc_id_rev.lastIndexOf('::');\n var doc_id = doc_id_rev.substring(0, idx);\n var rev$$1 = doc_id_rev.substring(idx + 2);\n var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n ' SET doc_id=?, rev=? WHERE doc_id_rev=?';\n tx.executeSql(sql, [doc_id, rev$$1, doc_id_rev], function () {\n doNext();\n });\n }\n doNext();\n }\n\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN doc_id';\n tx.executeSql(sql, [], function (tx) {\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN rev';\n tx.executeSql(sql, [], function (tx) {\n tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL, [], function (tx) {\n var sql = 'SELECT hex(doc_id_rev) as hex FROM ' + BY_SEQ_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var rows = [];\n for (var i = 0; i < res.rows.length; i++) {\n rows.push(res.rows.item(i));\n }\n updateRows(rows);\n });\n });\n });\n });\n }\n\n // in this migration, we add the attach_and_seq table\n // for issue #2818\n function runMigration5(tx, callback) {\n\n function migrateAttsAndSeqs(tx) {\n // need to actually populate the table. this is the expensive part,\n // so as an optimization, check first that this database even\n // contains attachments\n var sql = 'SELECT COUNT(*) AS cnt FROM ' + ATTACH_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var count = res.rows.item(0).cnt;\n if (!count) {\n return callback(tx);\n }\n\n var offset = 0;\n var pageSize = 10;\n function nextPage() {\n var sql = select(\n SELECT_DOCS + ', ' + DOC_STORE$1 + '.id AS id',\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n null,\n DOC_STORE$1 + '.id '\n );\n sql += ' LIMIT ' + pageSize + ' OFFSET ' + offset;\n offset += pageSize;\n tx.executeSql(sql, [], function (tx, res) {\n if (!res.rows.length) {\n return callback(tx);\n }\n var digestSeqs = {};\n function addDigestSeq(digest, seq) {\n // uniq digest/seq pairs, just in case there are dups\n var seqs = digestSeqs[digest] = (digestSeqs[digest] || []);\n if (seqs.indexOf(seq) === -1) {\n seqs.push(seq);\n }\n }\n for (var i = 0; i < res.rows.length; i++) {\n var row = res.rows.item(i);\n var doc = unstringifyDoc(row.data, row.id, row.rev);\n var atts = Object.keys(doc._attachments || {});\n for (var j = 0; j < atts.length; j++) {\n var att = doc._attachments[atts[j]];\n addDigestSeq(att.digest, row.seq);\n }\n }\n var digestSeqPairs = [];\n Object.keys(digestSeqs).forEach(function (digest) {\n var seqs = digestSeqs[digest];\n seqs.forEach(function (seq) {\n digestSeqPairs.push([digest, seq]);\n });\n });\n if (!digestSeqPairs.length) {\n return nextPage();\n }\n var numDone = 0;\n digestSeqPairs.forEach(function (pair) {\n var sql = 'INSERT INTO ' + ATTACH_AND_SEQ_STORE$1 +\n ' (digest, seq) VALUES (?,?)';\n tx.executeSql(sql, pair, function () {\n if (++numDone === digestSeqPairs.length) {\n nextPage();\n }\n });\n });\n });\n }\n nextPage();\n });\n }\n\n var attachAndRev = 'CREATE TABLE IF NOT EXISTS ' +\n ATTACH_AND_SEQ_STORE$1 + ' (digest, seq INTEGER)';\n tx.executeSql(attachAndRev, [], function (tx) {\n tx.executeSql(\n ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL, [], function (tx) {\n tx.executeSql(\n ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL, [],\n migrateAttsAndSeqs);\n });\n });\n }\n\n // in this migration, we use escapeBlob() and unescapeBlob()\n // instead of reading out the binary as HEX, which is slow\n function runMigration6(tx, callback) {\n var sql = 'ALTER TABLE ' + ATTACH_STORE$1 +\n ' ADD COLUMN escaped TINYINT(1) DEFAULT 0';\n tx.executeSql(sql, [], callback);\n }\n\n // issue #3136, in this migration we need a \"latest seq\" as well\n // as the \"winning seq\" in the doc store\n function runMigration7(tx, callback) {\n var sql = 'ALTER TABLE ' + DOC_STORE$1 +\n ' ADD COLUMN max_seq INTEGER';\n tx.executeSql(sql, [], function (tx) {\n var sql = 'UPDATE ' + DOC_STORE$1 + ' SET max_seq=(SELECT MAX(seq) FROM ' +\n BY_SEQ_STORE$1 + ' WHERE doc_id=id)';\n tx.executeSql(sql, [], function (tx) {\n // add unique index after filling, else we'll get a constraint\n // error when we do the ALTER TABLE\n var sql =\n 'CREATE UNIQUE INDEX IF NOT EXISTS \\'doc-max-seq-idx\\' ON ' +\n DOC_STORE$1 + ' (max_seq)';\n tx.executeSql(sql, [], callback);\n });\n });\n }\n\n function checkEncoding(tx, cb) {\n // UTF-8 on chrome/android, UTF-16 on safari < 7.1\n tx.executeSql('SELECT HEX(\"a\") AS hex', [], function (tx, res) {\n var hex = res.rows.item(0).hex;\n encoding = hex.length === 2 ? 'UTF-8' : 'UTF-16';\n cb();\n }\n );\n }\n\n function onGetInstanceId() {\n while (idRequests.length > 0) {\n var idCallback = idRequests.pop();\n idCallback(null, instanceId);\n }\n }\n\n function onGetVersion(tx, dbVersion) {\n if (dbVersion === 0) {\n // initial schema\n\n var meta = 'CREATE TABLE IF NOT EXISTS ' + META_STORE$1 +\n ' (dbid, db_version INTEGER)';\n var attach = 'CREATE TABLE IF NOT EXISTS ' + ATTACH_STORE$1 +\n ' (digest UNIQUE, escaped TINYINT(1), body BLOB)';\n var attachAndRev = 'CREATE TABLE IF NOT EXISTS ' +\n ATTACH_AND_SEQ_STORE$1 + ' (digest, seq INTEGER)';\n // TODO: migrate winningseq to INTEGER\n var doc = 'CREATE TABLE IF NOT EXISTS ' + DOC_STORE$1 +\n ' (id unique, json, winningseq, max_seq INTEGER UNIQUE)';\n var seq = 'CREATE TABLE IF NOT EXISTS ' + BY_SEQ_STORE$1 +\n ' (seq INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' +\n 'json, deleted TINYINT(1), doc_id, rev)';\n var local = 'CREATE TABLE IF NOT EXISTS ' + LOCAL_STORE$1 +\n ' (id UNIQUE, rev, json)';\n\n // creates\n tx.executeSql(attach);\n tx.executeSql(local);\n tx.executeSql(attachAndRev, [], function () {\n tx.executeSql(ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL);\n tx.executeSql(ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL);\n });\n tx.executeSql(doc, [], function () {\n tx.executeSql(DOC_STORE_WINNINGSEQ_INDEX_SQL);\n tx.executeSql(seq, [], function () {\n tx.executeSql(BY_SEQ_STORE_DELETED_INDEX_SQL);\n tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL);\n tx.executeSql(meta, [], function () {\n // mark the db version, and new dbid\n var initSeq = 'INSERT INTO ' + META_STORE$1 +\n ' (db_version, dbid) VALUES (?,?)';\n instanceId = uuid();\n var initSeqArgs = [ADAPTER_VERSION$1, instanceId];\n tx.executeSql(initSeq, initSeqArgs, function () {\n onGetInstanceId();\n });\n });\n });\n });\n } else { // version > 0\n\n var setupDone = function () {\n var migrated = dbVersion < ADAPTER_VERSION$1;\n if (migrated) {\n // update the db version within this transaction\n tx.executeSql('UPDATE ' + META_STORE$1 + ' SET db_version = ' +\n ADAPTER_VERSION$1);\n }\n // notify db.id() callers\n var sql = 'SELECT dbid FROM ' + META_STORE$1;\n tx.executeSql(sql, [], function (tx, result) {\n instanceId = result.rows.item(0).dbid;\n onGetInstanceId();\n });\n };\n\n // would love to use promises here, but then websql\n // ends the transaction early\n var tasks = [\n runMigration2,\n runMigration3,\n runMigration4,\n runMigration5,\n runMigration6,\n runMigration7,\n setupDone\n ];\n\n // run each migration sequentially\n var i = dbVersion;\n var nextMigration = function (tx) {\n tasks[i - 1](tx, nextMigration);\n i++;\n };\n nextMigration(tx);\n }\n }\n\n function setup() {\n db.transaction(function (tx) {\n // first check the encoding\n checkEncoding(tx, function () {\n // then get the version\n fetchVersion(tx);\n });\n }, websqlError(callback), dbCreated);\n }\n\n function fetchVersion(tx) {\n var sql = 'SELECT sql FROM sqlite_master WHERE tbl_name = ' + META_STORE$1;\n tx.executeSql(sql, [], function (tx, result) {\n if (!result.rows.length) {\n // database hasn't even been created yet (version 0)\n onGetVersion(tx, 0);\n } else if (!/db_version/.test(result.rows.item(0).sql)) {\n // table was created, but without the new db_version column,\n // so add it.\n tx.executeSql('ALTER TABLE ' + META_STORE$1 +\n ' ADD COLUMN db_version INTEGER', [], function () {\n // before version 2, this column didn't even exist\n onGetVersion(tx, 1);\n });\n } else { // column exists, we can safely get it\n tx.executeSql('SELECT db_version FROM ' + META_STORE$1,\n [], function (tx, result) {\n var dbVersion = result.rows.item(0).db_version;\n onGetVersion(tx, dbVersion);\n });\n }\n });\n }\n\n setup();\n\n function getMaxSeq(tx, callback) {\n var sql = 'SELECT MAX(seq) AS seq FROM ' + BY_SEQ_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var updateSeq = res.rows.item(0).seq || 0;\n callback(updateSeq);\n });\n }\n\n function countDocs(tx, callback) {\n // count the total rows\n var sql = select(\n 'COUNT(' + DOC_STORE$1 + '.id) AS \\'num\\'',\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n BY_SEQ_STORE$1 + '.deleted=0');\n\n tx.executeSql(sql, [], function (tx, result) {\n callback(result.rows.item(0).num);\n });\n }\n\n api._remote = false;\n api.type = function () {\n return 'websql';\n };\n\n api._id = toPromise(function (callback) {\n callback(null, instanceId);\n });\n\n api._info = function (callback) {\n var seq;\n var docCount;\n db.readTransaction(function (tx) {\n getMaxSeq(tx, function (theSeq) {\n seq = theSeq;\n });\n countDocs(tx, function (theDocCount) {\n docCount = theDocCount;\n });\n }, websqlError(callback), function () {\n callback(null, {\n doc_count: docCount,\n update_seq: seq,\n websql_encoding: encoding\n });\n });\n };\n\n api._bulkDocs = function (req, reqOpts, callback) {\n websqlBulkDocs(opts, req, reqOpts, api, db, websqlChanges, callback);\n };\n\n function latest$$1(tx, id, rev$$1, callback, finish) {\n var sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n DOC_STORE$1 + '.id=?');\n var sqlArgs = [id];\n\n tx.executeSql(sql, sqlArgs, function (a, results) {\n if (!results.rows.length) {\n var err = createError(MISSING_DOC, 'missing');\n return finish(err);\n }\n var item = results.rows.item(0);\n var metadata = safeJsonParse(item.metadata);\n callback(latest(rev$$1, metadata));\n });\n }\n\n api._get = function (id, opts, callback) {\n var doc;\n var metadata;\n var tx = opts.ctx;\n if (!tx) {\n return db.readTransaction(function (txn) {\n api._get(id, $inject_Object_assign({ctx: txn}, opts), callback);\n });\n }\n\n function finish(err) {\n callback(err, {doc: doc, metadata: metadata, ctx: tx});\n }\n\n var sql;\n var sqlArgs;\n\n if (!opts.rev) {\n sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n DOC_STORE$1 + '.id=?');\n sqlArgs = [id];\n } else if (opts.latest) {\n latest$$1(tx, id, opts.rev, function (latestRev) {\n opts.latest = false;\n opts.rev = latestRev;\n api._get(id, opts, callback);\n }, finish);\n return;\n } else {\n sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE$1 + '.id=' + BY_SEQ_STORE$1 + '.doc_id',\n [BY_SEQ_STORE$1 + '.doc_id=?', BY_SEQ_STORE$1 + '.rev=?']);\n sqlArgs = [id, opts.rev];\n }\n\n tx.executeSql(sql, sqlArgs, function (a, results) {\n if (!results.rows.length) {\n var missingErr = createError(MISSING_DOC, 'missing');\n return finish(missingErr);\n }\n var item = results.rows.item(0);\n metadata = safeJsonParse(item.metadata);\n if (item.deleted && !opts.rev) {\n var deletedErr = createError(MISSING_DOC, 'deleted');\n return finish(deletedErr);\n }\n doc = unstringifyDoc(item.data, metadata.id, item.rev);\n finish();\n });\n };\n\n api._allDocs = function (opts, callback) {\n var results = [];\n var totalRows;\n var updateSeq;\n\n var start = 'startkey' in opts ? opts.startkey : false;\n var end = 'endkey' in opts ? opts.endkey : false;\n var key = 'key' in opts ? opts.key : false;\n var keys = 'keys' in opts ? opts.keys : false;\n var descending = 'descending' in opts ? opts.descending : false;\n var limit = 'limit' in opts ? opts.limit : -1;\n var offset = 'skip' in opts ? opts.skip : 0;\n var inclusiveEnd = opts.inclusive_end !== false;\n \n var sqlArgs = [];\n var criteria = [];\n\n if (keys) {\n var destinctKeys = [];\n var bindingStr = \"\";\n keys.forEach(function (key) {\n if (destinctKeys.indexOf(key) === -1) {\n destinctKeys.push(key);\n bindingStr += '?,';\n }\n });\n bindingStr = bindingStr.substring(0, bindingStr.length - 1); // keys is never empty\n criteria.push(DOC_STORE$1 + '.id IN (' + bindingStr + ')');\n sqlArgs = sqlArgs.concat(destinctKeys);\n } else if (key !== false) {\n criteria.push(DOC_STORE$1 + '.id = ?');\n sqlArgs.push(key);\n } else if (start !== false || end !== false) {\n if (start !== false) {\n criteria.push(DOC_STORE$1 + '.id ' + (descending ? '<=' : '>=') + ' ?');\n sqlArgs.push(start);\n }\n if (end !== false) {\n var comparator = descending ? '>' : '<';\n if (inclusiveEnd) {\n comparator += '=';\n }\n criteria.push(DOC_STORE$1 + '.id ' + comparator + ' ?');\n sqlArgs.push(end);\n }\n if (key !== false) {\n criteria.push(DOC_STORE$1 + '.id = ?');\n sqlArgs.push(key);\n }\n }\n\n if (!keys) {\n // report deleted if keys are specified\n criteria.push(BY_SEQ_STORE$1 + '.deleted = 0');\n }\n\n db.readTransaction(function (tx) {\n // count the docs in parallel to other operations\n countDocs(tx, function (docCount) {\n totalRows = docCount;\n });\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n // get max sequence in parallel to other operations\n getMaxSeq(tx, function (theSeq) {\n updateSeq = theSeq;\n });\n }\n\n if (limit === 0) {\n return;\n }\n\n // do a single query to fetch the documents\n var sql = select(\n SELECT_DOCS,\n [DOC_STORE$1, BY_SEQ_STORE$1],\n DOC_STORE_AND_BY_SEQ_JOINER,\n criteria,\n DOC_STORE$1 + '.id ' + (descending ? 'DESC' : 'ASC')\n );\n sql += ' LIMIT ' + limit + ' OFFSET ' + offset;\n\n tx.executeSql(sql, sqlArgs, function (tx, result) {\n for (var i = 0, l = result.rows.length; i < l; i++) {\n var item = result.rows.item(i);\n var metadata = safeJsonParse(item.metadata);\n var id = metadata.id;\n var data = unstringifyDoc(item.data, id, item.rev);\n var winningRev$$1 = data._rev;\n var doc = {\n id: id,\n key: id,\n value: {rev: winningRev$$1}\n };\n if (opts.include_docs) {\n doc.doc = data;\n doc.doc._rev = winningRev$$1;\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n doc.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary$1(doc.doc, opts, api, tx);\n }\n if (item.deleted) {\n if (keys) {\n doc.value.deleted = true;\n doc.doc = null;\n } else {\n // propably should not happen\n continue;\n }\n }\n if (!keys) {\n results.push(doc);\n } else {\n var index = keys.indexOf(id, index);\n do {\n results[index] = doc;\n index = keys.indexOf(id, index + 1);\n } while (index > -1 && index < keys.length);\n }\n }\n if (keys) {\n keys.forEach(function (key, index) {\n if (!results[index]) {\n results[index] = {key: key, error: 'not_found'};\n }\n });\n }\n });\n }, websqlError(callback), function () {\n var returnVal = {\n total_rows: totalRows,\n offset: opts.skip,\n rows: results\n };\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n returnVal.update_seq = updateSeq;\n }\n callback(null, returnVal);\n });\n };\n\n api._changes = function (opts) {\n opts = clone(opts);\n\n if (opts.continuous) {\n var id = api._name + ':' + uuid();\n websqlChanges.addListener(api._name, id, api, opts);\n websqlChanges.notify(api._name);\n return {\n cancel: function () {\n websqlChanges.removeListener(api._name, id);\n }\n };\n }\n\n var descending = opts.descending;\n\n // Ignore the `since` parameter when `descending` is true\n opts.since = opts.since && !descending ? opts.since : 0;\n\n var limit = 'limit' in opts ? opts.limit : -1;\n if (limit === 0) {\n limit = 1; // per CouchDB _changes spec\n }\n\n var returnDocs;\n if ('return_docs' in opts) {\n returnDocs = opts.return_docs;\n } else if ('returnDocs' in opts) {\n // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release\n returnDocs = opts.returnDocs;\n } else {\n returnDocs = true;\n }\n var results = [];\n var numResults = 0;\n\n function fetchChanges() {\n\n var selectStmt =\n DOC_STORE$1 + '.json AS metadata, ' +\n DOC_STORE$1 + '.max_seq AS maxSeq, ' +\n BY_SEQ_STORE$1 + '.json AS winningDoc, ' +\n BY_SEQ_STORE$1 + '.rev AS winningRev ';\n\n var from = DOC_STORE$1 + ' JOIN ' + BY_SEQ_STORE$1;\n\n var joiner = DOC_STORE$1 + '.id=' + BY_SEQ_STORE$1 + '.doc_id' +\n ' AND ' + DOC_STORE$1 + '.winningseq=' + BY_SEQ_STORE$1 + '.seq';\n\n var criteria = ['maxSeq > ?'];\n var sqlArgs = [opts.since];\n\n if (opts.doc_ids) {\n criteria.push(DOC_STORE$1 + '.id IN ' + qMarks(opts.doc_ids.length));\n sqlArgs = sqlArgs.concat(opts.doc_ids);\n }\n\n var orderBy = 'maxSeq ' + (descending ? 'DESC' : 'ASC');\n\n var sql = select(selectStmt, from, joiner, criteria, orderBy);\n\n var filter = filterChange(opts);\n if (!opts.view && !opts.filter) {\n // we can just limit in the query\n sql += ' LIMIT ' + limit;\n }\n\n var lastSeq = opts.since || 0;\n db.readTransaction(function (tx) {\n tx.executeSql(sql, sqlArgs, function (tx, result) {\n function reportChange(change) {\n return function () {\n opts.onChange(change);\n };\n }\n for (var i = 0, l = result.rows.length; i < l; i++) {\n var item = result.rows.item(i);\n var metadata = safeJsonParse(item.metadata);\n lastSeq = item.maxSeq;\n\n var doc = unstringifyDoc(item.winningDoc, metadata.id,\n item.winningRev);\n var change = opts.processChange(doc, metadata, opts);\n change.seq = item.maxSeq;\n\n var filtered = filter(change);\n if (typeof filtered === 'object') {\n return opts.complete(filtered);\n }\n\n if (filtered) {\n numResults++;\n if (returnDocs) {\n results.push(change);\n }\n // process the attachment immediately\n // for the benefit of live listeners\n if (opts.attachments && opts.include_docs) {\n fetchAttachmentsIfNecessary$1(doc, opts, api, tx,\n reportChange(change));\n } else {\n reportChange(change)();\n }\n }\n if (numResults === limit) {\n break;\n }\n }\n });\n }, websqlError(opts.complete), function () {\n if (!opts.continuous) {\n opts.complete(null, {\n results: results,\n last_seq: lastSeq\n });\n }\n });\n }\n\n fetchChanges();\n };\n\n api._close = function (callback) {\n //WebSQL databases do not need to be closed\n callback();\n };\n\n api._getAttachment = function (docId, attachId, attachment, opts, callback) {\n var res;\n var tx = opts.ctx;\n var digest = attachment.digest;\n var type = attachment.content_type;\n var sql = 'SELECT escaped, ' +\n 'CASE WHEN escaped = 1 THEN body ELSE HEX(body) END AS body FROM ' +\n ATTACH_STORE$1 + ' WHERE digest=?';\n tx.executeSql(sql, [digest], function (tx, result) {\n // websql has a bug where \\u0000 causes early truncation in strings\n // and blobs. to work around this, we used to use the hex() function,\n // but that's not performant. after migration 6, we remove \\u0000\n // and add it back in afterwards\n var item = result.rows.item(0);\n var data = item.escaped ? unescapeBlob(item.body) :\n parseHexString(item.body, encoding);\n if (opts.binary) {\n res = binStringToBluffer(data, type);\n } else {\n res = thisBtoa(data);\n }\n callback(null, res);\n });\n };\n\n api._getRevisionTree = function (docId, callback) {\n db.readTransaction(function (tx) {\n var sql = 'SELECT json AS metadata FROM ' + DOC_STORE$1 + ' WHERE id = ?';\n tx.executeSql(sql, [docId], function (tx, result) {\n if (!result.rows.length) {\n callback(createError(MISSING_DOC));\n } else {\n var data = safeJsonParse(result.rows.item(0).metadata);\n callback(null, data.rev_tree);\n }\n });\n });\n };\n\n api._doCompaction = function (docId, revs, callback) {\n if (!revs.length) {\n return callback();\n }\n db.transaction(function (tx) {\n\n // update doc store\n var sql = 'SELECT json AS metadata FROM ' + DOC_STORE$1 + ' WHERE id = ?';\n tx.executeSql(sql, [docId], function (tx, result) {\n var metadata = safeJsonParse(result.rows.item(0).metadata);\n traverseRevTree(metadata.rev_tree, function (isLeaf, pos,\n revHash, ctx, opts) {\n var rev$$1 = pos + '-' + revHash;\n if (revs.indexOf(rev$$1) !== -1) {\n opts.status = 'missing';\n }\n });\n\n var sql = 'UPDATE ' + DOC_STORE$1 + ' SET json = ? WHERE id = ?';\n tx.executeSql(sql, [safeJsonStringify(metadata), docId]);\n });\n\n compactRevs$1(revs, docId, tx);\n }, websqlError(callback), function () {\n callback();\n });\n };\n\n api._getLocal = function (id, callback) {\n db.readTransaction(function (tx) {\n var sql = 'SELECT json, rev FROM ' + LOCAL_STORE$1 + ' WHERE id=?';\n tx.executeSql(sql, [id], function (tx, res) {\n if (res.rows.length) {\n var item = res.rows.item(0);\n var doc = unstringifyDoc(item.json, id, item.rev);\n callback(null, doc);\n } else {\n callback(createError(MISSING_DOC));\n }\n });\n });\n };\n\n api._putLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n delete doc._revisions; // ignore this, trust the rev\n var oldRev = doc._rev;\n var id = doc._id;\n var newRev;\n if (!oldRev) {\n newRev = doc._rev = '0-1';\n } else {\n newRev = doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1);\n }\n var json = stringifyDoc(doc);\n\n var ret;\n function putLocal(tx) {\n var sql;\n var values;\n if (oldRev) {\n sql = 'UPDATE ' + LOCAL_STORE$1 + ' SET rev=?, json=? ' +\n 'WHERE id=? AND rev=?';\n values = [newRev, json, id, oldRev];\n } else {\n sql = 'INSERT INTO ' + LOCAL_STORE$1 + ' (id, rev, json) VALUES (?,?,?)';\n values = [id, newRev, json];\n }\n tx.executeSql(sql, values, function (tx, res) {\n if (res.rowsAffected) {\n ret = {ok: true, id: id, rev: newRev};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n } else {\n callback(createError(REV_CONFLICT));\n }\n }, function () {\n callback(createError(REV_CONFLICT));\n return false; // ack that we handled the error\n });\n }\n\n if (opts.ctx) {\n putLocal(opts.ctx);\n } else {\n db.transaction(putLocal, websqlError(callback), function () {\n if (ret) {\n callback(null, ret);\n }\n });\n }\n };\n\n api._removeLocal = function (doc, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var ret;\n\n function removeLocal(tx) {\n var sql = 'DELETE FROM ' + LOCAL_STORE$1 + ' WHERE id=? AND rev=?';\n var params = [doc._id, doc._rev];\n tx.executeSql(sql, params, function (tx, res) {\n if (!res.rowsAffected) {\n return callback(createError(MISSING_DOC));\n }\n ret = {ok: true, id: doc._id, rev: '0-0'};\n if (opts.ctx) { // return immediately\n callback(null, ret);\n }\n });\n }\n\n if (opts.ctx) {\n removeLocal(opts.ctx);\n } else {\n db.transaction(removeLocal, websqlError(callback), function () {\n if (ret) {\n callback(null, ret);\n }\n });\n }\n };\n\n api._destroy = function (opts, callback) {\n websqlChanges.removeAllListeners(api._name);\n db.transaction(function (tx) {\n var stores = [DOC_STORE$1, BY_SEQ_STORE$1, ATTACH_STORE$1, META_STORE$1,\n LOCAL_STORE$1, ATTACH_AND_SEQ_STORE$1];\n stores.forEach(function (store) {\n tx.executeSql('DROP TABLE IF EXISTS ' + store, []);\n });\n }, websqlError(callback), function () {\n if (hasLocalStorage()) {\n delete window.localStorage['_pouch__websqldb_' + api._name];\n delete window.localStorage[api._name];\n }\n callback(null, {'ok': true});\n });\n };\n}\n\nfunction canOpenTestDB() {\n try {\n openDatabase('_pouch_validate_websql', 1, '', 1);\n return true;\n } catch (err) {\n return false;\n }\n}\n\n// WKWebView had a bug where WebSQL would throw a DOM Exception 18\n// (see https://bugs.webkit.org/show_bug.cgi?id=137760 and\n// https://github.com/pouchdb/pouchdb/issues/5079)\n// This has been fixed in latest WebKit, so we try to detect it here.\nfunction isValidWebSQL() {\n // WKWebView UA:\n // Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X)\n // AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13C75\n // Chrome for iOS UA:\n // Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en)\n // AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60\n // Mobile/9B206 Safari/7534.48.3\n // Firefox for iOS UA:\n // Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4\n // (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4\n\n // indexedDB is null on some UIWebViews and undefined in others\n // see: https://bugs.webkit.org/show_bug.cgi?id=137034\n if (typeof indexedDB === 'undefined' || indexedDB === null ||\n !/iP(hone|od|ad)/.test(navigator.userAgent)) {\n // definitely not WKWebView, avoid creating an unnecessary database\n return true;\n }\n // Cache the result in LocalStorage. Reason we do this is because if we\n // call openDatabase() too many times, Safari craps out in SauceLabs and\n // starts throwing DOM Exception 14s.\n var hasLS = hasLocalStorage();\n // Include user agent in the hash, so that if Safari is upgraded, we don't\n // continually think it's broken.\n var localStorageKey = '_pouch__websqldb_valid_' + navigator.userAgent;\n if (hasLS && localStorage[localStorageKey]) {\n return localStorage[localStorageKey] === '1';\n }\n var openedTestDB = canOpenTestDB();\n if (hasLS) {\n localStorage[localStorageKey] = openedTestDB ? '1' : '0';\n }\n return openedTestDB;\n}\n\nfunction valid() {\n if (typeof openDatabase !== 'function') {\n return false;\n }\n return isValidWebSQL();\n}\n\nfunction openDB$2(name, version, description, size) {\n // Traditional WebSQL API\n return openDatabase(name, version, description, size);\n}\n\nfunction WebSQLPouch(opts, callback) {\n var msg = 'WebSQL is deprecated and will be removed in future releases of PouchDB. ' +\n 'Please migrate to IndexedDB: https://pouchdb.com/2018/01/23/pouchdb-6.4.2.html';\n guardedConsole('warn', msg);\n var _opts = $inject_Object_assign({\n websql: openDB$2\n }, opts);\n\n WebSqlPouch.call(this, _opts, callback);\n}\n\nWebSQLPouch.valid = valid;\n\nWebSQLPouch.use_prefix = true;\n\nfunction WebSqlPouch$1 (PouchDB) {\n PouchDB.adapter('websql', WebSQLPouch, true);\n}\n\n/* global fetch */\n/* global Headers */\nfunction wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new PouchPromise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n PouchPromise.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n })[\"catch\"](function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n}\n\nfunction fetchRequest(options, callback) {\n var wrappedPromise, timer, response;\n\n var headers = new Headers();\n\n var fetchOptions = {\n method: options.method,\n credentials: 'include',\n headers: headers\n };\n\n if (options.json) {\n headers.set('Accept', 'application/json');\n headers.set('Content-Type', options.headers['Content-Type'] ||\n 'application/json');\n }\n\n if (options.body &&\n options.processData &&\n typeof options.body !== 'string') {\n fetchOptions.body = JSON.stringify(options.body);\n } else if ('body' in options) {\n fetchOptions.body = options.body;\n } else {\n fetchOptions.body = null;\n }\n\n Object.keys(options.headers).forEach(function (key) {\n if (options.headers.hasOwnProperty(key)) {\n headers.set(key, options.headers[key]);\n }\n });\n\n wrappedPromise = wrappedFetch(options.url, fetchOptions);\n\n if (options.timeout > 0) {\n timer = setTimeout(function () {\n wrappedPromise.reject(new Error('Load timeout for resource: ' +\n options.url));\n }, options.timeout);\n }\n\n wrappedPromise.promise.then(function (fetchResponse) {\n response = {\n statusCode: fetchResponse.status\n };\n\n if (options.timeout > 0) {\n clearTimeout(timer);\n }\n\n if (response.statusCode >= 200 && response.statusCode < 300) {\n return options.binary ? fetchResponse.blob() : fetchResponse.text();\n }\n\n return fetchResponse.json();\n }).then(function (result) {\n if (response.statusCode >= 200 && response.statusCode < 300) {\n callback(null, response, result);\n } else {\n result.status = response.statusCode;\n callback(result);\n }\n })[\"catch\"](function (error) {\n if (!error) {\n // this happens when the listener is canceled\n error = new Error('canceled');\n }\n callback(error);\n });\n\n return {abort: wrappedPromise.reject};\n}\n\nfunction xhRequest(options, callback) {\n\n var xhr, timer;\n var timedout = false;\n\n var abortReq = function () {\n xhr.abort();\n cleanUp();\n };\n\n var timeoutReq = function () {\n timedout = true;\n xhr.abort();\n cleanUp();\n };\n\n var ret = {abort: abortReq};\n\n var cleanUp = function () {\n clearTimeout(timer);\n ret.abort = function () {};\n if (xhr) {\n xhr.onprogress = undefined;\n if (xhr.upload) {\n xhr.upload.onprogress = undefined;\n }\n xhr.onreadystatechange = undefined;\n xhr = undefined;\n }\n };\n\n if (options.xhr) {\n xhr = new options.xhr();\n } else {\n xhr = new XMLHttpRequest();\n }\n\n try {\n xhr.open(options.method, options.url);\n } catch (exception) {\n return callback(new Error(exception.name || 'Url is invalid'));\n }\n\n xhr.withCredentials = ('withCredentials' in options) ?\n options.withCredentials : true;\n\n if (options.method === 'GET') {\n delete options.headers['Content-Type'];\n } else if (options.json) {\n options.headers.Accept = 'application/json';\n options.headers['Content-Type'] = options.headers['Content-Type'] ||\n 'application/json';\n if (options.body &&\n options.processData &&\n typeof options.body !== \"string\") {\n options.body = JSON.stringify(options.body);\n }\n }\n\n if (options.binary) {\n xhr.responseType = 'arraybuffer';\n }\n\n if (!('body' in options)) {\n options.body = null;\n }\n\n for (var key in options.headers) {\n if (options.headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, options.headers[key]);\n }\n }\n\n if (options.timeout > 0) {\n timer = setTimeout(timeoutReq, options.timeout);\n xhr.onprogress = function () {\n clearTimeout(timer);\n if (xhr.readyState !== 4) {\n timer = setTimeout(timeoutReq, options.timeout);\n }\n };\n if (typeof xhr.upload !== 'undefined') { // does not exist in ie9\n xhr.upload.onprogress = xhr.onprogress;\n }\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState !== 4) {\n return;\n }\n\n var response = {\n statusCode: xhr.status\n };\n\n if (xhr.status >= 200 && xhr.status < 300) {\n var data;\n if (options.binary) {\n data = createBlob([xhr.response || ''], {\n type: xhr.getResponseHeader('Content-Type')\n });\n } else {\n data = xhr.responseText;\n }\n callback(null, response, data);\n } else {\n var err = {};\n if (timedout) {\n err = new Error('ETIMEDOUT');\n err.code = 'ETIMEDOUT';\n } else if (typeof xhr.response === 'string' && xhr.response !== '') {\n try {\n err = JSON.parse(xhr.response);\n } catch (e) {}\n }\n\n err.status = xhr.status;\n\n callback(err);\n }\n cleanUp();\n };\n\n if (options.body && (options.body instanceof Blob)) {\n readAsArrayBuffer(options.body, function (arrayBuffer) {\n xhr.send(arrayBuffer);\n });\n } else {\n xhr.send(options.body);\n }\n\n return ret;\n}\n\nfunction testXhr() {\n try {\n new XMLHttpRequest();\n return true;\n } catch (err) {\n return false;\n }\n}\n\nvar hasXhr = testXhr();\n\nfunction ajax(options, callback) {\n if (!false && (hasXhr || options.xhr)) {\n return xhRequest(options, callback);\n } else {\n return fetchRequest(options, callback);\n }\n}\n\n// the blob already has a type; do nothing\n\nfunction defaultBody() {\n return '';\n}\n\nfunction ajaxCore(options, callback) {\n\n options = clone(options);\n\n var defaultOptions = {\n method : \"GET\",\n headers: {},\n json: true,\n processData: true,\n timeout: 10000,\n cache: false\n };\n\n options = $inject_Object_assign(defaultOptions, options);\n\n function onSuccess(obj, resp, cb) {\n if (!options.binary && options.json && typeof obj === 'string') {\n /* istanbul ignore next */\n try {\n obj = JSON.parse(obj);\n } catch (e) {\n // Probably a malformed JSON from server\n return cb(e);\n }\n }\n if (Array.isArray(obj)) {\n obj = obj.map(function (v) {\n if (v.error || v.missing) {\n return generateErrorFromResponse(v);\n } else {\n return v;\n }\n });\n }\n if (options.binary) {\n \n }\n cb(null, obj, resp);\n }\n\n if (options.json) {\n if (!options.binary) {\n options.headers.Accept = 'application/json';\n }\n options.headers['Content-Type'] = options.headers['Content-Type'] ||\n 'application/json';\n }\n\n if (options.binary) {\n options.encoding = null;\n options.json = false;\n }\n\n if (!options.processData) {\n options.json = false;\n }\n\n return ajax(options, function (err, response, body) {\n\n if (err) {\n return callback(generateErrorFromResponse(err));\n }\n\n var error;\n var content_type = response.headers && response.headers['content-type'];\n var data = body || defaultBody();\n\n // CouchDB doesn't always return the right content-type for JSON data, so\n // we check for ^{ and }$ (ignoring leading/trailing whitespace)\n if (!options.binary && (options.json || !options.processData) &&\n typeof data !== 'object' &&\n (/json/.test(content_type) ||\n (/^[\\s]*\\{/.test(data) && /\\}[\\s]*$/.test(data)))) {\n try {\n data = JSON.parse(data.toString());\n } catch (e) {}\n }\n\n if (response.statusCode >= 200 && response.statusCode < 300) {\n onSuccess(data, response, callback);\n } else {\n error = generateErrorFromResponse(data);\n error.status = response.statusCode;\n callback(error);\n }\n });\n}\n\nfunction ajax$1(opts, callback) {\n\n // cache-buster, specifically designed to work around IE's aggressive caching\n // see http://www.dashbay.com/2011/05/internet-explorer-caches-ajax/\n // Also Safari caches POSTs, so we need to cache-bust those too.\n var ua = (navigator && navigator.userAgent) ?\n navigator.userAgent.toLowerCase() : '';\n\n var isSafari = ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1;\n var isIE = ua.indexOf('msie') !== -1;\n var isTrident = ua.indexOf('trident') !== -1;\n var isEdge = ua.indexOf('edge') !== -1;\n\n // it appears the new version of safari also caches GETs,\n // see https://github.com/pouchdb/pouchdb/issues/5010\n var shouldCacheBust = (isSafari ||\n ((isIE || isTrident || isEdge) && opts.method === 'GET'));\n\n var cache = 'cache' in opts ? opts.cache : true;\n\n var isBlobUrl = /^blob:/.test(opts.url); // don't append nonces for blob URLs\n\n if (!isBlobUrl && (shouldCacheBust || !cache)) {\n var hasArgs = opts.url.indexOf('?') !== -1;\n opts.url += (hasArgs ? '&' : '?') + '_nonce=' + Date.now();\n }\n\n return ajaxCore(opts, callback);\n}\n\n// dead simple promise pool, inspired by https://github.com/timdp/es6-promise-pool\n// but much smaller in code size. limits the number of concurrent promises that are executed\n\n\nfunction pool(promiseFactories, limit) {\n return new PouchPromise(function (resolve, reject) {\n var running = 0;\n var current = 0;\n var done = 0;\n var len = promiseFactories.length;\n var err;\n\n function runNext() {\n running++;\n promiseFactories[current++]().then(onSuccess, onError);\n }\n\n function doNext() {\n if (++done === len) {\n /* istanbul ignore if */\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n } else {\n runNextBatch();\n }\n }\n\n function onSuccess() {\n running--;\n doNext();\n }\n\n /* istanbul ignore next */\n function onError(thisErr) {\n running--;\n err = err || thisErr;\n doNext();\n }\n\n function runNextBatch() {\n while (running < limit && current < len) {\n runNext();\n }\n }\n\n runNextBatch();\n });\n}\n\nvar CHANGES_BATCH_SIZE = 25;\nvar MAX_SIMULTANEOUS_REVS = 50;\nvar CHANGES_TIMEOUT_BUFFER = 5000;\nvar DEFAULT_HEARTBEAT = 10000;\n\nvar supportsBulkGetMap = {};\n\nfunction readAttachmentsAsBlobOrBuffer(row) {\n var doc = row.doc || row.ok;\n var atts = doc._attachments;\n if (!atts) {\n return;\n }\n Object.keys(atts).forEach(function (filename) {\n var att = atts[filename];\n att.data = b64ToBluffer(att.data, att.content_type);\n });\n}\n\nfunction encodeDocId(id) {\n if (/^_design/.test(id)) {\n return '_design/' + encodeURIComponent(id.slice(8));\n }\n if (/^_local/.test(id)) {\n return '_local/' + encodeURIComponent(id.slice(7));\n }\n return encodeURIComponent(id);\n}\n\nfunction preprocessAttachments$2(doc) {\n if (!doc._attachments || !Object.keys(doc._attachments)) {\n return PouchPromise.resolve();\n }\n\n return PouchPromise.all(Object.keys(doc._attachments).map(function (key) {\n var attachment = doc._attachments[key];\n if (attachment.data && typeof attachment.data !== 'string') {\n return new PouchPromise(function (resolve) {\n blobToBase64(attachment.data, resolve);\n }).then(function (b64) {\n attachment.data = b64;\n });\n }\n }));\n}\n\nfunction hasUrlPrefix(opts) {\n if (!opts.prefix) {\n return false;\n }\n\n var protocol = parseUri(opts.prefix).protocol;\n\n return protocol === 'http' || protocol === 'https';\n}\n\n// Get all the information you possibly can about the URI given by name and\n// return it as a suitable object.\nfunction getHost(name, opts) {\n\n // encode db name if opts.prefix is a url (#5574)\n if (hasUrlPrefix(opts)) {\n var dbName = opts.name.substr(opts.prefix.length);\n name = opts.prefix + encodeURIComponent(dbName);\n }\n\n // Prase the URI into all its little bits\n var uri = parseUri(name);\n\n // Store the user and password as a separate auth object\n if (uri.user || uri.password) {\n uri.auth = {username: uri.user, password: uri.password};\n }\n\n // Split the path part of the URI into parts using '/' as the delimiter\n // after removing any leading '/' and any trailing '/'\n var parts = uri.path.replace(/(^\\/|\\/$)/g, '').split('/');\n\n // Store the first part as the database name and remove it from the parts\n // array\n uri.db = parts.pop();\n // Prevent double encoding of URI component\n if (uri.db.indexOf('%') === -1) {\n uri.db = encodeURIComponent(uri.db);\n }\n\n // Restore the path by joining all the remaining parts (all the parts\n // except for the database name) with '/'s\n uri.path = parts.join('/');\n\n return uri;\n}\n\n// Generate a URL with the host data given by opts and the given path\nfunction genDBUrl(opts, path) {\n return genUrl(opts, opts.db + '/' + path);\n}\n\n// Generate a URL with the host data given by opts and the given path\nfunction genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}\n\nfunction paramsToStr(params) {\n return '?' + Object.keys(params).map(function (k) {\n return k + '=' + encodeURIComponent(params[k]);\n }).join('&');\n}\n\n// Implements the PouchDB API for dealing with CouchDB instances over HTTP\nfunction HttpPouch(opts, callback) {\n\n // The functions that will be publicly available for HttpPouch\n var api = this;\n\n var host = getHost(opts.name, opts);\n var dbUrl = genDBUrl(host, '');\n\n opts = clone(opts);\n var ajaxOpts = opts.ajax || {};\n\n if (opts.auth || host.auth) {\n var nAuth = opts.auth || host.auth;\n var str = nAuth.username + ':' + nAuth.password;\n var token = thisBtoa(unescape(encodeURIComponent(str)));\n ajaxOpts.headers = ajaxOpts.headers || {};\n ajaxOpts.headers.Authorization = 'Basic ' + token;\n }\n\n // Not strictly necessary, but we do this because numerous tests\n // rely on swapping ajax in and out.\n api._ajax = ajax$1;\n\n function ajax(userOpts, options, callback) {\n var reqAjax = (userOpts || {}).ajax || {};\n var reqOpts = $inject_Object_assign(clone(ajaxOpts), reqAjax, options);\n var defaultHeaders = clone(ajaxOpts.headers || {});\n reqOpts.headers = $inject_Object_assign(defaultHeaders, reqAjax.headers,\n options.headers || {});\n /* istanbul ignore if */\n if (api.constructor.listeners('debug').length) {\n api.constructor.emit('debug', ['http', reqOpts.method, reqOpts.url]);\n }\n return api._ajax(reqOpts, callback);\n }\n\n function ajaxPromise(userOpts, opts) {\n return new PouchPromise(function (resolve, reject) {\n ajax(userOpts, opts, function (err, res) {\n /* istanbul ignore if */\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }\n\n function adapterFun$$1(name, fun) {\n return adapterFun(name, getArguments(function (args) {\n setup().then(function () {\n return fun.apply(this, args);\n })[\"catch\"](function (e) {\n var callback = args.pop();\n callback(e);\n });\n }));\n }\n\n var setupPromise;\n\n function setup() {\n // TODO: Remove `skipSetup` in favor of `skip_setup` in a future release\n if (opts.skipSetup || opts.skip_setup) {\n return PouchPromise.resolve();\n }\n\n // If there is a setup in process or previous successful setup\n // done then we will use that\n // If previous setups have been rejected we will try again\n if (setupPromise) {\n return setupPromise;\n }\n\n var checkExists = {method: 'GET', url: dbUrl};\n setupPromise = ajaxPromise({}, checkExists)[\"catch\"](function (err) {\n if (err && err.status && err.status === 404) {\n // Doesnt exist, create it\n explainError(404, 'PouchDB is just detecting if the remote exists.');\n return ajaxPromise({}, {method: 'PUT', url: dbUrl});\n } else {\n return PouchPromise.reject(err);\n }\n })[\"catch\"](function (err) {\n // If we try to create a database that already exists, skipped in\n // istanbul since its catching a race condition.\n /* istanbul ignore if */\n if (err && err.status && err.status === 412) {\n return true;\n }\n return PouchPromise.reject(err);\n });\n\n setupPromise[\"catch\"](function () {\n setupPromise = null;\n });\n\n return setupPromise;\n }\n\n nextTick(function () {\n callback(null, api);\n });\n\n api._remote = true;\n /* istanbul ignore next */\n api.type = function () {\n return 'http';\n };\n\n api.id = adapterFun$$1('id', function (callback) {\n ajax({}, {method: 'GET', url: genUrl(host, '')}, function (err, result) {\n var uuid$$1 = (result && result.uuid) ?\n (result.uuid + host.db) : genDBUrl(host, '');\n callback(null, uuid$$1);\n });\n });\n\n api.request = adapterFun$$1('request', function (options, callback) {\n options.url = genDBUrl(host, options.url);\n ajax({}, options, callback);\n });\n\n // Sends a POST request to the host calling the couchdb _compact function\n // version: The version of CouchDB it is running\n api.compact = adapterFun$$1('compact', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = clone(opts);\n ajax(opts, {\n url: genDBUrl(host, '_compact'),\n method: 'POST'\n }, function () {\n function ping() {\n api.info(function (err, res) {\n // CouchDB may send a \"compact_running:true\" if it's\n // already compacting. PouchDB Server doesn't.\n /* istanbul ignore else */\n if (res && !res.compact_running) {\n callback(null, {ok: true});\n } else {\n setTimeout(ping, opts.interval || 200);\n }\n });\n }\n // Ping the http if it's finished compaction\n ping();\n });\n });\n\n api.bulkGet = adapterFun('bulkGet', function (opts, callback) {\n var self = this;\n\n function doBulkGet(cb) {\n var params = {};\n if (opts.revs) {\n params.revs = true;\n }\n if (opts.attachments) {\n /* istanbul ignore next */\n params.attachments = true;\n }\n if (opts.latest) {\n params.latest = true;\n }\n ajax(opts, {\n url: genDBUrl(host, '_bulk_get' + paramsToStr(params)),\n method: 'POST',\n body: { docs: opts.docs}\n }, function (err, result) {\n if (!err && opts.attachments && opts.binary) {\n result.results.forEach(function (res) {\n res.docs.forEach(readAttachmentsAsBlobOrBuffer);\n });\n }\n cb(err, result);\n });\n }\n\n /* istanbul ignore next */\n function doBulkGetShim() {\n // avoid \"url too long error\" by splitting up into multiple requests\n var batchSize = MAX_SIMULTANEOUS_REVS;\n var numBatches = Math.ceil(opts.docs.length / batchSize);\n var numDone = 0;\n var results = new Array(numBatches);\n\n function onResult(batchNum) {\n return function (err, res) {\n // err is impossible because shim returns a list of errs in that case\n results[batchNum] = res.results;\n if (++numDone === numBatches) {\n callback(null, {results: flatten(results)});\n }\n };\n }\n\n for (var i = 0; i < numBatches; i++) {\n var subOpts = pick(opts, ['revs', 'attachments', 'binary', 'latest']);\n subOpts.ajax = ajaxOpts;\n subOpts.docs = opts.docs.slice(i * batchSize,\n Math.min(opts.docs.length, (i + 1) * batchSize));\n bulkGet(self, subOpts, onResult(i));\n }\n }\n\n // mark the whole database as either supporting or not supporting _bulk_get\n var dbUrl = genUrl(host, '');\n var supportsBulkGet = supportsBulkGetMap[dbUrl];\n\n /* istanbul ignore next */\n if (typeof supportsBulkGet !== 'boolean') {\n // check if this database supports _bulk_get\n doBulkGet(function (err, res) {\n if (err) {\n supportsBulkGetMap[dbUrl] = false;\n explainError(\n err.status,\n 'PouchDB is just detecting if the remote ' +\n 'supports the _bulk_get API.'\n );\n doBulkGetShim();\n } else {\n supportsBulkGetMap[dbUrl] = true;\n callback(null, res);\n }\n });\n } else if (supportsBulkGet) {\n doBulkGet(callback);\n } else {\n doBulkGetShim();\n }\n });\n\n // Calls GET on the host, which gets back a JSON string containing\n // couchdb: A welcome string\n // version: The version of CouchDB it is running\n api._info = function (callback) {\n setup().then(function () {\n ajax({}, {\n method: 'GET',\n url: genDBUrl(host, '')\n }, function (err, res) {\n /* istanbul ignore next */\n if (err) {\n return callback(err);\n }\n res.host = genDBUrl(host, '');\n callback(null, res);\n });\n })[\"catch\"](callback);\n };\n\n // Get the document with the given id from the database given by host.\n // The id could be solely the _id in the database, or it may be a\n // _design/ID or _local/ID path\n api.get = adapterFun$$1('get', function (id, opts, callback) {\n // If no options were given, set the callback to the second parameter\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = clone(opts);\n\n // List of parameters to add to the GET request\n var params = {};\n\n if (opts.revs) {\n params.revs = true;\n }\n\n if (opts.revs_info) {\n params.revs_info = true;\n }\n\n if (opts.latest) {\n params.latest = true;\n }\n\n if (opts.open_revs) {\n if (opts.open_revs !== \"all\") {\n opts.open_revs = JSON.stringify(opts.open_revs);\n }\n params.open_revs = opts.open_revs;\n }\n\n if (opts.rev) {\n params.rev = opts.rev;\n }\n\n if (opts.conflicts) {\n params.conflicts = opts.conflicts;\n }\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n params.update_seq = opts.update_seq;\n }\n\n id = encodeDocId(id);\n\n // Set the options for the ajax call\n var options = {\n method: 'GET',\n url: genDBUrl(host, id + paramsToStr(params))\n };\n\n function fetchAttachments(doc) {\n var atts = doc._attachments;\n var filenames = atts && Object.keys(atts);\n if (!atts || !filenames.length) {\n return;\n }\n // we fetch these manually in separate XHRs, because\n // Sync Gateway would normally send it back as multipart/mixed,\n // which we cannot parse. Also, this is more efficient than\n // receiving attachments as base64-encoded strings.\n function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }\n\n var promiseFactories = filenames.map(function (filename) {\n return function () {\n return fetch(filename);\n };\n });\n\n // This limits the number of parallel xhr requests to 5 any time\n // to avoid issues with maximum browser request limits\n return pool(promiseFactories, 5);\n }\n\n function fetchAllAttachments(docOrDocs) {\n if (Array.isArray(docOrDocs)) {\n return PouchPromise.all(docOrDocs.map(function (doc) {\n if (doc.ok) {\n return fetchAttachments(doc.ok);\n }\n }));\n }\n return fetchAttachments(docOrDocs);\n }\n\n ajaxPromise(opts, options).then(function (res) {\n return PouchPromise.resolve().then(function () {\n if (opts.attachments) {\n return fetchAllAttachments(res);\n }\n }).then(function () {\n callback(null, res);\n });\n })[\"catch\"](function (e) {\n e.docId = id;\n callback(e);\n });\n });\n\n // Delete the document given by doc from the database given by host.\n api.remove = adapterFun$$1('remove',\n function (docOrId, optsOrRev, opts, callback) {\n var doc;\n if (typeof optsOrRev === 'string') {\n // id, rev, opts, callback style\n doc = {\n _id: docOrId,\n _rev: optsOrRev\n };\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n } else {\n // doc, opts, callback style\n doc = docOrId;\n if (typeof optsOrRev === 'function') {\n callback = optsOrRev;\n opts = {};\n } else {\n callback = opts;\n opts = optsOrRev;\n }\n }\n\n var rev$$1 = (doc._rev || opts.rev);\n\n // Delete the document\n ajax(opts, {\n method: 'DELETE',\n url: genDBUrl(host, encodeDocId(doc._id)) + '?rev=' + rev$$1\n }, callback);\n });\n\n function encodeAttachmentId(attachmentId) {\n return attachmentId.split(\"/\").map(encodeURIComponent).join(\"/\");\n }\n\n // Get the attachment\n api.getAttachment =\n adapterFun$$1('getAttachment', function (docId, attachmentId, opts,\n callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n var params = opts.rev ? ('?rev=' + opts.rev) : '';\n var url = genDBUrl(host, encodeDocId(docId)) + '/' +\n encodeAttachmentId(attachmentId) + params;\n ajax(opts, {\n method: 'GET',\n url: url,\n binary: true\n }, callback);\n });\n\n // Remove the attachment given by the id and rev\n api.removeAttachment =\n adapterFun$$1('removeAttachment', function (docId, attachmentId, rev$$1,\n callback) {\n\n var url = genDBUrl(host, encodeDocId(docId) + '/' +\n encodeAttachmentId(attachmentId)) + '?rev=' + rev$$1;\n\n ajax({}, {\n method: 'DELETE',\n url: url\n }, callback);\n });\n\n // Add the attachment given by blob and its contentType property\n // to the document with the given id, the revision given by rev, and\n // add it to the database given by host.\n api.putAttachment =\n adapterFun$$1('putAttachment', function (docId, attachmentId, rev$$1, blob,\n type, callback) {\n if (typeof type === 'function') {\n callback = type;\n type = blob;\n blob = rev$$1;\n rev$$1 = null;\n }\n var id = encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId);\n var url = genDBUrl(host, id);\n if (rev$$1) {\n url += '?rev=' + rev$$1;\n }\n\n if (typeof blob === 'string') {\n // input is assumed to be a base64 string\n var binary;\n try {\n binary = thisAtob(blob);\n } catch (err) {\n return callback(createError(BAD_ARG,\n 'Attachment is not a valid base64 string'));\n }\n blob = binary ? binStringToBluffer(binary, type) : '';\n }\n\n var opts = {\n headers: {'Content-Type': type},\n method: 'PUT',\n url: url,\n processData: false,\n body: blob,\n timeout: ajaxOpts.timeout || 60000\n };\n // Add the attachment\n ajax({}, opts, callback);\n });\n\n // Update/create multiple documents given by req in the database\n // given by host.\n api._bulkDocs = function (req, opts, callback) {\n // If new_edits=false then it prevents the database from creating\n // new revision numbers for the documents. Instead it just uses\n // the old ones. This is used in database replication.\n req.new_edits = opts.new_edits;\n\n setup().then(function () {\n return PouchPromise.all(req.docs.map(preprocessAttachments$2));\n }).then(function () {\n // Update/create the documents\n ajax(opts, {\n method: 'POST',\n url: genDBUrl(host, '_bulk_docs'),\n timeout: opts.timeout,\n body: req\n }, function (err, results) {\n if (err) {\n return callback(err);\n }\n results.forEach(function (result) {\n result.ok = true; // smooths out cloudant not adding this\n });\n callback(null, results);\n });\n })[\"catch\"](callback);\n };\n\n\n // Update/create document\n api._put = function (doc, opts, callback) {\n setup().then(function () {\n return preprocessAttachments$2(doc);\n }).then(function () {\n // Update/create the document\n ajax(opts, {\n method: 'PUT',\n url: genDBUrl(host, encodeDocId(doc._id)),\n body: doc\n }, function (err, result) {\n if (err) {\n err.docId = doc && doc._id;\n return callback(err);\n }\n callback(null, result);\n });\n })[\"catch\"](callback);\n };\n\n\n // Get a listing of the documents in the database given\n // by host and ordered by increasing id.\n api.allDocs = adapterFun$$1('allDocs', function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = clone(opts);\n\n // List of parameters to add to the GET request\n var params = {};\n var body;\n var method = 'GET';\n\n if (opts.conflicts) {\n params.conflicts = true;\n }\n\n /* istanbul ignore if */\n if (opts.update_seq) {\n params.update_seq = true;\n }\n\n if (opts.descending) {\n params.descending = true;\n }\n\n if (opts.include_docs) {\n params.include_docs = true;\n }\n\n // added in CouchDB 1.6.0\n if (opts.attachments) {\n params.attachments = true;\n }\n\n if (opts.key) {\n params.key = JSON.stringify(opts.key);\n }\n\n if (opts.start_key) {\n opts.startkey = opts.start_key;\n }\n\n if (opts.startkey) {\n params.startkey = JSON.stringify(opts.startkey);\n }\n\n if (opts.end_key) {\n opts.endkey = opts.end_key;\n }\n\n if (opts.endkey) {\n params.endkey = JSON.stringify(opts.endkey);\n }\n\n if (typeof opts.inclusive_end !== 'undefined') {\n params.inclusive_end = !!opts.inclusive_end;\n }\n\n if (typeof opts.limit !== 'undefined') {\n params.limit = opts.limit;\n }\n\n if (typeof opts.skip !== 'undefined') {\n params.skip = opts.skip;\n }\n\n var paramStr = paramsToStr(params);\n\n if (typeof opts.keys !== 'undefined') {\n method = 'POST';\n body = {keys: opts.keys};\n }\n\n // Get the document listing\n ajaxPromise(opts, {\n method: method,\n url: genDBUrl(host, '_all_docs' + paramStr),\n body: body\n }).then(function (res) {\n if (opts.include_docs && opts.attachments && opts.binary) {\n res.rows.forEach(readAttachmentsAsBlobOrBuffer);\n }\n callback(null, res);\n })[\"catch\"](callback);\n });\n\n // Get a list of changes made to documents in the database given by host.\n // TODO According to the README, there should be two other methods here,\n // api.changes.addListener and api.changes.removeListener.\n api._changes = function (opts) {\n\n // We internally page the results of a changes request, this means\n // if there is a large set of changes to be returned we can start\n // processing them quicker instead of waiting on the entire\n // set of changes to return and attempting to process them at once\n var batchSize = 'batch_size' in opts ? opts.batch_size : CHANGES_BATCH_SIZE;\n\n opts = clone(opts);\n\n if (opts.continuous && !('heartbeat' in opts)) {\n opts.heartbeat = DEFAULT_HEARTBEAT;\n }\n\n var requestTimeout = ('timeout' in opts) ? opts.timeout :\n ('timeout' in ajaxOpts) ? ajaxOpts.timeout :\n 30 * 1000;\n\n // ensure CHANGES_TIMEOUT_BUFFER applies\n if ('timeout' in opts && opts.timeout &&\n (requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) {\n requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER;\n }\n\n if ('heartbeat' in opts && opts.heartbeat &&\n (requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) {\n requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER;\n }\n\n var params = {};\n if ('timeout' in opts && opts.timeout) {\n params.timeout = opts.timeout;\n }\n\n var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false;\n var returnDocs;\n if ('return_docs' in opts) {\n returnDocs = opts.return_docs;\n } else if ('returnDocs' in opts) {\n // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release\n returnDocs = opts.returnDocs;\n } else {\n returnDocs = true;\n }\n //\n var leftToFetch = limit;\n\n if (opts.style) {\n params.style = opts.style;\n }\n\n if (opts.include_docs || opts.filter && typeof opts.filter === 'function') {\n params.include_docs = true;\n }\n\n if (opts.attachments) {\n params.attachments = true;\n }\n\n if (opts.continuous) {\n params.feed = 'longpoll';\n }\n\n if (opts.seq_interval) {\n params.seq_interval = opts.seq_interval;\n }\n\n if (opts.conflicts) {\n params.conflicts = true;\n }\n\n if (opts.descending) {\n params.descending = true;\n }\n \n /* istanbul ignore if */\n if (opts.update_seq) {\n params.update_seq = true;\n }\n\n if ('heartbeat' in opts) {\n // If the heartbeat value is false, it disables the default heartbeat\n if (opts.heartbeat) {\n params.heartbeat = opts.heartbeat;\n }\n }\n\n if (opts.filter && typeof opts.filter === 'string') {\n params.filter = opts.filter;\n }\n\n if (opts.view && typeof opts.view === 'string') {\n params.filter = '_view';\n params.view = opts.view;\n }\n\n // If opts.query_params exists, pass it through to the changes request.\n // These parameters may be used by the filter on the source database.\n if (opts.query_params && typeof opts.query_params === 'object') {\n for (var param_name in opts.query_params) {\n /* istanbul ignore else */\n if (opts.query_params.hasOwnProperty(param_name)) {\n params[param_name] = opts.query_params[param_name];\n }\n }\n }\n\n var method = 'GET';\n var body;\n\n if (opts.doc_ids) {\n // set this automagically for the user; it's annoying that couchdb\n // requires both a \"filter\" and a \"doc_ids\" param.\n params.filter = '_doc_ids';\n method = 'POST';\n body = {doc_ids: opts.doc_ids };\n }\n /* istanbul ignore next */\n else if (opts.selector) {\n // set this automagically for the user, similar to above\n params.filter = '_selector';\n method = 'POST';\n body = {selector: opts.selector };\n }\n\n var xhr;\n var lastFetchedSeq;\n\n // Get all the changes starting wtih the one immediately after the\n // sequence number given by since.\n var fetch = function (since, callback) {\n if (opts.aborted) {\n return;\n }\n params.since = since;\n // \"since\" can be any kind of json object in Coudant/CouchDB 2.x\n /* istanbul ignore next */\n if (typeof params.since === \"object\") {\n params.since = JSON.stringify(params.since);\n }\n\n if (opts.descending) {\n if (limit) {\n params.limit = leftToFetch;\n }\n } else {\n params.limit = (!limit || leftToFetch > batchSize) ?\n batchSize : leftToFetch;\n }\n\n // Set the options for the ajax call\n var xhrOpts = {\n method: method,\n url: genDBUrl(host, '_changes' + paramsToStr(params)),\n timeout: requestTimeout,\n body: body\n };\n lastFetchedSeq = since;\n\n /* istanbul ignore if */\n if (opts.aborted) {\n return;\n }\n\n // Get the changes\n setup().then(function () {\n xhr = ajax(opts, xhrOpts, callback);\n })[\"catch\"](callback);\n };\n\n // If opts.since exists, get all the changes from the sequence\n // number given by opts.since. Otherwise, get all the changes\n // from the sequence number 0.\n var results = {results: []};\n\n var fetched = function (err, res) {\n if (opts.aborted) {\n return;\n }\n var raw_results_length = 0;\n // If the result of the ajax call (res) contains changes (res.results)\n if (res && res.results) {\n raw_results_length = res.results.length;\n results.last_seq = res.last_seq;\n var pending = null;\n var lastSeq = null;\n // Attach 'pending' property if server supports it (CouchDB 2.0+)\n /* istanbul ignore if */\n if (typeof res.pending === 'number') {\n pending = res.pending;\n }\n if (typeof results.last_seq === 'string' || typeof results.last_seq === 'number') {\n lastSeq = results.last_seq;\n }\n // For each change\n var req = {};\n req.query = opts.query_params;\n res.results = res.results.filter(function (c) {\n leftToFetch--;\n var ret = filterChange(opts)(c);\n if (ret) {\n if (opts.include_docs && opts.attachments && opts.binary) {\n readAttachmentsAsBlobOrBuffer(c);\n }\n if (returnDocs) {\n results.results.push(c);\n }\n opts.onChange(c, pending, lastSeq);\n }\n return ret;\n });\n } else if (err) {\n // In case of an error, stop listening for changes and call\n // opts.complete\n opts.aborted = true;\n opts.complete(err);\n return;\n }\n\n // The changes feed may have timed out with no results\n // if so reuse last update sequence\n if (res && res.last_seq) {\n lastFetchedSeq = res.last_seq;\n }\n\n var finished = (limit && leftToFetch <= 0) ||\n (res && raw_results_length < batchSize) ||\n (opts.descending);\n\n if ((opts.continuous && !(limit && leftToFetch <= 0)) || !finished) {\n // Queue a call to fetch again with the newest sequence number\n nextTick(function () { fetch(lastFetchedSeq, fetched); });\n } else {\n // We're done, call the callback\n opts.complete(null, results);\n }\n };\n\n fetch(opts.since || 0, fetched);\n\n // Return a method to cancel this method from processing any more\n return {\n cancel: function () {\n opts.aborted = true;\n if (xhr) {\n xhr.abort();\n }\n }\n };\n };\n\n // Given a set of document/revision IDs (given by req), tets the subset of\n // those that do NOT correspond to revisions stored in the database.\n // See http://wiki.apache.org/couchdb/HttpPostRevsDiff\n api.revsDiff = adapterFun$$1('revsDiff', function (req, opts, callback) {\n // If no options were given, set the callback to be the second parameter\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n // Get the missing document/revision IDs\n ajax(opts, {\n method: 'POST',\n url: genDBUrl(host, '_revs_diff'),\n body: req\n }, callback);\n });\n\n api._close = function (callback) {\n callback();\n };\n\n api._destroy = function (options, callback) {\n ajax(options, {\n url: genDBUrl(host, ''),\n method: 'DELETE'\n }, function (err, resp) {\n if (err && err.status && err.status !== 404) {\n return callback(err);\n }\n callback(null, resp);\n });\n };\n}\n\n// HttpPouch is a valid adapter.\nHttpPouch.valid = function () {\n return true;\n};\n\nfunction HttpPouch$1 (PouchDB) {\n PouchDB.adapter('http', HttpPouch, false);\n PouchDB.adapter('https', HttpPouch, false);\n}\n\nfunction QueryParseError(message) {\n this.status = 400;\n this.name = 'query_parse_error';\n this.message = message;\n this.error = true;\n try {\n Error.captureStackTrace(this, QueryParseError);\n } catch (e) {}\n}\n\ninherits(QueryParseError, Error);\n\nfunction NotFoundError(message) {\n this.status = 404;\n this.name = 'not_found';\n this.message = message;\n this.error = true;\n try {\n Error.captureStackTrace(this, NotFoundError);\n } catch (e) {}\n}\n\ninherits(NotFoundError, Error);\n\nfunction BuiltInError(message) {\n this.status = 500;\n this.name = 'invalid_value';\n this.message = message;\n this.error = true;\n try {\n Error.captureStackTrace(this, BuiltInError);\n } catch (e) {}\n}\n\ninherits(BuiltInError, Error);\n\nfunction promisedCallback(promise, callback) {\n if (callback) {\n promise.then(function (res) {\n nextTick(function () {\n callback(null, res);\n });\n }, function (reason) {\n nextTick(function () {\n callback(reason);\n });\n });\n }\n return promise;\n}\n\nfunction callbackify(fun) {\n return getArguments(function (args) {\n var cb = args.pop();\n var promise = fun.apply(this, args);\n if (typeof cb === 'function') {\n promisedCallback(promise, cb);\n }\n return promise;\n });\n}\n\n// Promise finally util similar to Q.finally\nfunction fin(promise, finalPromiseFactory) {\n return promise.then(function (res) {\n return finalPromiseFactory().then(function () {\n return res;\n });\n }, function (reason) {\n return finalPromiseFactory().then(function () {\n throw reason;\n });\n });\n}\n\nfunction sequentialize(queue, promiseFactory) {\n return function () {\n var args = arguments;\n var that = this;\n return queue.add(function () {\n return promiseFactory.apply(that, args);\n });\n };\n}\n\n// uniq an array of strings, order not guaranteed\n// similar to underscore/lodash _.uniq\nfunction uniq(arr) {\n var theSet = new ExportedSet(arr);\n var result = new Array(theSet.size);\n var index = -1;\n theSet.forEach(function (value) {\n result[++index] = value;\n });\n return result;\n}\n\nfunction mapToKeysArray(map) {\n var result = new Array(map.size);\n var index = -1;\n map.forEach(function (value, key) {\n result[++index] = key;\n });\n return result;\n}\n\nfunction createBuiltInError(name) {\n var message = 'builtin ' + name +\n ' function requires map values to be numbers' +\n ' or number arrays';\n return new BuiltInError(message);\n}\n\nfunction sum(values) {\n var result = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n if (typeof num !== 'number') {\n if (Array.isArray(num)) {\n // lists of numbers are also allowed, sum them separately\n result = typeof result === 'number' ? [result] : result;\n for (var j = 0, jLen = num.length; j < jLen; j++) {\n var jNum = num[j];\n if (typeof jNum !== 'number') {\n throw createBuiltInError('_sum');\n } else if (typeof result[j] === 'undefined') {\n result.push(jNum);\n } else {\n result[j] += jNum;\n }\n }\n } else { // not array/number\n throw createBuiltInError('_sum');\n }\n } else if (typeof result === 'number') {\n result += num;\n } else { // add number to array\n result[0] += num;\n }\n }\n return result;\n}\n\nvar log = guardedConsole.bind(null, 'log');\nvar isArray = Array.isArray;\nvar toJSON = JSON.parse;\n\nfunction evalFunctionWithEval(func, emit) {\n return scopeEval(\n \"return (\" + func.replace(/;\\s*$/, \"\") + \");\",\n {\n emit: emit,\n sum: sum,\n log: log,\n isArray: isArray,\n toJSON: toJSON\n }\n );\n}\n\n/*\n * Simple task queue to sequentialize actions. Assumes\n * callbacks will eventually fire (once).\n */\n\n\nfunction TaskQueue$2() {\n this.promise = new PouchPromise(function (fulfill) {fulfill(); });\n}\nTaskQueue$2.prototype.add = function (promiseFactory) {\n this.promise = this.promise[\"catch\"](function () {\n // just recover\n }).then(function () {\n return promiseFactory();\n });\n return this.promise;\n};\nTaskQueue$2.prototype.finish = function () {\n return this.promise;\n};\n\nfunction stringify(input) {\n if (!input) {\n return 'undefined'; // backwards compat for empty reduce\n }\n // for backwards compat with mapreduce, functions/strings are stringified\n // as-is. everything else is JSON-stringified.\n switch (typeof input) {\n case 'function':\n // e.g. a mapreduce map\n return input.toString();\n case 'string':\n // e.g. a mapreduce built-in _reduce function\n return input.toString();\n default:\n // e.g. a JSON object in the case of mango queries\n return JSON.stringify(input);\n }\n}\n\n/* create a string signature for a view so we can cache it and uniq it */\nfunction createViewSignature(mapFun, reduceFun) {\n // the \"undefined\" part is for backwards compatibility\n return stringify(mapFun) + stringify(reduceFun) + 'undefined';\n}\n\nfunction createView(sourceDB, viewName, mapFun, reduceFun, temporary, localDocName) {\n var viewSignature = createViewSignature(mapFun, reduceFun);\n\n var cachedViews;\n if (!temporary) {\n // cache this to ensure we don't try to update the same view twice\n cachedViews = sourceDB._cachedViews = sourceDB._cachedViews || {};\n if (cachedViews[viewSignature]) {\n return cachedViews[viewSignature];\n }\n }\n\n var promiseForView = sourceDB.info().then(function (info) {\n\n var depDbName = info.db_name + '-mrview-' +\n (temporary ? 'temp' : stringMd5(viewSignature));\n\n // save the view name in the source db so it can be cleaned up if necessary\n // (e.g. when the _design doc is deleted, remove all associated view data)\n function diffFunction(doc) {\n doc.views = doc.views || {};\n var fullViewName = viewName;\n if (fullViewName.indexOf('/') === -1) {\n fullViewName = viewName + '/' + viewName;\n }\n var depDbs = doc.views[fullViewName] = doc.views[fullViewName] || {};\n /* istanbul ignore if */\n if (depDbs[depDbName]) {\n return; // no update necessary\n }\n depDbs[depDbName] = true;\n return doc;\n }\n return upsert(sourceDB, '_local/' + localDocName, diffFunction).then(function () {\n return sourceDB.registerDependentDatabase(depDbName).then(function (res) {\n var db = res.db;\n db.auto_compaction = true;\n var view = {\n name: depDbName,\n db: db,\n sourceDB: sourceDB,\n adapter: sourceDB.adapter,\n mapFun: mapFun,\n reduceFun: reduceFun\n };\n return view.db.get('_local/lastSeq')[\"catch\"](function (err) {\n /* istanbul ignore if */\n if (err.status !== 404) {\n throw err;\n }\n }).then(function (lastSeqDoc) {\n view.seq = lastSeqDoc ? lastSeqDoc.seq : 0;\n if (cachedViews) {\n view.db.once('destroyed', function () {\n delete cachedViews[viewSignature];\n });\n }\n return view;\n });\n });\n });\n });\n\n if (cachedViews) {\n cachedViews[viewSignature] = promiseForView;\n }\n return promiseForView;\n}\n\nvar persistentQueues = {};\nvar tempViewQueue = new TaskQueue$2();\nvar CHANGES_BATCH_SIZE$1 = 50;\n\nfunction parseViewName(name) {\n // can be either 'ddocname/viewname' or just 'viewname'\n // (where the ddoc name is the same)\n return name.indexOf('/') === -1 ? [name, name] : name.split('/');\n}\n\nfunction isGenOne(changes) {\n // only return true if the current change is 1-\n // and there are no other leafs\n return changes.length === 1 && /^1-/.test(changes[0].rev);\n}\n\nfunction emitError(db, e) {\n try {\n db.emit('error', e);\n } catch (err) {\n guardedConsole('error',\n 'The user\\'s map/reduce function threw an uncaught error.\\n' +\n 'You can debug this error by doing:\\n' +\n 'myDatabase.on(\\'error\\', function (err) { debugger; });\\n' +\n 'Please double-check your map/reduce function.');\n guardedConsole('error', e);\n }\n}\n\n/**\n * Returns an \"abstract\" mapreduce object of the form:\n *\n * {\n * query: queryFun,\n * viewCleanup: viewCleanupFun\n * }\n *\n * Arguments are:\n *\n * localDoc: string\n * This is for the local doc that gets saved in order to track the\n * \"dependent\" DBs and clean them up for viewCleanup. It should be\n * unique, so that indexer plugins don't collide with each other.\n * mapper: function (mapFunDef, emit)\n * Returns a map function based on the mapFunDef, which in the case of\n * normal map/reduce is just the de-stringified function, but may be\n * something else, such as an object in the case of pouchdb-find.\n * reducer: function (reduceFunDef)\n * Ditto, but for reducing. Modules don't have to support reducing\n * (e.g. pouchdb-find).\n * ddocValidator: function (ddoc, viewName)\n * Throws an error if the ddoc or viewName is not valid.\n * This could be a way to communicate to the user that the configuration for the\n * indexer is invalid.\n */\nfunction createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {\n\n function tryMap(db, fun, doc) {\n // emit an event if there was an error thrown by a map function.\n // putting try/catches in a single function also avoids deoptimizations.\n try {\n fun(doc);\n } catch (e) {\n emitError(db, e);\n }\n }\n\n function tryReduce(db, fun, keys, values, rereduce) {\n // same as above, but returning the result or an error. there are two separate\n // functions to avoid extra memory allocations since the tryCode() case is used\n // for custom map functions (common) vs this function, which is only used for\n // custom reduce functions (rare)\n try {\n return {output : fun(keys, values, rereduce)};\n } catch (e) {\n emitError(db, e);\n return {error: e};\n }\n }\n\n function sortByKeyThenValue(x, y) {\n var keyCompare = collate(x.key, y.key);\n return keyCompare !== 0 ? keyCompare : collate(x.value, y.value);\n }\n\n function sliceResults(results, limit, skip) {\n skip = skip || 0;\n if (typeof limit === 'number') {\n return results.slice(skip, limit + skip);\n } else if (skip > 0) {\n return results.slice(skip);\n }\n return results;\n }\n\n function rowToDocId(row) {\n var val = row.value;\n // Users can explicitly specify a joined doc _id, or it\n // defaults to the doc _id that emitted the key/value.\n var docId = (val && typeof val === 'object' && val._id) || row.id;\n return docId;\n }\n\n function readAttachmentsAsBlobOrBuffer(res) {\n res.rows.forEach(function (row) {\n var atts = row.doc && row.doc._attachments;\n if (!atts) {\n return;\n }\n Object.keys(atts).forEach(function (filename) {\n var att = atts[filename];\n atts[filename].data = b64ToBluffer(att.data, att.content_type);\n });\n });\n }\n\n function postprocessAttachments(opts) {\n return function (res) {\n if (opts.include_docs && opts.attachments && opts.binary) {\n readAttachmentsAsBlobOrBuffer(res);\n }\n return res;\n };\n }\n\n function addHttpParam(paramName, opts, params, asJson) {\n // add an http param from opts to params, optionally json-encoded\n var val = opts[paramName];\n if (typeof val !== 'undefined') {\n if (asJson) {\n val = encodeURIComponent(JSON.stringify(val));\n }\n params.push(paramName + '=' + val);\n }\n }\n\n function coerceInteger(integerCandidate) {\n if (typeof integerCandidate !== 'undefined') {\n var asNumber = Number(integerCandidate);\n // prevents e.g. '1foo' or '1.1' being coerced to 1\n if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) {\n return asNumber;\n } else {\n return integerCandidate;\n }\n }\n }\n\n function coerceOptions(opts) {\n opts.group_level = coerceInteger(opts.group_level);\n opts.limit = coerceInteger(opts.limit);\n opts.skip = coerceInteger(opts.skip);\n return opts;\n }\n\n function checkPositiveInteger(number) {\n if (number) {\n if (typeof number !== 'number') {\n return new QueryParseError('Invalid value for integer: \"' +\n number + '\"');\n }\n if (number < 0) {\n return new QueryParseError('Invalid value for positive integer: ' +\n '\"' + number + '\"');\n }\n }\n }\n\n function checkQueryParseError(options, fun) {\n var startkeyName = options.descending ? 'endkey' : 'startkey';\n var endkeyName = options.descending ? 'startkey' : 'endkey';\n\n if (typeof options[startkeyName] !== 'undefined' &&\n typeof options[endkeyName] !== 'undefined' &&\n collate(options[startkeyName], options[endkeyName]) > 0) {\n throw new QueryParseError('No rows can match your key range, ' +\n 'reverse your start_key and end_key or set {descending : true}');\n } else if (fun.reduce && options.reduce !== false) {\n if (options.include_docs) {\n throw new QueryParseError('{include_docs:true} is invalid for reduce');\n } else if (options.keys && options.keys.length > 1 &&\n !options.group && !options.group_level) {\n throw new QueryParseError('Multi-key fetches for reduce views must use ' +\n '{group: true}');\n }\n }\n ['group_level', 'limit', 'skip'].forEach(function (optionName) {\n var error = checkPositiveInteger(options[optionName]);\n if (error) {\n throw error;\n }\n });\n }\n\n function httpQuery(db, fun, opts) {\n // List of parameters to add to the PUT request\n var params = [];\n var body;\n var method = 'GET';\n\n // If opts.reduce exists and is defined, then add it to the list\n // of parameters.\n // If reduce=false then the results are that of only the map function\n // not the final result of map and reduce.\n addHttpParam('reduce', opts, params);\n addHttpParam('include_docs', opts, params);\n addHttpParam('attachments', opts, params);\n addHttpParam('limit', opts, params);\n addHttpParam('descending', opts, params);\n addHttpParam('group', opts, params);\n addHttpParam('group_level', opts, params);\n addHttpParam('skip', opts, params);\n addHttpParam('stale', opts, params);\n addHttpParam('conflicts', opts, params);\n addHttpParam('startkey', opts, params, true);\n addHttpParam('start_key', opts, params, true);\n addHttpParam('endkey', opts, params, true);\n addHttpParam('end_key', opts, params, true);\n addHttpParam('inclusive_end', opts, params);\n addHttpParam('key', opts, params, true);\n addHttpParam('update_seq', opts, params);\n\n // Format the list of parameters into a valid URI query string\n params = params.join('&');\n params = params === '' ? '' : '?' + params;\n\n // If keys are supplied, issue a POST to circumvent GET query string limits\n // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options\n if (typeof opts.keys !== 'undefined') {\n var MAX_URL_LENGTH = 2000;\n // according to http://stackoverflow.com/a/417184/680742,\n // the de facto URL length limit is 2000 characters\n\n var keysAsString =\n 'keys=' + encodeURIComponent(JSON.stringify(opts.keys));\n if (keysAsString.length + params.length + 1 <= MAX_URL_LENGTH) {\n // If the keys are short enough, do a GET. we do this to work around\n // Safari not understanding 304s on POSTs (see pouchdb/pouchdb#1239)\n params += (params[0] === '?' ? '&' : '?') + keysAsString;\n } else {\n method = 'POST';\n if (typeof fun === 'string') {\n body = {keys: opts.keys};\n } else { // fun is {map : mapfun}, so append to this\n fun.keys = opts.keys;\n }\n }\n }\n\n // We are referencing a query defined in the design doc\n if (typeof fun === 'string') {\n var parts = parseViewName(fun);\n return db.request({\n method: method,\n url: '_design/' + parts[0] + '/_view/' + parts[1] + params,\n body: body\n }).then(\n /* istanbul ignore next */\n function (result) {\n // fail the entire request if the result contains an error\n result.rows.forEach(function (row) {\n if (row.value && row.value.error && row.value.error === \"builtin_reduce_error\") {\n throw new Error(row.reason);\n }\n });\n\n return result;\n })\n .then(postprocessAttachments(opts));\n }\n\n // We are using a temporary view, terrible for performance, good for testing\n body = body || {};\n Object.keys(fun).forEach(function (key) {\n if (Array.isArray(fun[key])) {\n body[key] = fun[key];\n } else {\n body[key] = fun[key].toString();\n }\n });\n return db.request({\n method: 'POST',\n url: '_temp_view' + params,\n body: body\n }).then(postprocessAttachments(opts));\n }\n\n // custom adapters can define their own api._query\n // and override the default behavior\n /* istanbul ignore next */\n function customQuery(db, fun, opts) {\n return new PouchPromise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }\n\n // custom adapters can define their own api._viewCleanup\n // and override the default behavior\n /* istanbul ignore next */\n function customViewCleanup(db) {\n return new PouchPromise(function (resolve, reject) {\n db._viewCleanup(function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }\n\n function defaultsTo(value) {\n return function (reason) {\n /* istanbul ignore else */\n if (reason.status === 404) {\n return value;\n } else {\n throw reason;\n }\n };\n }\n\n // returns a promise for a list of docs to update, based on the input docId.\n // the order doesn't matter, because post-3.2.0, bulkDocs\n // is an atomic operation in all three adapters.\n function getDocsToPersist(docId, view, docIdsToChangesAndEmits) {\n var metaDocId = '_local/doc_' + docId;\n var defaultMetaDoc = {_id: metaDocId, keys: []};\n var docData = docIdsToChangesAndEmits.get(docId);\n var indexableKeysToKeyValues = docData[0];\n var changes = docData[1];\n\n function getMetaDoc() {\n if (isGenOne(changes)) {\n // generation 1, so we can safely assume initial state\n // for performance reasons (avoids unnecessary GETs)\n return PouchPromise.resolve(defaultMetaDoc);\n }\n return view.db.get(metaDocId)[\"catch\"](defaultsTo(defaultMetaDoc));\n }\n\n function getKeyValueDocs(metaDoc) {\n if (!metaDoc.keys.length) {\n // no keys, no need for a lookup\n return PouchPromise.resolve({rows: []});\n }\n return view.db.allDocs({\n keys: metaDoc.keys,\n include_docs: true\n });\n }\n\n function processKeyValueDocs(metaDoc, kvDocsRes) {\n var kvDocs = [];\n var oldKeys = new ExportedSet();\n\n for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) {\n var row = kvDocsRes.rows[i];\n var doc = row.doc;\n if (!doc) { // deleted\n continue;\n }\n kvDocs.push(doc);\n oldKeys.add(doc._id);\n doc._deleted = !indexableKeysToKeyValues.has(doc._id);\n if (!doc._deleted) {\n var keyValue = indexableKeysToKeyValues.get(doc._id);\n if ('value' in keyValue) {\n doc.value = keyValue.value;\n }\n }\n }\n var newKeys = mapToKeysArray(indexableKeysToKeyValues);\n newKeys.forEach(function (key) {\n if (!oldKeys.has(key)) {\n // new doc\n var kvDoc = {\n _id: key\n };\n var keyValue = indexableKeysToKeyValues.get(key);\n if ('value' in keyValue) {\n kvDoc.value = keyValue.value;\n }\n kvDocs.push(kvDoc);\n }\n });\n metaDoc.keys = uniq(newKeys.concat(metaDoc.keys));\n kvDocs.push(metaDoc);\n\n return kvDocs;\n }\n\n return getMetaDoc().then(function (metaDoc) {\n return getKeyValueDocs(metaDoc).then(function (kvDocsRes) {\n return processKeyValueDocs(metaDoc, kvDocsRes);\n });\n });\n }\n\n // updates all emitted key/value docs and metaDocs in the mrview database\n // for the given batch of documents from the source database\n function saveKeyValues(view, docIdsToChangesAndEmits, seq) {\n var seqDocId = '_local/lastSeq';\n return view.db.get(seqDocId)[\n \"catch\"](defaultsTo({_id: seqDocId, seq: 0}))\n .then(function (lastSeqDoc) {\n var docIds = mapToKeysArray(docIdsToChangesAndEmits);\n return PouchPromise.all(docIds.map(function (docId) {\n return getDocsToPersist(docId, view, docIdsToChangesAndEmits);\n })).then(function (listOfDocsToPersist) {\n var docsToPersist = flatten(listOfDocsToPersist);\n lastSeqDoc.seq = seq;\n docsToPersist.push(lastSeqDoc);\n // write all docs in a single operation, update the seq once\n return view.db.bulkDocs({docs : docsToPersist});\n });\n });\n }\n\n function getQueue(view) {\n var viewName = typeof view === 'string' ? view : view.name;\n var queue = persistentQueues[viewName];\n if (!queue) {\n queue = persistentQueues[viewName] = new TaskQueue$2();\n }\n return queue;\n }\n\n function updateView(view) {\n return sequentialize(getQueue(view), function () {\n return updateViewInQueue(view);\n })();\n }\n\n function updateViewInQueue(view) {\n // bind the emit function once\n var mapResults;\n var doc;\n\n function emit(key, value) {\n var output = {id: doc._id, key: normalizeKey(key)};\n // Don't explicitly store the value unless it's defined and non-null.\n // This saves on storage space, because often people don't use it.\n if (typeof value !== 'undefined' && value !== null) {\n output.value = normalizeKey(value);\n }\n mapResults.push(output);\n }\n\n var mapFun = mapper(view.mapFun, emit);\n\n var currentSeq = view.seq || 0;\n\n function processChange(docIdsToChangesAndEmits, seq) {\n return function () {\n return saveKeyValues(view, docIdsToChangesAndEmits, seq);\n };\n }\n\n var queue = new TaskQueue$2();\n\n function processNextBatch() {\n return view.sourceDB.changes({\n conflicts: true,\n include_docs: true,\n style: 'all_docs',\n since: currentSeq,\n limit: CHANGES_BATCH_SIZE$1\n }).then(processBatch);\n }\n\n function processBatch(response) {\n var results = response.results;\n if (!results.length) {\n return;\n }\n var docIdsToChangesAndEmits = createDocIdsToChangesAndEmits(results);\n queue.add(processChange(docIdsToChangesAndEmits, currentSeq));\n if (results.length < CHANGES_BATCH_SIZE$1) {\n return;\n }\n return processNextBatch();\n }\n\n function createDocIdsToChangesAndEmits(results) {\n var docIdsToChangesAndEmits = new ExportedMap();\n for (var i = 0, len = results.length; i < len; i++) {\n var change = results[i];\n if (change.doc._id[0] !== '_') {\n mapResults = [];\n doc = change.doc;\n\n if (!doc._deleted) {\n tryMap(view.sourceDB, mapFun, doc);\n }\n mapResults.sort(sortByKeyThenValue);\n\n var indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults);\n docIdsToChangesAndEmits.set(change.doc._id, [\n indexableKeysToKeyValues,\n change.changes\n ]);\n }\n currentSeq = change.seq;\n }\n return docIdsToChangesAndEmits;\n }\n\n function createIndexableKeysToKeyValues(mapResults) {\n var indexableKeysToKeyValues = new ExportedMap();\n var lastKey;\n for (var i = 0, len = mapResults.length; i < len; i++) {\n var emittedKeyValue = mapResults[i];\n var complexKey = [emittedKeyValue.key, emittedKeyValue.id];\n if (i > 0 && collate(emittedKeyValue.key, lastKey) === 0) {\n complexKey.push(i); // dup key+id, so make it unique\n }\n indexableKeysToKeyValues.set(toIndexableString(complexKey), emittedKeyValue);\n lastKey = emittedKeyValue.key;\n }\n return indexableKeysToKeyValues;\n }\n\n return processNextBatch().then(function () {\n return queue.finish();\n }).then(function () {\n view.seq = currentSeq;\n });\n }\n\n function reduceView(view, results, options) {\n if (options.group_level === 0) {\n delete options.group_level;\n }\n\n var shouldGroup = options.group || options.group_level;\n\n var reduceFun = reducer(view.reduceFun);\n\n var groups = [];\n var lvl = isNaN(options.group_level) ? Number.POSITIVE_INFINITY :\n options.group_level;\n results.forEach(function (e) {\n var last = groups[groups.length - 1];\n var groupKey = shouldGroup ? e.key : null;\n\n // only set group_level for array keys\n if (shouldGroup && Array.isArray(groupKey)) {\n groupKey = groupKey.slice(0, lvl);\n }\n\n if (last && collate(last.groupKey, groupKey) === 0) {\n last.keys.push([e.key, e.id]);\n last.values.push(e.value);\n return;\n }\n groups.push({\n keys: [[e.key, e.id]],\n values: [e.value],\n groupKey: groupKey\n });\n });\n results = [];\n for (var i = 0, len = groups.length; i < len; i++) {\n var e = groups[i];\n var reduceTry = tryReduce(view.sourceDB, reduceFun, e.keys, e.values, false);\n if (reduceTry.error && reduceTry.error instanceof BuiltInError) {\n // CouchDB returns an error if a built-in errors out\n throw reduceTry.error;\n }\n results.push({\n // CouchDB just sets the value to null if a non-built-in errors out\n value: reduceTry.error ? null : reduceTry.output,\n key: e.groupKey\n });\n }\n // no total_rows/offset when reducing\n return {rows: sliceResults(results, options.limit, options.skip)};\n }\n\n function queryView(view, opts) {\n return sequentialize(getQueue(view), function () {\n return queryViewInQueue(view, opts);\n })();\n }\n\n function queryViewInQueue(view, opts) {\n var totalRows;\n var shouldReduce = view.reduceFun && opts.reduce !== false;\n var skip = opts.skip || 0;\n if (typeof opts.keys !== 'undefined' && !opts.keys.length) {\n // equivalent query\n opts.limit = 0;\n delete opts.keys;\n }\n\n function fetchFromView(viewOpts) {\n viewOpts.include_docs = true;\n return view.db.allDocs(viewOpts).then(function (res) {\n totalRows = res.total_rows;\n return res.rows.map(function (result) {\n\n // implicit migration - in older versions of PouchDB,\n // we explicitly stored the doc as {id: ..., key: ..., value: ...}\n // this is tested in a migration test\n /* istanbul ignore next */\n if ('value' in result.doc && typeof result.doc.value === 'object' &&\n result.doc.value !== null) {\n var keys = Object.keys(result.doc.value).sort();\n // this detection method is not perfect, but it's unlikely the user\n // emitted a value which was an object with these 3 exact keys\n var expectedKeys = ['id', 'key', 'value'];\n if (!(keys < expectedKeys || keys > expectedKeys)) {\n return result.doc.value;\n }\n }\n\n var parsedKeyAndDocId = parseIndexableString(result.doc._id);\n return {\n key: parsedKeyAndDocId[0],\n id: parsedKeyAndDocId[1],\n value: ('value' in result.doc ? result.doc.value : null)\n };\n });\n });\n }\n\n function onMapResultsReady(rows) {\n var finalResults;\n if (shouldReduce) {\n finalResults = reduceView(view, rows, opts);\n } else {\n finalResults = {\n total_rows: totalRows,\n offset: skip,\n rows: rows\n };\n }\n /* istanbul ignore if */\n if (opts.update_seq) {\n finalResults.update_seq = view.seq;\n }\n if (opts.include_docs) {\n var docIds = uniq(rows.map(rowToDocId));\n\n return view.sourceDB.allDocs({\n keys: docIds,\n include_docs: true,\n conflicts: opts.conflicts,\n attachments: opts.attachments,\n binary: opts.binary\n }).then(function (allDocsRes) {\n var docIdsToDocs = new ExportedMap();\n allDocsRes.rows.forEach(function (row) {\n docIdsToDocs.set(row.id, row.doc);\n });\n rows.forEach(function (row) {\n var docId = rowToDocId(row);\n var doc = docIdsToDocs.get(docId);\n if (doc) {\n row.doc = doc;\n }\n });\n return finalResults;\n });\n } else {\n return finalResults;\n }\n }\n\n if (typeof opts.keys !== 'undefined') {\n var keys = opts.keys;\n var fetchPromises = keys.map(function (key) {\n var viewOpts = {\n startkey : toIndexableString([key]),\n endkey : toIndexableString([key, {}])\n };\n /* istanbul ignore if */\n if (opts.update_seq) {\n viewOpts.update_seq = true;\n }\n return fetchFromView(viewOpts);\n });\n return PouchPromise.all(fetchPromises).then(flatten).then(onMapResultsReady);\n } else { // normal query, no 'keys'\n var viewOpts = {\n descending : opts.descending\n };\n /* istanbul ignore if */\n if (opts.update_seq) {\n viewOpts.update_seq = true;\n }\n var startkey;\n var endkey;\n if ('start_key' in opts) {\n startkey = opts.start_key;\n }\n if ('startkey' in opts) {\n startkey = opts.startkey;\n }\n if ('end_key' in opts) {\n endkey = opts.end_key;\n }\n if ('endkey' in opts) {\n endkey = opts.endkey;\n }\n if (typeof startkey !== 'undefined') {\n viewOpts.startkey = opts.descending ?\n toIndexableString([startkey, {}]) :\n toIndexableString([startkey]);\n }\n if (typeof endkey !== 'undefined') {\n var inclusiveEnd = opts.inclusive_end !== false;\n if (opts.descending) {\n inclusiveEnd = !inclusiveEnd;\n }\n\n viewOpts.endkey = toIndexableString(\n inclusiveEnd ? [endkey, {}] : [endkey]);\n }\n if (typeof opts.key !== 'undefined') {\n var keyStart = toIndexableString([opts.key]);\n var keyEnd = toIndexableString([opts.key, {}]);\n if (viewOpts.descending) {\n viewOpts.endkey = keyStart;\n viewOpts.startkey = keyEnd;\n } else {\n viewOpts.startkey = keyStart;\n viewOpts.endkey = keyEnd;\n }\n }\n if (!shouldReduce) {\n if (typeof opts.limit === 'number') {\n viewOpts.limit = opts.limit;\n }\n viewOpts.skip = skip;\n }\n return fetchFromView(viewOpts).then(onMapResultsReady);\n }\n }\n\n function httpViewCleanup(db) {\n return db.request({\n method: 'POST',\n url: '_view_cleanup'\n });\n }\n\n function localViewCleanup(db) {\n return db.get('_local/' + localDocName).then(function (metaDoc) {\n var docsToViews = new ExportedMap();\n Object.keys(metaDoc.views).forEach(function (fullViewName) {\n var parts = parseViewName(fullViewName);\n var designDocName = '_design/' + parts[0];\n var viewName = parts[1];\n var views = docsToViews.get(designDocName);\n if (!views) {\n views = new ExportedSet();\n docsToViews.set(designDocName, views);\n }\n views.add(viewName);\n });\n var opts = {\n keys : mapToKeysArray(docsToViews),\n include_docs : true\n };\n return db.allDocs(opts).then(function (res) {\n var viewsToStatus = {};\n res.rows.forEach(function (row) {\n var ddocName = row.key.substring(8); // cuts off '_design/'\n docsToViews.get(row.key).forEach(function (viewName) {\n var fullViewName = ddocName + '/' + viewName;\n /* istanbul ignore if */\n if (!metaDoc.views[fullViewName]) {\n // new format, without slashes, to support PouchDB 2.2.0\n // migration test in pouchdb's browser.migration.js verifies this\n fullViewName = viewName;\n }\n var viewDBNames = Object.keys(metaDoc.views[fullViewName]);\n // design doc deleted, or view function nonexistent\n var statusIsGood = row.doc && row.doc.views &&\n row.doc.views[viewName];\n viewDBNames.forEach(function (viewDBName) {\n viewsToStatus[viewDBName] =\n viewsToStatus[viewDBName] || statusIsGood;\n });\n });\n });\n var dbsToDelete = Object.keys(viewsToStatus).filter(\n function (viewDBName) { return !viewsToStatus[viewDBName]; });\n var destroyPromises = dbsToDelete.map(function (viewDBName) {\n return sequentialize(getQueue(viewDBName), function () {\n return new db.constructor(viewDBName, db.__opts).destroy();\n })();\n });\n return PouchPromise.all(destroyPromises).then(function () {\n return {ok: true};\n });\n });\n }, defaultsTo({ok: true}));\n }\n\n function queryPromised(db, fun, opts) {\n /* istanbul ignore next */\n if (typeof db._query === 'function') {\n return customQuery(db, fun, opts);\n }\n if (isRemote(db)) {\n return httpQuery(db, fun, opts);\n }\n \n if (typeof fun !== 'string') {\n // temp_view\n checkQueryParseError(opts, fun);\n\n tempViewQueue.add(function () {\n var createViewPromise = createView(\n /* sourceDB */ db,\n /* viewName */ 'temp_view/temp_view',\n /* mapFun */ fun.map,\n /* reduceFun */ fun.reduce,\n /* temporary */ true,\n /* localDocName */ localDocName);\n return createViewPromise.then(function (view) {\n return fin(updateView(view).then(function () {\n return queryView(view, opts);\n }), function () {\n return view.db.destroy();\n });\n });\n });\n return tempViewQueue.finish();\n } else {\n // persistent view\n var fullViewName = fun;\n var parts = parseViewName(fullViewName);\n var designDocName = parts[0];\n var viewName = parts[1];\n return db.get('_design/' + designDocName).then(function (doc) {\n var fun = doc.views && doc.views[viewName];\n\n if (!fun) {\n // basic validator; it's assumed that every subclass would want this\n throw new NotFoundError('ddoc ' + doc._id + ' has no view named ' +\n viewName);\n }\n\n ddocValidator(doc, viewName);\n checkQueryParseError(opts, fun);\n\n var createViewPromise = createView(\n /* sourceDB */ db,\n /* viewName */ fullViewName,\n /* mapFun */ fun.map,\n /* reduceFun */ fun.reduce,\n /* temporary */ false,\n /* localDocName */ localDocName);\n return createViewPromise.then(function (view) {\n if (opts.stale === 'ok' || opts.stale === 'update_after') {\n if (opts.stale === 'update_after') {\n nextTick(function () {\n updateView(view);\n });\n }\n return queryView(view, opts);\n } else { // stale not ok\n return updateView(view).then(function () {\n return queryView(view, opts);\n });\n }\n });\n });\n }\n }\n\n function abstractQuery(fun, opts, callback) {\n var db = this;\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = opts ? coerceOptions(opts) : {};\n\n if (typeof fun === 'function') {\n fun = {map : fun};\n }\n\n var promise = PouchPromise.resolve().then(function () {\n return queryPromised(db, fun, opts);\n });\n promisedCallback(promise, callback);\n return promise;\n }\n\n var abstractViewCleanup = callbackify(function () {\n var db = this;\n /* istanbul ignore next */\n if (typeof db._viewCleanup === 'function') {\n return customViewCleanup(db);\n }\n if (isRemote(db)) {\n return httpViewCleanup(db);\n }\n return localViewCleanup(db);\n });\n\n return {\n query: abstractQuery,\n viewCleanup: abstractViewCleanup\n };\n}\n\nvar builtInReduce = {\n _sum: function (keys, values) {\n return sum(values);\n },\n\n _count: function (keys, values) {\n return values.length;\n },\n\n _stats: function (keys, values) {\n // no need to implement rereduce=true, because Pouch\n // will never call it\n function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }\n return {\n sum : sum(values),\n min : Math.min.apply(null, values),\n max : Math.max.apply(null, values),\n count : values.length,\n sumsqr : sumsqr(values)\n };\n }\n};\n\nfunction getBuiltIn(reduceFunString) {\n if (/^_sum/.test(reduceFunString)) {\n return builtInReduce._sum;\n } else if (/^_count/.test(reduceFunString)) {\n return builtInReduce._count;\n } else if (/^_stats/.test(reduceFunString)) {\n return builtInReduce._stats;\n } else if (/^_/.test(reduceFunString)) {\n throw new Error(reduceFunString + ' is not a supported reduce function.');\n }\n}\n\nfunction mapper(mapFun, emit) {\n // for temp_views one can use emit(doc, emit), see #38\n if (typeof mapFun === \"function\" && mapFun.length === 2) {\n var origMap = mapFun;\n return function (doc) {\n return origMap(doc, emit);\n };\n } else {\n return evalFunctionWithEval(mapFun.toString(), emit);\n }\n}\n\nfunction reducer(reduceFun) {\n var reduceFunString = reduceFun.toString();\n var builtIn = getBuiltIn(reduceFunString);\n if (builtIn) {\n return builtIn;\n } else {\n return evalFunctionWithEval(reduceFunString);\n }\n}\n\nfunction ddocValidator(ddoc, viewName) {\n var fun = ddoc.views && ddoc.views[viewName];\n if (typeof fun.map !== 'string') {\n throw new NotFoundError('ddoc ' + ddoc._id + ' has no string view named ' +\n viewName + ', instead found object of type: ' + typeof fun.map);\n }\n}\n\nvar localDocName = 'mrviews';\nvar abstract = createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator);\n\nfunction query(fun, opts, callback) {\n return abstract.query.call(this, fun, opts, callback);\n}\n\nfunction viewCleanup(callback) {\n return abstract.viewCleanup.call(this, callback);\n}\n\nvar mapreduce = {\n query: query,\n viewCleanup: viewCleanup\n};\n\nfunction isGenOne$1(rev$$1) {\n return /^1-/.test(rev$$1);\n}\n\nfunction fileHasChanged(localDoc, remoteDoc, filename) {\n return !localDoc._attachments ||\n !localDoc._attachments[filename] ||\n localDoc._attachments[filename].digest !== remoteDoc._attachments[filename].digest;\n}\n\nfunction getDocAttachments(db, doc) {\n var filenames = Object.keys(doc._attachments);\n return PouchPromise.all(filenames.map(function (filename) {\n return db.getAttachment(doc._id, filename, {rev: doc._rev});\n }));\n}\n\nfunction getDocAttachmentsFromTargetOrSource(target, src, doc) {\n var doCheckForLocalAttachments = isRemote(src) && !isRemote(target);\n var filenames = Object.keys(doc._attachments);\n\n if (!doCheckForLocalAttachments) {\n return getDocAttachments(src, doc);\n }\n\n return target.get(doc._id).then(function (localDoc) {\n return PouchPromise.all(filenames.map(function (filename) {\n if (fileHasChanged(localDoc, doc, filename)) {\n return src.getAttachment(doc._id, filename);\n }\n\n return target.getAttachment(localDoc._id, filename);\n }));\n })[\"catch\"](function (error) {\n /* istanbul ignore if */\n if (error.status !== 404) {\n throw error;\n }\n\n return getDocAttachments(src, doc);\n });\n}\n\nfunction createBulkGetOpts(diffs) {\n var requests = [];\n Object.keys(diffs).forEach(function (id) {\n var missingRevs = diffs[id].missing;\n missingRevs.forEach(function (missingRev) {\n requests.push({\n id: id,\n rev: missingRev\n });\n });\n });\n\n return {\n docs: requests,\n revs: true,\n latest: true\n };\n}\n\n//\n// Fetch all the documents from the src as described in the \"diffs\",\n// which is a mapping of docs IDs to revisions. If the state ever\n// changes to \"cancelled\", then the returned promise will be rejected.\n// Else it will be resolved with a list of fetched documents.\n//\nfunction getDocs(src, target, diffs, state) {\n diffs = clone(diffs); // we do not need to modify this\n\n var resultDocs = [],\n ok = true;\n\n function getAllDocs() {\n\n var bulkGetOpts = createBulkGetOpts(diffs);\n\n if (!bulkGetOpts.docs.length) { // optimization: skip empty requests\n return;\n }\n\n return src.bulkGet(bulkGetOpts).then(function (bulkGetResponse) {\n /* istanbul ignore if */\n if (state.cancelled) {\n throw new Error('cancelled');\n }\n return PouchPromise.all(bulkGetResponse.results.map(function (bulkGetInfo) {\n return PouchPromise.all(bulkGetInfo.docs.map(function (doc) {\n var remoteDoc = doc.ok;\n\n if (doc.error) {\n // when AUTO_COMPACTION is set, docs can be returned which look\n // like this: {\"missing\":\"1-7c3ac256b693c462af8442f992b83696\"}\n ok = false;\n }\n\n if (!remoteDoc || !remoteDoc._attachments) {\n return remoteDoc;\n }\n\n return getDocAttachmentsFromTargetOrSource(target, src, remoteDoc)\n .then(function (attachments) {\n var filenames = Object.keys(remoteDoc._attachments);\n attachments\n .forEach(function (attachment, i) {\n var att = remoteDoc._attachments[filenames[i]];\n delete att.stub;\n delete att.length;\n att.data = attachment;\n });\n\n return remoteDoc;\n });\n }));\n }))\n\n .then(function (results) {\n resultDocs = resultDocs.concat(flatten(results).filter(Boolean));\n });\n });\n }\n\n function hasAttachments(doc) {\n return doc._attachments && Object.keys(doc._attachments).length > 0;\n }\n\n function hasConflicts(doc) {\n return doc._conflicts && doc._conflicts.length > 0;\n }\n\n function fetchRevisionOneDocs(ids) {\n // Optimization: fetch gen-1 docs and attachments in\n // a single request using _all_docs\n return src.allDocs({\n keys: ids,\n include_docs: true,\n conflicts: true\n }).then(function (res) {\n if (state.cancelled) {\n throw new Error('cancelled');\n }\n res.rows.forEach(function (row) {\n if (row.deleted || !row.doc || !isGenOne$1(row.value.rev) ||\n hasAttachments(row.doc) || hasConflicts(row.doc)) {\n // if any of these conditions apply, we need to fetch using get()\n return;\n }\n\n // strip _conflicts array to appease CSG (#5793)\n /* istanbul ignore if */\n if (row.doc._conflicts) {\n delete row.doc._conflicts;\n }\n\n // the doc we got back from allDocs() is sufficient\n resultDocs.push(row.doc);\n delete diffs[row.id];\n });\n });\n }\n\n function getRevisionOneDocs() {\n // filter out the generation 1 docs and get them\n // leaving the non-generation one docs to be got otherwise\n var ids = Object.keys(diffs).filter(function (id) {\n var missing = diffs[id].missing;\n return missing.length === 1 && isGenOne$1(missing[0]);\n });\n if (ids.length > 0) {\n return fetchRevisionOneDocs(ids);\n }\n }\n\n function returnResult() {\n return { ok:ok, docs:resultDocs };\n }\n\n return PouchPromise.resolve()\n .then(getRevisionOneDocs)\n .then(getAllDocs)\n .then(returnResult);\n}\n\nvar CHECKPOINT_VERSION = 1;\nvar REPLICATOR = \"pouchdb\";\n// This is an arbitrary number to limit the\n// amount of replication history we save in the checkpoint.\n// If we save too much, the checkpoing docs will become very big,\n// if we save fewer, we'll run a greater risk of having to\n// read all the changes from 0 when checkpoint PUTs fail\n// CouchDB 2.0 has a more involved history pruning,\n// but let's go for the simple version for now.\nvar CHECKPOINT_HISTORY_SIZE = 5;\nvar LOWEST_SEQ = 0;\n\nfunction updateCheckpoint(db, id, checkpoint, session, returnValue) {\n return db.get(id)[\"catch\"](function (err) {\n if (err.status === 404) {\n if (db.adapter === 'http' || db.adapter === 'https') {\n explainError(\n 404, 'PouchDB is just checking if a remote checkpoint exists.'\n );\n }\n return {\n session_id: session,\n _id: id,\n history: [],\n replicator: REPLICATOR,\n version: CHECKPOINT_VERSION\n };\n }\n throw err;\n }).then(function (doc) {\n if (returnValue.cancelled) {\n return;\n }\n\n // if the checkpoint has not changed, do not update\n if (doc.last_seq === checkpoint) {\n return;\n }\n\n // Filter out current entry for this replication\n doc.history = (doc.history || []).filter(function (item) {\n return item.session_id !== session;\n });\n\n // Add the latest checkpoint to history\n doc.history.unshift({\n last_seq: checkpoint,\n session_id: session\n });\n\n // Just take the last pieces in history, to\n // avoid really big checkpoint docs.\n // see comment on history size above\n doc.history = doc.history.slice(0, CHECKPOINT_HISTORY_SIZE);\n\n doc.version = CHECKPOINT_VERSION;\n doc.replicator = REPLICATOR;\n\n doc.session_id = session;\n doc.last_seq = checkpoint;\n\n return db.put(doc)[\"catch\"](function (err) {\n if (err.status === 409) {\n // retry; someone is trying to write a checkpoint simultaneously\n return updateCheckpoint(db, id, checkpoint, session, returnValue);\n }\n throw err;\n });\n });\n}\n\nfunction Checkpointer(src, target, id, returnValue, opts) {\n this.src = src;\n this.target = target;\n this.id = id;\n this.returnValue = returnValue;\n this.opts = opts || {};\n}\n\nCheckpointer.prototype.writeCheckpoint = function (checkpoint, session) {\n var self = this;\n return this.updateTarget(checkpoint, session).then(function () {\n return self.updateSource(checkpoint, session);\n });\n};\n\nCheckpointer.prototype.updateTarget = function (checkpoint, session) {\n if (this.opts.writeTargetCheckpoint) {\n return updateCheckpoint(this.target, this.id, checkpoint,\n session, this.returnValue);\n } else {\n return PouchPromise.resolve(true);\n }\n};\n\nCheckpointer.prototype.updateSource = function (checkpoint, session) {\n if (this.opts.writeSourceCheckpoint) {\n var self = this;\n return updateCheckpoint(this.src, this.id, checkpoint,\n session, this.returnValue)[\n \"catch\"](function (err) {\n if (isForbiddenError(err)) {\n self.opts.writeSourceCheckpoint = false;\n return true;\n }\n throw err;\n });\n } else {\n return PouchPromise.resolve(true);\n }\n};\n\nvar comparisons = {\n \"undefined\": function (targetDoc, sourceDoc) {\n // This is the previous comparison function\n if (collate(targetDoc.last_seq, sourceDoc.last_seq) === 0) {\n return sourceDoc.last_seq;\n }\n /* istanbul ignore next */\n return 0;\n },\n \"1\": function (targetDoc, sourceDoc) {\n // This is the comparison function ported from CouchDB\n return compareReplicationLogs(sourceDoc, targetDoc).last_seq;\n }\n};\n\nCheckpointer.prototype.getCheckpoint = function () {\n var self = this;\n\n if (self.opts && self.opts.writeSourceCheckpoint && !self.opts.writeTargetCheckpoint) {\n return self.src.get(self.id).then(function (sourceDoc) {\n return sourceDoc.last_seq || LOWEST_SEQ;\n })[\"catch\"](function (err) {\n /* istanbul ignore if */\n if (err.status !== 404) {\n throw err;\n }\n return LOWEST_SEQ;\n });\n }\n\n return self.target.get(self.id).then(function (targetDoc) {\n if (self.opts && self.opts.writeTargetCheckpoint && !self.opts.writeSourceCheckpoint) {\n return targetDoc.last_seq || LOWEST_SEQ;\n }\n\n return self.src.get(self.id).then(function (sourceDoc) {\n // Since we can't migrate an old version doc to a new one\n // (no session id), we just go with the lowest seq in this case\n /* istanbul ignore if */\n if (targetDoc.version !== sourceDoc.version) {\n return LOWEST_SEQ;\n }\n\n var version;\n if (targetDoc.version) {\n version = targetDoc.version.toString();\n } else {\n version = \"undefined\";\n }\n\n if (version in comparisons) {\n return comparisons[version](targetDoc, sourceDoc);\n }\n /* istanbul ignore next */\n return LOWEST_SEQ;\n }, function (err) {\n if (err.status === 404 && targetDoc.last_seq) {\n return self.src.put({\n _id: self.id,\n last_seq: LOWEST_SEQ\n }).then(function () {\n return LOWEST_SEQ;\n }, function (err) {\n if (isForbiddenError(err)) {\n self.opts.writeSourceCheckpoint = false;\n return targetDoc.last_seq;\n }\n /* istanbul ignore next */\n return LOWEST_SEQ;\n });\n }\n throw err;\n });\n })[\"catch\"](function (err) {\n if (err.status !== 404) {\n throw err;\n }\n return LOWEST_SEQ;\n });\n};\n// This checkpoint comparison is ported from CouchDBs source\n// they come from here:\n// https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906\n\nfunction compareReplicationLogs(srcDoc, tgtDoc) {\n if (srcDoc.session_id === tgtDoc.session_id) {\n return {\n last_seq: srcDoc.last_seq,\n history: srcDoc.history\n };\n }\n\n return compareReplicationHistory(srcDoc.history, tgtDoc.history);\n}\n\nfunction compareReplicationHistory(sourceHistory, targetHistory) {\n // the erlang loop via function arguments is not so easy to repeat in JS\n // therefore, doing this as recursion\n var S = sourceHistory[0];\n var sourceRest = sourceHistory.slice(1);\n var T = targetHistory[0];\n var targetRest = targetHistory.slice(1);\n\n if (!S || targetHistory.length === 0) {\n return {\n last_seq: LOWEST_SEQ,\n history: []\n };\n }\n\n var sourceId = S.session_id;\n /* istanbul ignore if */\n if (hasSessionId(sourceId, targetHistory)) {\n return {\n last_seq: S.last_seq,\n history: sourceHistory\n };\n }\n\n var targetId = T.session_id;\n if (hasSessionId(targetId, sourceRest)) {\n return {\n last_seq: T.last_seq,\n history: targetRest\n };\n }\n\n return compareReplicationHistory(sourceRest, targetRest);\n}\n\nfunction hasSessionId(sessionId, history) {\n var props = history[0];\n var rest = history.slice(1);\n\n if (!sessionId || history.length === 0) {\n return false;\n }\n\n if (sessionId === props.session_id) {\n return true;\n }\n\n return hasSessionId(sessionId, rest);\n}\n\nfunction isForbiddenError(err) {\n return typeof err.status === 'number' && Math.floor(err.status / 100) === 4;\n}\n\nvar STARTING_BACK_OFF = 0;\n\nfunction backOff(opts, returnValue, error, callback) {\n if (opts.retry === false) {\n returnValue.emit('error', error);\n returnValue.removeAllListeners();\n return;\n }\n if (typeof opts.back_off_function !== 'function') {\n opts.back_off_function = defaultBackOff;\n }\n returnValue.emit('requestError', error);\n if (returnValue.state === 'active' || returnValue.state === 'pending') {\n returnValue.emit('paused', error);\n returnValue.state = 'stopped';\n var backOffSet = function backoffTimeSet() {\n opts.current_back_off = STARTING_BACK_OFF;\n };\n var removeBackOffSetter = function removeBackOffTimeSet() {\n returnValue.removeListener('active', backOffSet);\n };\n returnValue.once('paused', removeBackOffSetter);\n returnValue.once('active', backOffSet);\n }\n\n opts.current_back_off = opts.current_back_off || STARTING_BACK_OFF;\n opts.current_back_off = opts.back_off_function(opts.current_back_off);\n setTimeout(callback, opts.current_back_off);\n}\n\nfunction sortObjectPropertiesByKey(queryParams) {\n return Object.keys(queryParams).sort(collate).reduce(function (result, key) {\n result[key] = queryParams[key];\n return result;\n }, {});\n}\n\n// Generate a unique id particular to this replication.\n// Not guaranteed to align perfectly with CouchDB's rep ids.\nfunction generateReplicationId(src, target, opts) {\n var docIds = opts.doc_ids ? opts.doc_ids.sort(collate) : '';\n var filterFun = opts.filter ? opts.filter.toString() : '';\n var queryParams = '';\n var filterViewName = '';\n var selector = '';\n\n // possibility for checkpoints to be lost here as behaviour of\n // JSON.stringify is not stable (see #6226)\n /* istanbul ignore if */\n if (opts.selector) {\n selector = JSON.stringify(opts.selector);\n }\n\n if (opts.filter && opts.query_params) {\n queryParams = JSON.stringify(sortObjectPropertiesByKey(opts.query_params));\n }\n\n if (opts.filter && opts.filter === '_view') {\n filterViewName = opts.view.toString();\n }\n\n return PouchPromise.all([src.id(), target.id()]).then(function (res) {\n var queryData = res[0] + res[1] + filterFun + filterViewName +\n queryParams + docIds + selector;\n return new PouchPromise(function (resolve) {\n binaryMd5(queryData, resolve);\n });\n }).then(function (md5sum) {\n // can't use straight-up md5 alphabet, because\n // the char '/' is interpreted as being for attachments,\n // and + is also not url-safe\n md5sum = md5sum.replace(/\\//g, '.').replace(/\\+/g, '_');\n return '_local/' + md5sum;\n });\n}\n\nfunction replicate(src, target, opts, returnValue, result) {\n var batches = []; // list of batches to be processed\n var currentBatch; // the batch currently being processed\n var pendingBatch = {\n seq: 0,\n changes: [],\n docs: []\n }; // next batch, not yet ready to be processed\n var writingCheckpoint = false; // true while checkpoint is being written\n var changesCompleted = false; // true when all changes received\n var replicationCompleted = false; // true when replication has completed\n var last_seq = 0;\n var continuous = opts.continuous || opts.live || false;\n var batch_size = opts.batch_size || 100;\n var batches_limit = opts.batches_limit || 10;\n var changesPending = false; // true while src.changes is running\n var doc_ids = opts.doc_ids;\n var selector = opts.selector;\n var repId;\n var checkpointer;\n var changedDocs = [];\n // Like couchdb, every replication gets a unique session id\n var session = uuid();\n var seq_interval = opts.seq_interval;\n\n result = result || {\n ok: true,\n start_time: new Date(),\n docs_read: 0,\n docs_written: 0,\n doc_write_failures: 0,\n errors: []\n };\n\n var changesOpts = {};\n returnValue.ready(src, target);\n\n function initCheckpointer() {\n if (checkpointer) {\n return PouchPromise.resolve();\n }\n return generateReplicationId(src, target, opts).then(function (res) {\n repId = res;\n\n var checkpointOpts = {};\n if (opts.checkpoint === false) {\n checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: false };\n } else if (opts.checkpoint === 'source') {\n checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: false };\n } else if (opts.checkpoint === 'target') {\n checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: true };\n } else {\n checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: true };\n }\n\n checkpointer = new Checkpointer(src, target, repId, returnValue, checkpointOpts);\n });\n }\n\n function writeDocs() {\n changedDocs = [];\n\n if (currentBatch.docs.length === 0) {\n return;\n }\n var docs = currentBatch.docs;\n var bulkOpts = {timeout: opts.timeout};\n return target.bulkDocs({docs: docs, new_edits: false}, bulkOpts).then(function (res) {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n throw new Error('cancelled');\n }\n\n // `res` doesn't include full documents (which live in `docs`), so we create a map of \n // (id -> error), and check for errors while iterating over `docs`\n var errorsById = Object.create(null);\n res.forEach(function (res) {\n if (res.error) {\n errorsById[res.id] = res;\n }\n });\n\n var errorsNo = Object.keys(errorsById).length;\n result.doc_write_failures += errorsNo;\n result.docs_written += docs.length - errorsNo;\n\n docs.forEach(function (doc) {\n var error = errorsById[doc._id];\n if (error) {\n result.errors.push(error);\n // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)\n var errorName = (error.name || '').toLowerCase();\n if (errorName === 'unauthorized' || errorName === 'forbidden') {\n returnValue.emit('denied', clone(error));\n } else {\n throw error;\n }\n } else {\n changedDocs.push(doc);\n }\n });\n\n }, function (err) {\n result.doc_write_failures += docs.length;\n throw err;\n });\n }\n\n function finishBatch() {\n if (currentBatch.error) {\n throw new Error('There was a problem getting docs.');\n }\n result.last_seq = last_seq = currentBatch.seq;\n var outResult = clone(result);\n if (changedDocs.length) {\n outResult.docs = changedDocs;\n // Attach 'pending' property if server supports it (CouchDB 2.0+)\n /* istanbul ignore if */\n if (typeof currentBatch.pending === 'number') {\n outResult.pending = currentBatch.pending;\n delete currentBatch.pending;\n }\n returnValue.emit('change', outResult);\n }\n writingCheckpoint = true;\n return checkpointer.writeCheckpoint(currentBatch.seq,\n session).then(function () {\n writingCheckpoint = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n throw new Error('cancelled');\n }\n currentBatch = undefined;\n getChanges();\n })[\"catch\"](function (err) {\n onCheckpointError(err);\n throw err;\n });\n }\n\n function getDiffs() {\n var diff = {};\n currentBatch.changes.forEach(function (change) {\n // Couchbase Sync Gateway emits these, but we can ignore them\n /* istanbul ignore if */\n if (change.id === \"_user/\") {\n return;\n }\n diff[change.id] = change.changes.map(function (x) {\n return x.rev;\n });\n });\n return target.revsDiff(diff).then(function (diffs) {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n throw new Error('cancelled');\n }\n // currentBatch.diffs elements are deleted as the documents are written\n currentBatch.diffs = diffs;\n });\n }\n\n function getBatchDocs() {\n return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) {\n currentBatch.error = !got.ok;\n got.docs.forEach(function (doc) {\n delete currentBatch.diffs[doc._id];\n result.docs_read++;\n currentBatch.docs.push(doc);\n });\n });\n }\n\n function startNextBatch() {\n if (returnValue.cancelled || currentBatch) {\n return;\n }\n if (batches.length === 0) {\n processPendingBatch(true);\n return;\n }\n currentBatch = batches.shift();\n getDiffs()\n .then(getBatchDocs)\n .then(writeDocs)\n .then(finishBatch)\n .then(startNextBatch)[\n \"catch\"](function (err) {\n abortReplication('batch processing terminated with error', err);\n });\n }\n\n\n function processPendingBatch(immediate) {\n if (pendingBatch.changes.length === 0) {\n if (batches.length === 0 && !currentBatch) {\n if ((continuous && changesOpts.live) || changesCompleted) {\n returnValue.state = 'pending';\n returnValue.emit('paused');\n }\n if (changesCompleted) {\n completeReplication();\n }\n }\n return;\n }\n if (\n immediate ||\n changesCompleted ||\n pendingBatch.changes.length >= batch_size\n ) {\n batches.push(pendingBatch);\n pendingBatch = {\n seq: 0,\n changes: [],\n docs: []\n };\n if (returnValue.state === 'pending' || returnValue.state === 'stopped') {\n returnValue.state = 'active';\n returnValue.emit('active');\n }\n startNextBatch();\n }\n }\n\n\n function abortReplication(reason, err) {\n if (replicationCompleted) {\n return;\n }\n if (!err.message) {\n err.message = reason;\n }\n result.ok = false;\n result.status = 'aborting';\n batches = [];\n pendingBatch = {\n seq: 0,\n changes: [],\n docs: []\n };\n completeReplication(err);\n }\n\n\n function completeReplication(fatalError) {\n if (replicationCompleted) {\n return;\n }\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n result.status = 'cancelled';\n if (writingCheckpoint) {\n return;\n }\n }\n result.status = result.status || 'complete';\n result.end_time = new Date();\n result.last_seq = last_seq;\n replicationCompleted = true;\n\n if (fatalError) {\n // need to extend the error because Firefox considers \".result\" read-only\n fatalError = createError(fatalError);\n fatalError.result = result;\n\n // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)\n var errorName = (fatalError.name || '').toLowerCase();\n if (errorName === 'unauthorized' || errorName === 'forbidden') {\n returnValue.emit('error', fatalError);\n returnValue.removeAllListeners();\n } else {\n backOff(opts, returnValue, fatalError, function () {\n replicate(src, target, opts, returnValue);\n });\n }\n } else {\n returnValue.emit('complete', result);\n returnValue.removeAllListeners();\n }\n }\n\n\n function onChange(change, pending, lastSeq) {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n return completeReplication();\n }\n // Attach 'pending' property if server supports it (CouchDB 2.0+)\n /* istanbul ignore if */\n if (typeof pending === 'number') {\n pendingBatch.pending = pending;\n }\n\n var filter = filterChange(opts)(change);\n if (!filter) {\n return;\n }\n pendingBatch.seq = change.seq || lastSeq;\n pendingBatch.changes.push(change);\n processPendingBatch(batches.length === 0 && changesOpts.live);\n }\n\n\n function onChangesComplete(changes) {\n changesPending = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n return completeReplication();\n }\n\n // if no results were returned then we're done,\n // else fetch more\n if (changes.results.length > 0) {\n changesOpts.since = changes.last_seq;\n getChanges();\n processPendingBatch(true);\n } else {\n\n var complete = function () {\n if (continuous) {\n changesOpts.live = true;\n getChanges();\n } else {\n changesCompleted = true;\n }\n processPendingBatch(true);\n };\n\n // update the checkpoint so we start from the right seq next time\n if (!currentBatch && changes.results.length === 0) {\n writingCheckpoint = true;\n checkpointer.writeCheckpoint(changes.last_seq,\n session).then(function () {\n writingCheckpoint = false;\n result.last_seq = last_seq = changes.last_seq;\n complete();\n })[\n \"catch\"](onCheckpointError);\n } else {\n complete();\n }\n }\n }\n\n\n function onChangesError(err) {\n changesPending = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n return completeReplication();\n }\n abortReplication('changes rejected', err);\n }\n\n\n function getChanges() {\n if (!(\n !changesPending &&\n !changesCompleted &&\n batches.length < batches_limit\n )) {\n return;\n }\n changesPending = true;\n function abortChanges() {\n changes.cancel();\n }\n function removeListener() {\n returnValue.removeListener('cancel', abortChanges);\n }\n\n if (returnValue._changes) { // remove old changes() and listeners\n returnValue.removeListener('cancel', returnValue._abortChanges);\n returnValue._changes.cancel();\n }\n returnValue.once('cancel', abortChanges);\n\n var changes = src.changes(changesOpts)\n .on('change', onChange);\n changes.then(removeListener, removeListener);\n changes.then(onChangesComplete)[\n \"catch\"](onChangesError);\n\n if (opts.retry) {\n // save for later so we can cancel if necessary\n returnValue._changes = changes;\n returnValue._abortChanges = abortChanges;\n }\n }\n\n\n function startChanges() {\n initCheckpointer().then(function () {\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n return;\n }\n return checkpointer.getCheckpoint().then(function (checkpoint) {\n last_seq = checkpoint;\n changesOpts = {\n since: last_seq,\n limit: batch_size,\n batch_size: batch_size,\n style: 'all_docs',\n doc_ids: doc_ids,\n selector: selector,\n return_docs: true // required so we know when we're done\n };\n if (seq_interval !== false) {\n changesOpts.seq_interval = seq_interval || batch_size;\n }\n if (opts.filter) {\n if (typeof opts.filter !== 'string') {\n // required for the client-side filter in onChange\n changesOpts.include_docs = true;\n } else { // ddoc filter\n changesOpts.filter = opts.filter;\n }\n }\n if ('heartbeat' in opts) {\n changesOpts.heartbeat = opts.heartbeat;\n }\n if ('timeout' in opts) {\n changesOpts.timeout = opts.timeout;\n }\n if (opts.query_params) {\n changesOpts.query_params = opts.query_params;\n }\n if (opts.view) {\n changesOpts.view = opts.view;\n }\n getChanges();\n });\n })[\"catch\"](function (err) {\n abortReplication('getCheckpoint rejected with ', err);\n });\n }\n\n /* istanbul ignore next */\n function onCheckpointError(err) {\n writingCheckpoint = false;\n abortReplication('writeCheckpoint completed with error', err);\n }\n\n /* istanbul ignore if */\n if (returnValue.cancelled) { // cancelled immediately\n completeReplication();\n return;\n }\n\n if (!returnValue._addedListeners) {\n returnValue.once('cancel', completeReplication);\n\n if (typeof opts.complete === 'function') {\n returnValue.once('error', opts.complete);\n returnValue.once('complete', function (result) {\n opts.complete(null, result);\n });\n }\n returnValue._addedListeners = true;\n }\n\n if (typeof opts.since === 'undefined') {\n startChanges();\n } else {\n initCheckpointer().then(function () {\n writingCheckpoint = true;\n return checkpointer.writeCheckpoint(opts.since, session);\n }).then(function () {\n writingCheckpoint = false;\n /* istanbul ignore if */\n if (returnValue.cancelled) {\n completeReplication();\n return;\n }\n last_seq = opts.since;\n startChanges();\n })[\"catch\"](onCheckpointError);\n }\n}\n\n// We create a basic promise so the caller can cancel the replication possibly\n// before we have actually started listening to changes etc\ninherits(Replication, events.EventEmitter);\nfunction Replication() {\n events.EventEmitter.call(this);\n this.cancelled = false;\n this.state = 'pending';\n var self = this;\n var promise = new PouchPromise(function (fulfill, reject) {\n self.once('complete', fulfill);\n self.once('error', reject);\n });\n self.then = function (resolve, reject) {\n return promise.then(resolve, reject);\n };\n self[\"catch\"] = function (reject) {\n return promise[\"catch\"](reject);\n };\n // As we allow error handling via \"error\" event as well,\n // put a stub in here so that rejecting never throws UnhandledError.\n self[\"catch\"](function () {});\n}\n\nReplication.prototype.cancel = function () {\n this.cancelled = true;\n this.state = 'cancelled';\n this.emit('cancel');\n};\n\nReplication.prototype.ready = function (src, target) {\n var self = this;\n if (self._readyCalled) {\n return;\n }\n self._readyCalled = true;\n\n function onDestroy() {\n self.cancel();\n }\n src.once('destroyed', onDestroy);\n target.once('destroyed', onDestroy);\n function cleanup() {\n src.removeListener('destroyed', onDestroy);\n target.removeListener('destroyed', onDestroy);\n }\n self.once('complete', cleanup);\n};\n\nfunction toPouch(db, opts) {\n var PouchConstructor = opts.PouchConstructor;\n if (typeof db === 'string') {\n return new PouchConstructor(db, opts);\n } else {\n return db;\n }\n}\n\nfunction replicateWrapper(src, target, opts, callback) {\n\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n if (typeof opts === 'undefined') {\n opts = {};\n }\n\n if (opts.doc_ids && !Array.isArray(opts.doc_ids)) {\n throw createError(BAD_REQUEST,\n \"`doc_ids` filter parameter is not a list.\");\n }\n\n opts.complete = callback;\n opts = clone(opts);\n opts.continuous = opts.continuous || opts.live;\n opts.retry = ('retry' in opts) ? opts.retry : false;\n /*jshint validthis:true */\n opts.PouchConstructor = opts.PouchConstructor || this;\n var replicateRet = new Replication(opts);\n var srcPouch = toPouch(src, opts);\n var targetPouch = toPouch(target, opts);\n replicate(srcPouch, targetPouch, opts, replicateRet);\n return replicateRet;\n}\n\ninherits(Sync, events.EventEmitter);\nfunction sync$1(src, target, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n if (typeof opts === 'undefined') {\n opts = {};\n }\n opts = clone(opts);\n /*jshint validthis:true */\n opts.PouchConstructor = opts.PouchConstructor || this;\n src = toPouch(src, opts);\n target = toPouch(target, opts);\n return new Sync(src, target, opts, callback);\n}\n\nfunction Sync(src, target, opts, callback) {\n var self = this;\n this.canceled = false;\n\n var optsPush = opts.push ? $inject_Object_assign({}, opts, opts.push) : opts;\n var optsPull = opts.pull ? $inject_Object_assign({}, opts, opts.pull) : opts;\n\n this.push = replicateWrapper(src, target, optsPush);\n this.pull = replicateWrapper(target, src, optsPull);\n\n this.pushPaused = true;\n this.pullPaused = true;\n\n function pullChange(change) {\n self.emit('change', {\n direction: 'pull',\n change: change\n });\n }\n function pushChange(change) {\n self.emit('change', {\n direction: 'push',\n change: change\n });\n }\n function pushDenied(doc) {\n self.emit('denied', {\n direction: 'push',\n doc: doc\n });\n }\n function pullDenied(doc) {\n self.emit('denied', {\n direction: 'pull',\n doc: doc\n });\n }\n function pushPaused() {\n self.pushPaused = true;\n /* istanbul ignore if */\n if (self.pullPaused) {\n self.emit('paused');\n }\n }\n function pullPaused() {\n self.pullPaused = true;\n /* istanbul ignore if */\n if (self.pushPaused) {\n self.emit('paused');\n }\n }\n function pushActive() {\n self.pushPaused = false;\n /* istanbul ignore if */\n if (self.pullPaused) {\n self.emit('active', {\n direction: 'push'\n });\n }\n }\n function pullActive() {\n self.pullPaused = false;\n /* istanbul ignore if */\n if (self.pushPaused) {\n self.emit('active', {\n direction: 'pull'\n });\n }\n }\n\n var removed = {};\n\n function removeAll(type) { // type is 'push' or 'pull'\n return function (event, func) {\n var isChange = event === 'change' &&\n (func === pullChange || func === pushChange);\n var isDenied = event === 'denied' &&\n (func === pullDenied || func === pushDenied);\n var isPaused = event === 'paused' &&\n (func === pullPaused || func === pushPaused);\n var isActive = event === 'active' &&\n (func === pullActive || func === pushActive);\n\n if (isChange || isDenied || isPaused || isActive) {\n if (!(event in removed)) {\n removed[event] = {};\n }\n removed[event][type] = true;\n if (Object.keys(removed[event]).length === 2) {\n // both push and pull have asked to be removed\n self.removeAllListeners(event);\n }\n }\n };\n }\n\n if (opts.live) {\n this.push.on('complete', self.pull.cancel.bind(self.pull));\n this.pull.on('complete', self.push.cancel.bind(self.push));\n }\n\n function addOneListener(ee, event, listener) {\n if (ee.listeners(event).indexOf(listener) == -1) {\n ee.on(event, listener);\n }\n }\n\n this.on('newListener', function (event) {\n if (event === 'change') {\n addOneListener(self.pull, 'change', pullChange);\n addOneListener(self.push, 'change', pushChange);\n } else if (event === 'denied') {\n addOneListener(self.pull, 'denied', pullDenied);\n addOneListener(self.push, 'denied', pushDenied);\n } else if (event === 'active') {\n addOneListener(self.pull, 'active', pullActive);\n addOneListener(self.push, 'active', pushActive);\n } else if (event === 'paused') {\n addOneListener(self.pull, 'paused', pullPaused);\n addOneListener(self.push, 'paused', pushPaused);\n }\n });\n\n this.on('removeListener', function (event) {\n if (event === 'change') {\n self.pull.removeListener('change', pullChange);\n self.push.removeListener('change', pushChange);\n } else if (event === 'denied') {\n self.pull.removeListener('denied', pullDenied);\n self.push.removeListener('denied', pushDenied);\n } else if (event === 'active') {\n self.pull.removeListener('active', pullActive);\n self.push.removeListener('active', pushActive);\n } else if (event === 'paused') {\n self.pull.removeListener('paused', pullPaused);\n self.push.removeListener('paused', pushPaused);\n }\n });\n\n this.pull.on('removeListener', removeAll('pull'));\n this.push.on('removeListener', removeAll('push'));\n\n var promise = PouchPromise.all([\n this.push,\n this.pull\n ]).then(function (resp) {\n var out = {\n push: resp[0],\n pull: resp[1]\n };\n self.emit('complete', out);\n if (callback) {\n callback(null, out);\n }\n self.removeAllListeners();\n return out;\n }, function (err) {\n self.cancel();\n if (callback) {\n // if there's a callback, then the callback can receive\n // the error event\n callback(err);\n } else {\n // if there's no callback, then we're safe to emit an error\n // event, which would otherwise throw an unhandled error\n // due to 'error' being a special event in EventEmitters\n self.emit('error', err);\n }\n self.removeAllListeners();\n if (callback) {\n // no sense throwing if we're already emitting an 'error' event\n throw err;\n }\n });\n\n this.then = function (success, err) {\n return promise.then(success, err);\n };\n\n this[\"catch\"] = function (err) {\n return promise[\"catch\"](err);\n };\n}\n\nSync.prototype.cancel = function () {\n if (!this.canceled) {\n this.canceled = true;\n this.push.cancel();\n this.pull.cancel();\n }\n};\n\nfunction replication(PouchDB) {\n PouchDB.replicate = replicateWrapper;\n PouchDB.sync = sync$1;\n\n Object.defineProperty(PouchDB.prototype, 'replicate', {\n get: function () {\n var self = this;\n if (typeof this.replicateMethods === 'undefined') {\n this.replicateMethods = {\n from: function (other, opts, callback) {\n return self.constructor.replicate(other, self, opts, callback);\n },\n to: function (other, opts, callback) {\n return self.constructor.replicate(self, other, opts, callback);\n }\n };\n }\n return this.replicateMethods;\n }\n });\n\n PouchDB.prototype.sync = function (dbName, opts, callback) {\n return this.constructor.sync(this, dbName, opts, callback);\n };\n}\n\nPouchDB.plugin(IDBPouch)\n .plugin(WebSqlPouch$1)\n .plugin(HttpPouch$1)\n .plugin(mapreduce)\n .plugin(replication);\n\n// Pull from src because pouchdb-node/pouchdb-browser themselves\n// are aggressively optimized and jsnext:main would normally give us this\n// aggressive bundle.\n\nmodule.exports = PouchDB;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"1\":1,\"10\":10,\"11\":11,\"16\":16,\"2\":2,\"4\":4,\"5\":5,\"6\":6,\"7\":7}]},{},[17])(17)\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/pouchdb/dist/pouchdb.js\n// module id = 22\n// module chunks = 0","import Events from '../../_events';\nimport Routie from \"routie\";\n\n$(window).on(`${Events.AJAX} ${Events.LOADED}`, () => {\n Routie({\n 'navigation': function() {\n $('#NavbarCollapse').addClass('in');\n },\n 'carousel:id:num': function(id, num) {\n $(`#Carousel${ id}`).carousel(num);\n },\n });\n});\n\n\n// WEBPACK FOOTER //\n// ./app/client/src/js/_components/routes/index.js","\"use strict\";\n\nvar path = require('path');\n\nvar methods = ['get', 'post', 'put', 'patch', 'delete', 'del', 'all'];\n\nvar __slice = [].slice;\n\nmodule.exports = function (map) {\n var args, root, _map, cb;\n args = __slice.call(arguments, 1);\n\n if (typeof args[args.length - 1] === \"function\") cb = args.pop();\n\n root = path.join.apply(path, args);\n _map = {};\n methods.forEach(function (m) {\n _map[m] = function (subpath) {\n var args = __slice.call(arguments);\n args.length < 2 ? args.unshift(root) : args[0] = root + args[0];\n return map[m].apply(map, args);\n }\n });\n if (cb) cb(_map);\n return _map;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/routie/index.js\n// module id = 24\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/path-browserify/index.js\n// module id = 25\n// module chunks = 0","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/node_modules/process/browser.js\n// module id = 26\n// module chunks = 0","/*! smooth-scroll v14.2.0 | (c) 2018 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */\n!(function(e,t){\"function\"==typeof define&&define.amd?define([],(function(){return t(e)})):\"object\"==typeof exports?module.exports=t(e):e.SmoothScroll=t(e)})(\"undefined\"!=typeof global?global:\"undefined\"!=typeof window?window:this,(function(e){\"use strict\";var t={ignore:\"[data-scroll-ignore]\",header:null,topOnEmptyHash:!0,speed:500,clip:!0,offset:0,easing:\"easeInOutCubic\",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},n=function(){return\"querySelector\"in document&&\"addEventListener\"in e&&\"requestAnimationFrame\"in e&&\"closest\"in e.Element.prototype},o=function(){for(var e={},t=0;t<arguments.length;t++)!(function(t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(arguments[t]);return e},r=function(t){return!!(\"matchMedia\"in e&&e.matchMedia(\"(prefers-reduced-motion)\").matches)},a=function(t){return parseInt(e.getComputedStyle(t).height,10)},i=function(e){var t;try{t=decodeURIComponent(e)}catch(n){t=e}return t},c=function(e){\"#\"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,r=-1,a=\"\",i=n.charCodeAt(0);++r<o;){if(0===(t=n.charCodeAt(r)))throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");t>=1&&t<=31||127==t||0===r&&t>=48&&t<=57||1===r&&t>=48&&t<=57&&45===i?a+=\"\\\\\"+t.toString(16)+\" \":a+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(r):\"\\\\\"+n.charAt(r)}var c;try{c=decodeURIComponent(\"#\"+a)}catch(e){c=\"#\"+a}return c},u=function(e,t){var n;return\"easeInQuad\"===e.easing&&(n=t*t),\"easeOutQuad\"===e.easing&&(n=t*(2-t)),\"easeInOutQuad\"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),\"easeInCubic\"===e.easing&&(n=t*t*t),\"easeOutCubic\"===e.easing&&(n=--t*t*t+1),\"easeInOutCubic\"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),\"easeInQuart\"===e.easing&&(n=t*t*t*t),\"easeOutQuart\"===e.easing&&(n=1- --t*t*t*t),\"easeInOutQuart\"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),\"easeInQuint\"===e.easing&&(n=t*t*t*t*t),\"easeOutQuint\"===e.easing&&(n=1+--t*t*t*t*t),\"easeInOutQuint\"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t},s=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},l=function(t,n,o,r){var a=0;if(t.offsetParent)do{a+=t.offsetTop,t=t.offsetParent}while(t);return a=Math.max(a-n-o,0),r&&(a=Math.min(a,s()-e.innerHeight)),a},d=function(e){return e?a(e)+e.offsetTop:0},f=function(e,t,n){t||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?\"#top\":\"#\"+e.id)},m=function(t,n,o){0===t&&document.body.focus(),o||(t.focus(),document.activeElement!==t&&(t.setAttribute(\"tabindex\",\"-1\"),t.focus(),t.style.outline=\"none\"),e.scrollTo(0,n))},h=function(t,n,o,r){if(n.emitEvents&&\"function\"==typeof e.CustomEvent){var a=new CustomEvent(t,{bubbles:!0,detail:{anchor:o,toggle:r}});document.dispatchEvent(a)}};return function(a,p){var g,v,y,S,E,b,O,I={};I.cancelScroll=function(e){cancelAnimationFrame(O),O=null,e||h(\"scrollCancel\",g)},I.animateScroll=function(n,r,a){var i=o(g||t,a||{}),c=\"[object Number]\"===Object.prototype.toString.call(n),p=c||!n.tagName?null:n;if(c||p){var v=e.pageYOffset;i.header&&!S&&(S=document.querySelector(i.header)),E||(E=d(S));var y,b,C,w=c?n:l(p,E,parseInt(\"function\"==typeof i.offset?i.offset(n,r):i.offset,10),i.clip),L=w-v,A=s(),H=0,q=function(t,o){var a=e.pageYOffset;if(t==o||a==o||(v<o&&e.innerHeight+a)>=A)return I.cancelScroll(!0),m(n,o,c),h(\"scrollStop\",i,n,r),y=null,O=null,!0},Q=function(t){y||(y=t),H+=t-y,b=H/parseInt(i.speed,10),b=b>1?1:b,C=v+L*u(i,b),e.scrollTo(0,Math.floor(C)),q(C,w)||(O=e.requestAnimationFrame(Q),y=t)};0===e.pageYOffset&&e.scrollTo(0,0),f(n,c,i),h(\"scrollStart\",i,n,r),I.cancelScroll(!0),e.requestAnimationFrame(Q)}};var C=function(t){if(!r()&&0===t.button&&!t.metaKey&&!t.ctrlKey&&\"closest\"in t.target&&(y=t.target.closest(a))&&\"a\"===y.tagName.toLowerCase()&&!t.target.closest(g.ignore)&&y.hostname===e.location.hostname&&y.pathname===e.location.pathname&&/#/.test(y.href)){var n=c(i(y.hash)),o=g.topOnEmptyHash&&\"#\"===n?document.documentElement:document.querySelector(n);o=o||\"#top\"!==n?o:document.documentElement,o&&(t.preventDefault(),I.animateScroll(o,y))}},w=function(e){if(history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(g)&&history.state.anchor){var t=document.querySelector(c(i(history.state.anchor)));t&&I.animateScroll(t,null,{updateURL:!1})}},L=function(e){b||(b=setTimeout((function(){b=null,E=d(S)}),66))};return I.destroy=function(){g&&(document.removeEventListener(\"click\",C,!1),e.removeEventListener(\"resize\",L,!1),e.removeEventListener(\"popstate\",w,!1),I.cancelScroll(),g=null,v=null,y=null,S=null,E=null,b=null,O=null)},I.init=function(r){if(!n())throw\"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.\";I.destroy(),g=o(t,r||{}),S=g.header?document.querySelector(g.header):null,E=d(S),document.addEventListener(\"click\",C,!1),S&&e.addEventListener(\"resize\",L,!1),g.updateURL&&g.popstate&&e.addEventListener(\"popstate\",w,!1)},I.init(p),I}}));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/smooth-scroll/dist/smooth-scroll.min.js\n// module id = 27\n// module chunks = 0","var map = {\n\t\"./icon-cfpb.png\": 29,\n\t\"./icon-lender.png\": 30,\n\t\"./logo.png\": 31\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) // check for number or string\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\treturn id;\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 28;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/client/src/img nonrecursive \\.(png|jpe?g|svg)$\n// module id = 28\n// module chunks = 0","module.exports = \"../img/icon-cfpb.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/client/src/img/icon-cfpb.png\n// module id = 29\n// module chunks = 0","module.exports = \"../img/icon-lender.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/client/src/img/icon-lender.png\n// module id = 30\n// module chunks = 0","module.exports = \"../img/logo.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/client/src/img/logo.png\n// module id = 31\n// module chunks = 0","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 32;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/font-awesome nonrecursive \\.(otf|eot|svg|ttf|woff|woff2)$\n// module id = 32\n// module chunks = 0"],"sourceRoot":""}